1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=hawaii -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck -check-prefix=WAVE64 %s
3 # RUN: llc -march=amdgcn -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 $exec
20 ; WAVE64: [[V_CVT_F32_I32_e64_1:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e64 [[COPY1]], 0, 0, implicit $exec
21 ; WAVE64: FLAT_STORE_DWORD [[COPY2]], [[V_CVT_F32_I32_e64_]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (store 4, addrspace 1)
22 ; WAVE64: FLAT_STORE_DWORD [[COPY2]], [[V_CVT_F32_I32_e64_1]], 0, 0, 0, 0, implicit $exec, implicit $flat_scr :: (store 4, addrspace 1)
23 ; WAVE32-LABEL: name: sitofp
24 ; WAVE32: $vcc_hi = IMPLICIT_DEF
25 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
26 ; WAVE32: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
27 ; WAVE32: [[COPY2:%[0-9]+]]:vreg_64 = COPY $vgpr3_vgpr4
28 ; WAVE32: [[V_CVT_F32_I32_e64_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e64 [[COPY]], 0, 0, implicit $exec
29 ; WAVE32: [[V_CVT_F32_I32_e64_1:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e64 [[COPY1]], 0, 0, implicit $exec
30 ; WAVE32: GLOBAL_STORE_DWORD [[COPY2]], [[V_CVT_F32_I32_e64_]], 0, 0, 0, 0, implicit $exec :: (store 4, addrspace 1)
31 ; WAVE32: GLOBAL_STORE_DWORD [[COPY2]], [[V_CVT_F32_I32_e64_1]], 0, 0, 0, 0, implicit $exec :: (store 4, addrspace 1)
32 %0:sgpr(s32) = COPY $sgpr0
34 %1:vgpr(s32) = COPY $vgpr0
36 %2:vgpr(p1) = COPY $vgpr3_vgpr4
39 %3:vgpr(s32) = G_SITOFP %0
42 %4:vgpr(s32) = G_SITOFP %1
44 G_STORE %3, %2 :: (store 4, addrspace 1)
45 G_STORE %4, %2 :: (store 4, addrspace 1)
49 name: sitofp_s32_to_s16_vv
52 tracksRegLiveness: true
58 ; WAVE64-LABEL: name: sitofp_s32_to_s16_vv
59 ; WAVE64: liveins: $vgpr0
60 ; WAVE64: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
61 ; WAVE64: [[V_CVT_F32_I32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e32 [[COPY]], implicit $exec
62 ; WAVE64: [[V_CVT_F16_F32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F16_F32_e32 [[V_CVT_F32_I32_e32_]], implicit $exec
63 ; WAVE64: $vgpr0 = COPY [[V_CVT_F16_F32_e32_]]
64 ; WAVE32-LABEL: name: sitofp_s32_to_s16_vv
65 ; WAVE32: liveins: $vgpr0
66 ; WAVE32: $vcc_hi = IMPLICIT_DEF
67 ; WAVE32: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
68 ; WAVE32: [[V_CVT_F32_I32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e32 [[COPY]], implicit $exec
69 ; WAVE32: [[V_CVT_F16_F32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F16_F32_e32 [[V_CVT_F32_I32_e32_]], implicit $exec
70 ; WAVE32: $vgpr0 = COPY [[V_CVT_F16_F32_e32_]]
71 %0:vgpr(s32) = COPY $vgpr0
72 %1:vgpr(s16) = G_SITOFP %0
73 %2:vgpr(s32) = G_ANYEXT %1
78 name: sitofp_s32_to_s16_vs
81 tracksRegLiveness: true
87 ; WAVE64-LABEL: name: sitofp_s32_to_s16_vs
88 ; WAVE64: liveins: $sgpr0
89 ; WAVE64: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
90 ; WAVE64: [[V_CVT_F32_I32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e32 [[COPY]], implicit $exec
91 ; WAVE64: [[V_CVT_F16_F32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F16_F32_e32 [[V_CVT_F32_I32_e32_]], implicit $exec
92 ; WAVE64: $vgpr0 = COPY [[V_CVT_F16_F32_e32_]]
93 ; WAVE32-LABEL: name: sitofp_s32_to_s16_vs
94 ; WAVE32: liveins: $sgpr0
95 ; WAVE32: $vcc_hi = IMPLICIT_DEF
96 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
97 ; WAVE32: [[V_CVT_F32_I32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F32_I32_e32 [[COPY]], implicit $exec
98 ; WAVE32: [[V_CVT_F16_F32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F16_F32_e32 [[V_CVT_F32_I32_e32_]], implicit $exec
99 ; WAVE32: $vgpr0 = COPY [[V_CVT_F16_F32_e32_]]
100 %0:sgpr(s32) = COPY $sgpr0
101 %1:vgpr(s16) = G_SITOFP %0
102 %2:vgpr(s32) = G_ANYEXT %1
107 name: sitofp_s1_to_s32_s_scc
109 regBankSelected: true
110 tracksRegLiveness: true
116 ; WAVE64-LABEL: name: sitofp_s1_to_s32_s_scc
117 ; WAVE64: liveins: $sgpr0
118 ; WAVE64: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
119 ; WAVE64: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
120 ; WAVE64: S_CMP_EQ_U32 [[COPY]], [[S_MOV_B32_]], implicit-def $scc
121 ; WAVE64: [[COPY1:%[0-9]+]]:sreg_32 = COPY $scc
122 ; WAVE64: $scc = COPY [[COPY1]]
123 ; WAVE64: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 3212836864, implicit $scc
124 ; WAVE64: $sgpr0 = COPY [[S_CSELECT_B32_]]
125 ; WAVE32-LABEL: name: sitofp_s1_to_s32_s_scc
126 ; WAVE32: liveins: $sgpr0
127 ; WAVE32: $vcc_hi = IMPLICIT_DEF
128 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
129 ; WAVE32: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
130 ; WAVE32: S_CMP_EQ_U32 [[COPY]], [[S_MOV_B32_]], implicit-def $scc
131 ; WAVE32: [[COPY1:%[0-9]+]]:sreg_32 = COPY $scc
132 ; WAVE32: $scc = COPY [[COPY1]]
133 ; WAVE32: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 3212836864, implicit $scc
134 ; WAVE32: $sgpr0 = COPY [[S_CSELECT_B32_]]
135 %0:sgpr(s32) = COPY $sgpr0
136 %1:sgpr(s32) = G_CONSTANT i32 0
137 %2:scc(s1) = G_ICMP intpred(eq), %0, %1
138 %3:sgpr(s32) = G_SITOFP %2
143 name: sitofp_s1_to_s16_to_s_scc
145 regBankSelected: true
146 tracksRegLiveness: true
152 ; WAVE64-LABEL: name: sitofp_s1_to_s16_to_s_scc
153 ; WAVE64: liveins: $sgpr0
154 ; WAVE64: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
155 ; WAVE64: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
156 ; WAVE64: S_CMP_EQ_U32 [[COPY]], [[S_MOV_B32_]], implicit-def $scc
157 ; WAVE64: [[COPY1:%[0-9]+]]:sreg_32 = COPY $scc
158 ; WAVE64: $scc = COPY [[COPY1]]
159 ; WAVE64: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 48128, implicit $scc
160 ; WAVE64: $sgpr0 = COPY [[S_CSELECT_B32_]]
161 ; WAVE32-LABEL: name: sitofp_s1_to_s16_to_s_scc
162 ; WAVE32: liveins: $sgpr0
163 ; WAVE32: $vcc_hi = IMPLICIT_DEF
164 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
165 ; WAVE32: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
166 ; WAVE32: S_CMP_EQ_U32 [[COPY]], [[S_MOV_B32_]], implicit-def $scc
167 ; WAVE32: [[COPY1:%[0-9]+]]:sreg_32 = COPY $scc
168 ; WAVE32: $scc = COPY [[COPY1]]
169 ; WAVE32: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 48128, implicit $scc
170 ; WAVE32: $sgpr0 = COPY [[S_CSELECT_B32_]]
171 %0:sgpr(s32) = COPY $sgpr0
172 %1:sgpr(s32) = G_CONSTANT i32 0
173 %2:scc(s1) = G_ICMP intpred(eq), %0, %1
174 %3:sgpr(s16) = G_SITOFP %2
175 %4:sgpr(s32) = G_ANYEXT %3
180 name: sitofp_s1_to_s64_s_scc
182 regBankSelected: true
183 tracksRegLiveness: true
189 ; WAVE64-LABEL: name: sitofp_s1_to_s64_s_scc
190 ; WAVE64: liveins: $sgpr0
191 ; WAVE64: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
192 ; WAVE64: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
193 ; WAVE64: S_CMP_EQ_U32 [[COPY]], [[S_MOV_B32_]], implicit-def $scc
194 ; WAVE64: [[COPY1:%[0-9]+]]:sreg_32 = COPY $scc
195 ; WAVE64: $scc = COPY [[COPY1]]
196 ; WAVE64: [[S_CSELECT_B64_:%[0-9]+]]:sreg_64_xexec = S_CSELECT_B64 0, -4616189618054758400, implicit $scc
197 ; WAVE64: $sgpr0_sgpr1 = COPY [[S_CSELECT_B64_]]
198 ; WAVE32-LABEL: name: sitofp_s1_to_s64_s_scc
199 ; WAVE32: liveins: $sgpr0
200 ; WAVE32: $vcc_hi = IMPLICIT_DEF
201 ; WAVE32: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
202 ; WAVE32: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
203 ; WAVE32: S_CMP_EQ_U32 [[COPY]], [[S_MOV_B32_]], implicit-def $scc
204 ; WAVE32: [[COPY1:%[0-9]+]]:sreg_32 = COPY $scc
205 ; WAVE32: $scc = COPY [[COPY1]]
206 ; WAVE32: [[S_CSELECT_B64_:%[0-9]+]]:sreg_64_xexec = S_CSELECT_B64 0, -4616189618054758400, implicit $scc
207 ; WAVE32: $sgpr0_sgpr1 = COPY [[S_CSELECT_B64_]]
208 %0:sgpr(s32) = COPY $sgpr0
209 %1:sgpr(s32) = G_CONSTANT i32 0
210 %2:scc(s1) = G_ICMP intpred(eq), %0, %1
211 %3:sgpr(s64) = G_SITOFP %2
212 $sgpr0_sgpr1 = COPY %3
216 name: sitofp_s1_to_s32_v_vcc
218 regBankSelected: true
219 tracksRegLiveness: true
225 ; WAVE64-LABEL: name: sitofp_s1_to_s32_v_vcc
226 ; WAVE64: liveins: $vgpr0
227 ; WAVE64: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
228 ; WAVE64: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
229 ; WAVE64: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
230 ; WAVE64: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 3212836864, [[V_CMP_EQ_U32_e64_]], implicit $exec
231 ; WAVE64: $vgpr0 = COPY [[V_CNDMASK_B32_e64_]]
232 ; WAVE32-LABEL: name: sitofp_s1_to_s32_v_vcc
233 ; WAVE32: liveins: $vgpr0
234 ; WAVE32: $vcc_hi = IMPLICIT_DEF
235 ; WAVE32: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
236 ; WAVE32: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
237 ; WAVE32: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_32_xm0_xexec = V_CMP_EQ_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
238 ; WAVE32: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 3212836864, [[V_CMP_EQ_U32_e64_]], implicit $exec
239 ; WAVE32: $vgpr0 = COPY [[V_CNDMASK_B32_e64_]]
240 %0:vgpr(s32) = COPY $vgpr0
241 %1:vgpr(s32) = G_CONSTANT i32 0
242 %2:vcc(s1) = G_ICMP intpred(eq), %0, %1
243 %3:vgpr(s32) = G_SITOFP %2
248 name: sitofp_s1_to_s16_to_v_vcc
250 regBankSelected: true
251 tracksRegLiveness: true
257 ; WAVE64-LABEL: name: sitofp_s1_to_s16_to_v_vcc
258 ; WAVE64: liveins: $vgpr0
259 ; WAVE64: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
260 ; WAVE64: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
261 ; WAVE64: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
262 ; WAVE64: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 3212836864, [[V_CMP_EQ_U32_e64_]], implicit $exec
263 ; WAVE64: [[V_CVT_F16_F32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F16_F32_e32 [[V_CNDMASK_B32_e64_]], implicit $exec
264 ; WAVE64: $vgpr0 = COPY [[V_CVT_F16_F32_e32_]]
265 ; WAVE32-LABEL: name: sitofp_s1_to_s16_to_v_vcc
266 ; WAVE32: liveins: $vgpr0
267 ; WAVE32: $vcc_hi = IMPLICIT_DEF
268 ; WAVE32: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
269 ; WAVE32: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
270 ; WAVE32: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_32_xm0_xexec = V_CMP_EQ_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
271 ; WAVE32: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 3212836864, [[V_CMP_EQ_U32_e64_]], implicit $exec
272 ; WAVE32: [[V_CVT_F16_F32_e32_:%[0-9]+]]:vgpr_32 = V_CVT_F16_F32_e32 [[V_CNDMASK_B32_e64_]], implicit $exec
273 ; WAVE32: $vgpr0 = COPY [[V_CVT_F16_F32_e32_]]
274 %0:vgpr(s32) = COPY $vgpr0
275 %1:vgpr(s32) = G_CONSTANT i32 0
276 %2:vcc(s1) = G_ICMP intpred(eq), %0, %1
277 %3:vgpr(s16) = G_SITOFP %2
278 %4:vgpr(s32) = G_ANYEXT %3
283 name: sitofp_s1_to_s64_v_vcc
285 regBankSelected: true
286 tracksRegLiveness: true
292 ; WAVE64-LABEL: name: sitofp_s1_to_s64_v_vcc
293 ; WAVE64: liveins: $vgpr0
294 ; WAVE64: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
295 ; WAVE64: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
296 ; WAVE64: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
297 ; WAVE64: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, -1, [[V_CMP_EQ_U32_e64_]], implicit $exec
298 ; WAVE64: [[V_CVT_F64_I32_e32_:%[0-9]+]]:vreg_64 = V_CVT_F64_I32_e32 [[V_CNDMASK_B32_e64_]], implicit $exec
299 ; WAVE64: $vgpr0_vgpr1 = COPY [[V_CVT_F64_I32_e32_]]
300 ; WAVE32-LABEL: name: sitofp_s1_to_s64_v_vcc
301 ; WAVE32: liveins: $vgpr0
302 ; WAVE32: $vcc_hi = IMPLICIT_DEF
303 ; WAVE32: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
304 ; WAVE32: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 0, implicit $exec
305 ; WAVE32: [[V_CMP_EQ_U32_e64_:%[0-9]+]]:sreg_32_xm0_xexec = V_CMP_EQ_U32_e64 [[COPY]], [[V_MOV_B32_e32_]], implicit $exec
306 ; WAVE32: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, -1, [[V_CMP_EQ_U32_e64_]], implicit $exec
307 ; WAVE32: [[V_CVT_F64_I32_e32_:%[0-9]+]]:vreg_64 = V_CVT_F64_I32_e32 [[V_CNDMASK_B32_e64_]], implicit $exec
308 ; WAVE32: $vgpr0_vgpr1 = COPY [[V_CVT_F64_I32_e32_]]
309 %0:vgpr(s32) = COPY $vgpr0
310 %1:vgpr(s32) = G_CONSTANT i32 0
311 %2:vcc(s1) = G_ICMP intpred(eq), %0, %1
312 %3:vgpr(s64) = G_SITOFP %2
313 $vgpr0_vgpr1 = COPY %3