1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=WAVE64 %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=WAVE32 %s
4 # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -run-pass=instruction-select -verify-machineinstrs -o - %s | FileCheck -check-prefix=GFX11 %s
14 liveins: $sgpr0, $vgpr0
16 ; WAVE64-LABEL: name: icmp_eq_s16_sv
17 ; WAVE64: liveins: $sgpr0, $vgpr0
19 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
20 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
21 ; WAVE64-NEXT: [[V_CMP_EQ_U16_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U16_e64 [[COPY]], [[COPY1]], implicit $exec
22 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[V_CMP_EQ_U16_e64_]]
23 ; WAVE32-LABEL: name: icmp_eq_s16_sv
24 ; WAVE32: liveins: $sgpr0, $vgpr0
26 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
27 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
28 ; WAVE32-NEXT: [[V_CMP_EQ_U16_e64_:%[0-9]+]]:sreg_32 = V_CMP_EQ_U16_e64 [[COPY]], [[COPY1]], implicit $exec
29 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[V_CMP_EQ_U16_e64_]]
30 ; GFX11-LABEL: name: icmp_eq_s16_sv
31 ; GFX11: liveins: $sgpr0, $vgpr0
33 ; GFX11-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
34 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
35 ; GFX11-NEXT: [[V_CMP_EQ_U16_t16_e64_:%[0-9]+]]:sreg_32 = V_CMP_EQ_U16_t16_e64 [[COPY]], [[COPY1]], implicit $exec
36 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_CMP_EQ_U16_t16_e64_]]
37 %0:sgpr(s32) = COPY $sgpr0
38 %1:vgpr(s32) = COPY $vgpr0
39 %2:sgpr(s16) = G_TRUNC %0
40 %3:vgpr(s16) = G_TRUNC %1
41 %4:vcc(s1) = G_ICMP intpred(eq), %2, %3
42 S_ENDPGM 0, implicit %4
53 liveins: $sgpr0, $vgpr0
55 ; WAVE64-LABEL: name: icmp_eq_s16_vs
56 ; WAVE64: liveins: $sgpr0, $vgpr0
58 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
59 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
60 ; WAVE64-NEXT: [[V_CMP_EQ_U16_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U16_e64 [[COPY]], [[COPY1]], implicit $exec
61 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[V_CMP_EQ_U16_e64_]]
62 ; WAVE32-LABEL: name: icmp_eq_s16_vs
63 ; WAVE32: liveins: $sgpr0, $vgpr0
65 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
66 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
67 ; WAVE32-NEXT: [[V_CMP_EQ_U16_e64_:%[0-9]+]]:sreg_32 = V_CMP_EQ_U16_e64 [[COPY]], [[COPY1]], implicit $exec
68 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[V_CMP_EQ_U16_e64_]]
69 ; GFX11-LABEL: name: icmp_eq_s16_vs
70 ; GFX11: liveins: $sgpr0, $vgpr0
72 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
73 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
74 ; GFX11-NEXT: [[V_CMP_EQ_U16_t16_e64_:%[0-9]+]]:sreg_32 = V_CMP_EQ_U16_t16_e64 [[COPY]], [[COPY1]], implicit $exec
75 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_CMP_EQ_U16_t16_e64_]]
76 %0:vgpr(s32) = COPY $vgpr0
77 %1:sgpr(s32) = COPY $sgpr0
78 %2:vgpr(s16) = G_TRUNC %0
79 %3:sgpr(s16) = G_TRUNC %1
80 %4:vcc(s1) = G_ICMP intpred(eq), %2, %3
81 S_ENDPGM 0, implicit %4
92 liveins: $vgpr0, $vgpr1
94 ; WAVE64-LABEL: name: icmp_eq_s16_vv
95 ; WAVE64: liveins: $vgpr0, $vgpr1
97 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
98 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
99 ; WAVE64-NEXT: [[V_CMP_EQ_U16_e64_:%[0-9]+]]:sreg_64 = V_CMP_EQ_U16_e64 [[COPY]], [[COPY1]], implicit $exec
100 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[V_CMP_EQ_U16_e64_]]
101 ; WAVE32-LABEL: name: icmp_eq_s16_vv
102 ; WAVE32: liveins: $vgpr0, $vgpr1
103 ; WAVE32-NEXT: {{ $}}
104 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
105 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
106 ; WAVE32-NEXT: [[V_CMP_EQ_U16_e64_:%[0-9]+]]:sreg_32 = V_CMP_EQ_U16_e64 [[COPY]], [[COPY1]], implicit $exec
107 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[V_CMP_EQ_U16_e64_]]
108 ; GFX11-LABEL: name: icmp_eq_s16_vv
109 ; GFX11: liveins: $vgpr0, $vgpr1
111 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
112 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
113 ; GFX11-NEXT: [[V_CMP_EQ_U16_t16_e64_:%[0-9]+]]:sreg_32 = V_CMP_EQ_U16_t16_e64 [[COPY]], [[COPY1]], implicit $exec
114 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_CMP_EQ_U16_t16_e64_]]
115 %0:vgpr(s32) = COPY $vgpr0
116 %1:vgpr(s32) = COPY $vgpr1
117 %2:vgpr(s16) = G_TRUNC %0
118 %3:vgpr(s16) = G_TRUNC %1
119 %4:vcc(s1) = G_ICMP intpred(eq), %2, %3
120 S_ENDPGM 0, implicit %4
127 regBankSelected: true
131 liveins: $vgpr0, $vgpr1
133 ; WAVE64-LABEL: name: icmp_ne_s16_vv
134 ; WAVE64: liveins: $vgpr0, $vgpr1
135 ; WAVE64-NEXT: {{ $}}
136 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
137 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
138 ; WAVE64-NEXT: [[V_CMP_NE_U16_e64_:%[0-9]+]]:sreg_64 = V_CMP_NE_U16_e64 [[COPY]], [[COPY1]], implicit $exec
139 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[V_CMP_NE_U16_e64_]]
140 ; WAVE32-LABEL: name: icmp_ne_s16_vv
141 ; WAVE32: liveins: $vgpr0, $vgpr1
142 ; WAVE32-NEXT: {{ $}}
143 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
144 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
145 ; WAVE32-NEXT: [[V_CMP_NE_U16_e64_:%[0-9]+]]:sreg_32 = V_CMP_NE_U16_e64 [[COPY]], [[COPY1]], implicit $exec
146 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[V_CMP_NE_U16_e64_]]
147 ; GFX11-LABEL: name: icmp_ne_s16_vv
148 ; GFX11: liveins: $vgpr0, $vgpr1
150 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
151 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
152 ; GFX11-NEXT: [[V_CMP_NE_U16_t16_e64_:%[0-9]+]]:sreg_32 = V_CMP_NE_U16_t16_e64 [[COPY]], [[COPY1]], implicit $exec
153 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_CMP_NE_U16_t16_e64_]]
154 %0:vgpr(s32) = COPY $vgpr0
155 %1:vgpr(s32) = COPY $vgpr1
156 %2:vgpr(s16) = G_TRUNC %0
157 %3:vgpr(s16) = G_TRUNC %1
158 %4:vcc(s1) = G_ICMP intpred(ne), %2, %3
159 S_ENDPGM 0, implicit %4
164 name: icmp_slt_s16_vv
166 regBankSelected: true
170 liveins: $vgpr0, $vgpr1
172 ; WAVE64-LABEL: name: icmp_slt_s16_vv
173 ; WAVE64: liveins: $vgpr0, $vgpr1
174 ; WAVE64-NEXT: {{ $}}
175 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
176 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
177 ; WAVE64-NEXT: [[V_CMP_LT_I16_e64_:%[0-9]+]]:sreg_64 = V_CMP_LT_I16_e64 [[COPY]], [[COPY1]], implicit $exec
178 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[V_CMP_LT_I16_e64_]]
179 ; WAVE32-LABEL: name: icmp_slt_s16_vv
180 ; WAVE32: liveins: $vgpr0, $vgpr1
181 ; WAVE32-NEXT: {{ $}}
182 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
183 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
184 ; WAVE32-NEXT: [[V_CMP_LT_I16_e64_:%[0-9]+]]:sreg_32 = V_CMP_LT_I16_e64 [[COPY]], [[COPY1]], implicit $exec
185 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[V_CMP_LT_I16_e64_]]
186 ; GFX11-LABEL: name: icmp_slt_s16_vv
187 ; GFX11: liveins: $vgpr0, $vgpr1
189 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
190 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
191 ; GFX11-NEXT: [[V_CMP_LT_I16_t16_e64_:%[0-9]+]]:sreg_32 = V_CMP_LT_I16_t16_e64 [[COPY]], [[COPY1]], implicit $exec
192 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_CMP_LT_I16_t16_e64_]]
193 %0:vgpr(s32) = COPY $vgpr0
194 %1:vgpr(s32) = COPY $vgpr1
195 %2:vgpr(s16) = G_TRUNC %0
196 %3:vgpr(s16) = G_TRUNC %1
197 %4:vcc(s1) = G_ICMP intpred(slt), %2, %3
198 S_ENDPGM 0, implicit %4
203 name: icmp_sle_s16_vv
205 regBankSelected: true
209 liveins: $vgpr0, $vgpr1
211 ; WAVE64-LABEL: name: icmp_sle_s16_vv
212 ; WAVE64: liveins: $vgpr0, $vgpr1
213 ; WAVE64-NEXT: {{ $}}
214 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
215 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
216 ; WAVE64-NEXT: [[V_CMP_LE_I16_e64_:%[0-9]+]]:sreg_64 = V_CMP_LE_I16_e64 [[COPY]], [[COPY1]], implicit $exec
217 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[V_CMP_LE_I16_e64_]]
218 ; WAVE32-LABEL: name: icmp_sle_s16_vv
219 ; WAVE32: liveins: $vgpr0, $vgpr1
220 ; WAVE32-NEXT: {{ $}}
221 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
222 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
223 ; WAVE32-NEXT: [[V_CMP_LE_I16_e64_:%[0-9]+]]:sreg_32 = V_CMP_LE_I16_e64 [[COPY]], [[COPY1]], implicit $exec
224 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[V_CMP_LE_I16_e64_]]
225 ; GFX11-LABEL: name: icmp_sle_s16_vv
226 ; GFX11: liveins: $vgpr0, $vgpr1
228 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
229 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
230 ; GFX11-NEXT: [[V_CMP_LE_I16_t16_e64_:%[0-9]+]]:sreg_32 = V_CMP_LE_I16_t16_e64 [[COPY]], [[COPY1]], implicit $exec
231 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_CMP_LE_I16_t16_e64_]]
232 %0:vgpr(s32) = COPY $vgpr0
233 %1:vgpr(s32) = COPY $vgpr1
234 %2:vgpr(s16) = G_TRUNC %0
235 %3:vgpr(s16) = G_TRUNC %1
236 %4:vcc(s1) = G_ICMP intpred(sle), %2, %3
237 S_ENDPGM 0, implicit %4
242 name: icmp_ult_s16_vv
244 regBankSelected: true
248 liveins: $vgpr0, $vgpr1
250 ; WAVE64-LABEL: name: icmp_ult_s16_vv
251 ; WAVE64: liveins: $vgpr0, $vgpr1
252 ; WAVE64-NEXT: {{ $}}
253 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
254 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
255 ; WAVE64-NEXT: [[V_CMP_LT_U16_e64_:%[0-9]+]]:sreg_64 = V_CMP_LT_U16_e64 [[COPY]], [[COPY1]], implicit $exec
256 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[V_CMP_LT_U16_e64_]]
257 ; WAVE32-LABEL: name: icmp_ult_s16_vv
258 ; WAVE32: liveins: $vgpr0, $vgpr1
259 ; WAVE32-NEXT: {{ $}}
260 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
261 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
262 ; WAVE32-NEXT: [[V_CMP_LT_U16_e64_:%[0-9]+]]:sreg_32 = V_CMP_LT_U16_e64 [[COPY]], [[COPY1]], implicit $exec
263 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[V_CMP_LT_U16_e64_]]
264 ; GFX11-LABEL: name: icmp_ult_s16_vv
265 ; GFX11: liveins: $vgpr0, $vgpr1
267 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
268 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
269 ; GFX11-NEXT: [[V_CMP_LT_U16_t16_e64_:%[0-9]+]]:sreg_32 = V_CMP_LT_U16_t16_e64 [[COPY]], [[COPY1]], implicit $exec
270 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_CMP_LT_U16_t16_e64_]]
271 %0:vgpr(s32) = COPY $vgpr0
272 %1:vgpr(s32) = COPY $vgpr1
273 %2:vgpr(s16) = G_TRUNC %0
274 %3:vgpr(s16) = G_TRUNC %1
275 %4:vcc(s1) = G_ICMP intpred(ult), %2, %3
276 S_ENDPGM 0, implicit %4
281 name: icmp_ule_s16_vv
283 regBankSelected: true
287 liveins: $vgpr0, $vgpr1
289 ; WAVE64-LABEL: name: icmp_ule_s16_vv
290 ; WAVE64: liveins: $vgpr0, $vgpr1
291 ; WAVE64-NEXT: {{ $}}
292 ; WAVE64-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
293 ; WAVE64-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
294 ; WAVE64-NEXT: [[V_CMP_LE_U16_e64_:%[0-9]+]]:sreg_64 = V_CMP_LE_U16_e64 [[COPY]], [[COPY1]], implicit $exec
295 ; WAVE64-NEXT: S_ENDPGM 0, implicit [[V_CMP_LE_U16_e64_]]
296 ; WAVE32-LABEL: name: icmp_ule_s16_vv
297 ; WAVE32: liveins: $vgpr0, $vgpr1
298 ; WAVE32-NEXT: {{ $}}
299 ; WAVE32-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
300 ; WAVE32-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
301 ; WAVE32-NEXT: [[V_CMP_LE_U16_e64_:%[0-9]+]]:sreg_32 = V_CMP_LE_U16_e64 [[COPY]], [[COPY1]], implicit $exec
302 ; WAVE32-NEXT: S_ENDPGM 0, implicit [[V_CMP_LE_U16_e64_]]
303 ; GFX11-LABEL: name: icmp_ule_s16_vv
304 ; GFX11: liveins: $vgpr0, $vgpr1
306 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
307 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
308 ; GFX11-NEXT: [[V_CMP_LE_U16_t16_e64_:%[0-9]+]]:sreg_32 = V_CMP_LE_U16_t16_e64 [[COPY]], [[COPY1]], implicit $exec
309 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_CMP_LE_U16_t16_e64_]]
310 %0:vgpr(s32) = COPY $vgpr0
311 %1:vgpr(s32) = COPY $vgpr1
312 %2:vgpr(s16) = G_TRUNC %0
313 %3:vgpr(s16) = G_TRUNC %1
314 %4:vcc(s1) = G_ICMP intpred(ule), %2, %3
315 S_ENDPGM 0, implicit %4