1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=WAVE64 %s
3 # RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=WAVE32 %s
13 liveins: $sgpr0, $vgpr0, $vgpr3_vgpr4
15 ; WAVE64-LABEL: name: sitofp
16 ; WAVE64: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
17 ; WAVE64: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
18 ; WAVE64: [[COPY2:%[0-9]+]]:vreg_64 = COPY $vgpr3_vgpr4
19 ; WAVE64: [[V_CVT_F32_I32_e64_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e64 [[COPY]], 0, 0, implicit $mode, implicit $exec
20 ; WAVE64: [[V_CVT_F32_I32_e64_1:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e64 [[COPY1]], 0, 0, implicit $mode, implicit $exec
21 ; WAVE64: FLAT_STORE_DWORD [[COPY2]], [[V_CVT_F32_I32_e64_]], 0, 0, implicit $exec, implicit $flat_scr :: (store (s32), addrspace 1)
22 ; WAVE64: FLAT_STORE_DWORD [[COPY2]], [[V_CVT_F32_I32_e64_1]], 0, 0, implicit $exec, implicit $flat_scr :: (store (s32), addrspace 1)
23 ; WAVE32-LABEL: name: sitofp
24 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
25 ; WAVE32: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
26 ; WAVE32: [[COPY2:%[0-9]+]]:vreg_64 = COPY $vgpr3_vgpr4
27 ; WAVE32: [[V_CVT_F32_I32_e64_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e64 [[COPY]], 0, 0, implicit $mode, implicit $exec
28 ; WAVE32: [[V_CVT_F32_I32_e64_1:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e64 [[COPY1]], 0, 0, implicit $mode, implicit $exec
29 ; WAVE32: GLOBAL_STORE_DWORD [[COPY2]], [[V_CVT_F32_I32_e64_]], 0, 0, implicit $exec :: (store (s32), addrspace 1)
30 ; WAVE32: GLOBAL_STORE_DWORD [[COPY2]], [[V_CVT_F32_I32_e64_1]], 0, 0, implicit $exec :: (store (s32), addrspace 1)
31 %0:sgpr(s32) = COPY $sgpr0
33 %1:vgpr(s32) = COPY $vgpr0
35 %2:vgpr(p1) = COPY $vgpr3_vgpr4
38 %3:vgpr(s32) = G_SITOFP %0
41 %4:vgpr(s32) = G_SITOFP %1
43 G_STORE %3, %2 :: (store (s32), addrspace 1)
44 G_STORE %4, %2 :: (store (s32), addrspace 1)
48 name: sitofp_s32_to_s16_vv
51 tracksRegLiveness: true
57 ; WAVE64-LABEL: name: sitofp_s32_to_s16_vv
58 ; WAVE64: liveins: $vgpr0
59 ; WAVE64: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
60 ; WAVE64: [[V_CVT_F32_I32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e32 [[COPY]], implicit $mode, implicit $exec
61 ; WAVE64: %1:vgpr_32 = nofpexcept V_CVT_F16_F32_e32 [[V_CVT_F32_I32_e32_]], implicit $mode, implicit $exec
62 ; WAVE64: $vgpr0 = COPY %1
63 ; WAVE32-LABEL: name: sitofp_s32_to_s16_vv
64 ; WAVE32: liveins: $vgpr0
65 ; WAVE32: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
66 ; WAVE32: [[V_CVT_F32_I32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e32 [[COPY]], implicit $mode, implicit $exec
67 ; WAVE32: %1:vgpr_32 = nofpexcept V_CVT_F16_F32_e32 [[V_CVT_F32_I32_e32_]], implicit $mode, implicit $exec
68 ; WAVE32: $vgpr0 = COPY %1
69 %0:vgpr(s32) = COPY $vgpr0
70 %1:vgpr(s16) = G_SITOFP %0
71 %2:vgpr(s32) = G_ANYEXT %1
76 name: sitofp_s32_to_s16_vs
79 tracksRegLiveness: true
85 ; WAVE64-LABEL: name: sitofp_s32_to_s16_vs
86 ; WAVE64: liveins: $sgpr0
87 ; WAVE64: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
88 ; WAVE64: [[V_CVT_F32_I32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e32 [[COPY]], implicit $mode, implicit $exec
89 ; WAVE64: %1:vgpr_32 = nofpexcept V_CVT_F16_F32_e32 [[V_CVT_F32_I32_e32_]], implicit $mode, implicit $exec
90 ; WAVE64: $vgpr0 = COPY %1
91 ; WAVE32-LABEL: name: sitofp_s32_to_s16_vs
92 ; WAVE32: liveins: $sgpr0
93 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
94 ; WAVE32: [[V_CVT_F32_I32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e32 [[COPY]], implicit $mode, implicit $exec
95 ; WAVE32: %1:vgpr_32 = nofpexcept V_CVT_F16_F32_e32 [[V_CVT_F32_I32_e32_]], implicit $mode, implicit $exec
96 ; WAVE32: $vgpr0 = COPY %1
97 %0:sgpr(s32) = COPY $sgpr0
98 %1:vgpr(s16) = G_SITOFP %0
99 %2:vgpr(s32) = G_ANYEXT %1