1 ; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s --check-prefix=R600-CHECK 2 ; RUN: llc < %s -march=r600 -mcpu=SI -verify-machineinstrs | FileCheck %s --check-prefix=SI-CHECK 3 4 ; R600-CHECK: @sint_to_fp_v2i32 5 ; R600-CHECK-DAG: INT_TO_FLT * T{{[0-9]+\.[XYZW]}}, KC0[2].W 6 ; R600-CHECK-DAG: INT_TO_FLT * T{{[0-9]+\.[XYZW]}}, KC0[3].X 7 ; SI-CHECK: @sint_to_fp_v2i32 8 ; SI-CHECK: V_CVT_F32_I32_e32 9 ; SI-CHECK: V_CVT_F32_I32_e32 10 define void @sint_to_fp_v2i32(<2 x float> addrspace(1)* %out, <2 x i32> %in) { 11 %result = sitofp <2 x i32> %in to <2 x float> 12 store <2 x float> %result, <2 x float> addrspace(1)* %out 13 ret void 14 } 15 16 ; R600-CHECK: @sint_to_fp_v4i32 17 ; R600-CHECK: INT_TO_FLT * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 18 ; R600-CHECK: INT_TO_FLT * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 19 ; R600-CHECK: INT_TO_FLT * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 20 ; R600-CHECK: INT_TO_FLT * T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}} 21 ; SI-CHECK: @sint_to_fp_v4i32 22 ; SI-CHECK: V_CVT_F32_I32_e32 23 ; SI-CHECK: V_CVT_F32_I32_e32 24 ; SI-CHECK: V_CVT_F32_I32_e32 25 ; SI-CHECK: V_CVT_F32_I32_e32 26 define void @sint_to_fp_v4i32(<4 x float> addrspace(1)* %out, <4 x i32> addrspace(1)* %in) { 27 %value = load <4 x i32> addrspace(1) * %in 28 %result = sitofp <4 x i32> %value to <4 x float> 29 store <4 x float> %result, <4 x float> addrspace(1)* %out 30 ret void 31 } 32 33 ; FUNC-LABEL: @sint_to_fp_i1_f32: 34 ; SI: V_CMP_EQ_I32_e64 [[CMP:s\[[0-9]+:[0-9]\]]], 35 ; SI-NEXT: V_CNDMASK_B32_e64 [[RESULT:v[0-9]+]], 0, -1.000000e+00, [[CMP]] 36 ; SI: BUFFER_STORE_DWORD [[RESULT]], 37 ; SI: S_ENDPGM 38 define void @sint_to_fp_i1_f32(float addrspace(1)* %out, i32 %in) { 39 %cmp = icmp eq i32 %in, 0 40 %fp = uitofp i1 %cmp to float 41 store float %fp, float addrspace(1)* %out, align 4 42 ret void 43 } 44 45 ; FUNC-LABEL: @sint_to_fp_i1_f32_load: 46 ; SI: V_CNDMASK_B32_e64 [[RESULT:v[0-9]+]], 0, -1.000000e+00 47 ; SI: BUFFER_STORE_DWORD [[RESULT]], 48 ; SI: S_ENDPGM 49 define void @sint_to_fp_i1_f32_load(float addrspace(1)* %out, i1 %in) { 50 %fp = sitofp i1 %in to float 51 store float %fp, float addrspace(1)* %out, align 4 52 ret void 53 } 54