SelectionDAG: Factor ISD::MUL lowering code out of DAGTypeLegalizer
[oota-llvm.git] / test / CodeGen / R600 / mul_uint24-i64.ll
1 ; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=EG --check-prefix=FUNC
2 ; RUN: llc < %s -march=r600 -mcpu=cayman | FileCheck %s --check-prefix=EG --check-prefix=FUNC
3 ; RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs | FileCheck %s --check-prefix=SI --check-prefix=FUNC
4
5 ; FIXME: Move this test into mul_uint24.ll once i64 mul is supported.
6 ; XFAIL: *
7
8 ; Multiply with 24-bit inputs and 64-bit output
9 ; FUNC_LABEL: @mul24_i64
10 ; EG; MUL_UINT24
11 ; EG: MULHI
12 ; SI: V_MUL_U32_U24
13 ; FIXME: SI support 24-bit mulhi
14 ; SI: V_MUL_HI_U32
15 define void @mul24_i64(i64 addrspace(1)* %out, i64 %a, i64 %b) {
16 entry:
17   %0 = shl i64 %a, 40
18   %a_24 = lshr i64 %0, 40
19   %1 = shl i64 %b, 40
20   %b_24 = lshr i64 %1, 40
21   %2 = mul i64 %a_24, %b_24
22   store i64 %2, i64 addrspace(1)* %out
23   ret void
24 }