[InstCombine] Signed saturation patterns
[llvm-complete.git] / test / CodeGen / AMDGPU / GlobalISel / inst-select-icmp.s64.mir
blobefd11a2172d8e1e4db490cfcbf2084d53914882e
1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -pass-remarks-missed='gisel*' -global-isel-abort=2 -o - %s 2> %t | FileCheck -check-prefix=GFX8  %s
3 # RUN: FileCheck -check-prefixes=ERR,GFX8-ERR %s < %t
5 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=2 -pass-remarks-missed='gisel*'  -o - %s 2> %t | FileCheck -check-prefix=GFX6  %s
6 # RUN: FileCheck -check-prefixes=ERR,GFX6-ERR %s < %t
9 # ERR-NOT: remark
11 # GFX6-ERR: remark: <unknown>:0:0: cannot select: %2:scc(s1) = G_ICMP intpred(eq), %0:sgpr(s64), %1:sgpr (in function: icmp_eq_s64_ss)
12 # GFX6-ERR-NEXT: remark: <unknown>:0:0: cannot select: %2:scc(s1) = G_ICMP intpred(ne), %0:sgpr(s64), %1:sgpr (in function: icmp_ne_s64_ss)
13 # GFX6-ERR-NEXT: remark: <unknown>:0:0: cannot select: %2:scc(s1) = G_ICMP intpred(slt), %0:sgpr(s64), %1:sgpr (in function: icmp_slt_s64_ss)
14 # GFX6-ERR-NEXT: remark: <unknown>:0:0: cannot select: %2:scc(s1) = G_ICMP intpred(eq), %0:sgpr(p0), %1:sgpr (in function: icmp_eq_p0_ss)
15 # GFX6-ERR-NEXT: remark: <unknown>:0:0: cannot select: %2:scc(s1) = G_ICMP intpred(eq), %0:sgpr(p1), %1:sgpr (in function: icmp_eq_p1_ss)
16 # GFX6-ERR-NEXT: remark: <unknown>:0:0: cannot select: %2:scc(s1) = G_ICMP intpred(eq), %0:sgpr(p999), %1:sgpr (in function: icmp_eq_p999_ss)
18 # GFX8-ERR: remark: <unknown>:0:0: cannot select: %2:scc(s1) = G_ICMP intpred(slt), %0:sgpr(s64), %1:sgpr (in function: icmp_slt_s64_ss)
20 # ERR-NOT: remark
22 ---
23 name:            icmp_eq_s64_ss
24 legalized:       true
25 regBankSelected: true
27 body: |
28   bb.0:
29     liveins:  $sgpr0_sgpr1, $sgpr2_sgpr3
31     ; GFX8-LABEL: name: icmp_eq_s64_ss
32     ; GFX8: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
33     ; GFX8: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
34     ; GFX8: S_CMP_EQ_U64 [[COPY]], [[COPY1]], implicit-def $scc
35     ; GFX8: [[COPY2:%[0-9]+]]:sreg_32 = COPY $scc
36     ; GFX8: $scc = COPY [[COPY2]]
37     ; GFX8: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 1, implicit $scc
38     ; GFX8: S_ENDPGM 0, implicit [[S_CSELECT_B32_]]
39     ; GFX6-LABEL: name: icmp_eq_s64_ss
40     ; GFX6: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
41     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(s64) = COPY $sgpr2_sgpr3
42     ; GFX6: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](s64), [[COPY1]]
43     ; GFX6: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[ICMP]](s1)
44     ; GFX6: $scc = COPY [[COPY2]]
45     ; GFX6: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32(s32) = S_CSELECT_B32 0, 1, implicit $scc
46     ; GFX6: S_ENDPGM 0, implicit [[S_CSELECT_B32_]](s32)
47     %0:sgpr(s64) = COPY $sgpr0_sgpr1
48     %1:sgpr(s64) = COPY $sgpr2_sgpr3
49     %2:scc(s1) = G_ICMP intpred(eq), %0, %1
50     %3:sgpr(s32) = G_ZEXT %2
51     S_ENDPGM 0, implicit %3
53 ...
55 ---
56 name:            icmp_ne_s64_ss
57 legalized:       true
58 regBankSelected: true
60 body: |
61   bb.0:
62     liveins:  $sgpr0_sgpr1, $sgpr2_sgpr3
64     ; GFX8-LABEL: name: icmp_ne_s64_ss
65     ; GFX8: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
66     ; GFX8: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
67     ; GFX8: S_CMP_LG_U64 [[COPY]], [[COPY1]], implicit-def $scc
68     ; GFX8: [[COPY2:%[0-9]+]]:sreg_32 = COPY $scc
69     ; GFX8: $scc = COPY [[COPY2]]
70     ; GFX8: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 1, implicit $scc
71     ; GFX8: S_ENDPGM 0, implicit [[S_CSELECT_B32_]]
72     ; GFX6-LABEL: name: icmp_ne_s64_ss
73     ; GFX6: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
74     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(s64) = COPY $sgpr2_sgpr3
75     ; GFX6: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(ne), [[COPY]](s64), [[COPY1]]
76     ; GFX6: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[ICMP]](s1)
77     ; GFX6: $scc = COPY [[COPY2]]
78     ; GFX6: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32(s32) = S_CSELECT_B32 0, 1, implicit $scc
79     ; GFX6: S_ENDPGM 0, implicit [[S_CSELECT_B32_]](s32)
80     %0:sgpr(s64) = COPY $sgpr0_sgpr1
81     %1:sgpr(s64) = COPY $sgpr2_sgpr3
82     %2:scc(s1) = G_ICMP intpred(ne), %0, %1
83     %3:sgpr(s32) = G_ZEXT %2
84     S_ENDPGM 0, implicit %3
86 ...
88 ---
89 name:            icmp_slt_s64_ss
90 legalized:       true
91 regBankSelected: true
93 body: |
94   bb.0:
95     liveins:  $sgpr0_sgpr1, $sgpr2_sgpr3
97     ; GFX8-LABEL: name: icmp_slt_s64_ss
98     ; GFX8: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
99     ; GFX8: [[COPY1:%[0-9]+]]:sgpr(s64) = COPY $sgpr2_sgpr3
100     ; GFX8: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(slt), [[COPY]](s64), [[COPY1]]
101     ; GFX8: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[ICMP]](s1)
102     ; GFX8: $scc = COPY [[COPY2]]
103     ; GFX8: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32(s32) = S_CSELECT_B32 0, 1, implicit $scc
104     ; GFX8: S_ENDPGM 0, implicit [[S_CSELECT_B32_]](s32)
105     ; GFX6-LABEL: name: icmp_slt_s64_ss
106     ; GFX6: [[COPY:%[0-9]+]]:sgpr(s64) = COPY $sgpr0_sgpr1
107     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(s64) = COPY $sgpr2_sgpr3
108     ; GFX6: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(slt), [[COPY]](s64), [[COPY1]]
109     ; GFX6: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[ICMP]](s1)
110     ; GFX6: $scc = COPY [[COPY2]]
111     ; GFX6: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32(s32) = S_CSELECT_B32 0, 1, implicit $scc
112     ; GFX6: S_ENDPGM 0, implicit [[S_CSELECT_B32_]](s32)
113     %0:sgpr(s64) = COPY $sgpr0_sgpr1
114     %1:sgpr(s64) = COPY $sgpr2_sgpr3
115     %2:scc(s1) = G_ICMP intpred(slt), %0, %1
116     %3:sgpr(s32) = G_ZEXT %2
117     S_ENDPGM 0, implicit %3
122 name:            icmp_eq_s64_vv
123 legalized:       true
124 regBankSelected: true
126 body: |
127   bb.0:
128     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
130     ; GFX8-LABEL: name: icmp_eq_s64_vv
131     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
132     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
133     ; GFX8: [[V_CMP_EQ_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U64_e64 [[COPY]], [[COPY1]], implicit $exec
134     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_EQ_U64_e64_]], implicit $exec
135     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
136     ; GFX6-LABEL: name: icmp_eq_s64_vv
137     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
138     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
139     ; GFX6: [[V_CMP_EQ_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U64_e64 [[COPY]], [[COPY1]], implicit $exec
140     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_EQ_U64_e64_]], implicit $exec
141     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
142     %0:vgpr(s64) = COPY $vgpr0_vgpr1
143     %1:vgpr(s64) = COPY $vgpr2_vgpr3
144     %2:vcc(s1) = G_ICMP intpred(eq), %0, %1
145     %3:vgpr(s32) = G_ZEXT %2
146     S_ENDPGM 0, implicit %3
151 name:            icmp_ne_s64_vv
152 legalized:       true
153 regBankSelected: true
155 body: |
156   bb.0:
157     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
159     ; GFX8-LABEL: name: icmp_ne_s64_vv
160     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
161     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
162     ; GFX8: [[V_CMP_NE_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_NE_U64_e64 [[COPY]], [[COPY1]], implicit $exec
163     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_NE_U64_e64_]], implicit $exec
164     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
165     ; GFX6-LABEL: name: icmp_ne_s64_vv
166     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
167     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
168     ; GFX6: [[V_CMP_NE_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_NE_U64_e64 [[COPY]], [[COPY1]], implicit $exec
169     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_NE_U64_e64_]], implicit $exec
170     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
171     %0:vgpr(s64) = COPY $vgpr0_vgpr1
172     %1:vgpr(s64) = COPY $vgpr2_vgpr3
173     %2:vcc(s1) = G_ICMP intpred(ne), %0, %1
174     %3:vgpr(s32) = G_ZEXT %2
175     S_ENDPGM 0, implicit %3
180 name:            icmp_sgt_s64_vv
181 legalized:       true
182 regBankSelected: true
184 body: |
185   bb.0:
186     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
188     ; GFX8-LABEL: name: icmp_sgt_s64_vv
189     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
190     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
191     ; GFX8: [[V_CMP_GT_I64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_GT_I64_e64 [[COPY]], [[COPY1]], implicit $exec
192     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_GT_I64_e64_]], implicit $exec
193     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
194     ; GFX6-LABEL: name: icmp_sgt_s64_vv
195     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
196     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
197     ; GFX6: [[V_CMP_GT_I64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_GT_I64_e64 [[COPY]], [[COPY1]], implicit $exec
198     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_GT_I64_e64_]], implicit $exec
199     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
200     %0:vgpr(s64) = COPY $vgpr0_vgpr1
201     %1:vgpr(s64) = COPY $vgpr2_vgpr3
202     %2:vcc(s1) = G_ICMP intpred(sgt), %0, %1
203     %3:vgpr(s32) = G_ZEXT %2
204     S_ENDPGM 0, implicit %3
209 name:            icmp_sge_s64_vv
210 legalized:       true
211 regBankSelected: true
213 body: |
214   bb.0:
215     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
217     ; GFX8-LABEL: name: icmp_sge_s64_vv
218     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
219     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
220     ; GFX8: [[V_CMP_GE_I64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_GE_I64_e64 [[COPY]], [[COPY1]], implicit $exec
221     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_GE_I64_e64_]], implicit $exec
222     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
223     ; GFX6-LABEL: name: icmp_sge_s64_vv
224     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
225     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
226     ; GFX6: [[V_CMP_GE_I64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_GE_I64_e64 [[COPY]], [[COPY1]], implicit $exec
227     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_GE_I64_e64_]], implicit $exec
228     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
229     %0:vgpr(s64) = COPY $vgpr0_vgpr1
230     %1:vgpr(s64) = COPY $vgpr2_vgpr3
231     %2:vcc(s1) = G_ICMP intpred(sge), %0, %1
232     %3:vgpr(s32) = G_ZEXT %2
233     S_ENDPGM 0, implicit %3
238 name:            icmp_slt_s64_vv
239 legalized:       true
240 regBankSelected: true
242 body: |
243   bb.0:
244     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
246     ; GFX8-LABEL: name: icmp_slt_s64_vv
247     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
248     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
249     ; GFX8: [[V_CMP_LT_I64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_LT_I64_e64 [[COPY]], [[COPY1]], implicit $exec
250     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_LT_I64_e64_]], implicit $exec
251     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
252     ; GFX6-LABEL: name: icmp_slt_s64_vv
253     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
254     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
255     ; GFX6: [[V_CMP_LT_I64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_LT_I64_e64 [[COPY]], [[COPY1]], implicit $exec
256     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_LT_I64_e64_]], implicit $exec
257     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
258     %0:vgpr(s64) = COPY $vgpr0_vgpr1
259     %1:vgpr(s64) = COPY $vgpr2_vgpr3
260     %2:vcc(s1) = G_ICMP intpred(slt), %0, %1
261     %3:vgpr(s32) = G_ZEXT %2
262     S_ENDPGM 0, implicit %3
267 name:            icmp_sle_s64_vv
268 legalized:       true
269 regBankSelected: true
271 body: |
272   bb.0:
273     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
275     ; GFX8-LABEL: name: icmp_sle_s64_vv
276     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
277     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
278     ; GFX8: [[V_CMP_LE_I64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_LE_I64_e64 [[COPY]], [[COPY1]], implicit $exec
279     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_LE_I64_e64_]], implicit $exec
280     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
281     ; GFX6-LABEL: name: icmp_sle_s64_vv
282     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
283     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
284     ; GFX6: [[V_CMP_LE_I64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_LE_I64_e64 [[COPY]], [[COPY1]], implicit $exec
285     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_LE_I64_e64_]], implicit $exec
286     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
287     %0:vgpr(s64) = COPY $vgpr0_vgpr1
288     %1:vgpr(s64) = COPY $vgpr2_vgpr3
289     %2:vcc(s1) = G_ICMP intpred(sle), %0, %1
290     %3:vgpr(s32) = G_ZEXT %2
291     S_ENDPGM 0, implicit %3
296 name:            icmp_ugt_s64_vv
297 legalized:       true
298 regBankSelected: true
300 body: |
301   bb.0:
302     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
304     ; GFX8-LABEL: name: icmp_ugt_s64_vv
305     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
306     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
307     ; GFX8: [[V_CMP_GT_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_GT_U64_e64 [[COPY]], [[COPY1]], implicit $exec
308     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_GT_U64_e64_]], implicit $exec
309     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
310     ; GFX6-LABEL: name: icmp_ugt_s64_vv
311     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
312     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
313     ; GFX6: [[V_CMP_GT_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_GT_U64_e64 [[COPY]], [[COPY1]], implicit $exec
314     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_GT_U64_e64_]], implicit $exec
315     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
316     %0:vgpr(s64) = COPY $vgpr0_vgpr1
317     %1:vgpr(s64) = COPY $vgpr2_vgpr3
318     %2:vcc(s1) = G_ICMP intpred(ugt), %0, %1
319     %3:vgpr(s32) = G_ZEXT %2
320     S_ENDPGM 0, implicit %3
325 name:            icmp_uge_s64_vv
326 legalized:       true
327 regBankSelected: true
329 body: |
330   bb.0:
331     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
333     ; GFX8-LABEL: name: icmp_uge_s64_vv
334     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
335     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
336     ; GFX8: [[V_CMP_GE_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_GE_U64_e64 [[COPY]], [[COPY1]], implicit $exec
337     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_GE_U64_e64_]], implicit $exec
338     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
339     ; GFX6-LABEL: name: icmp_uge_s64_vv
340     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
341     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
342     ; GFX6: [[V_CMP_GE_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_GE_U64_e64 [[COPY]], [[COPY1]], implicit $exec
343     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_GE_U64_e64_]], implicit $exec
344     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
345     %0:vgpr(s64) = COPY $vgpr0_vgpr1
346     %1:vgpr(s64) = COPY $vgpr2_vgpr3
347     %2:vcc(s1) = G_ICMP intpred(uge), %0, %1
348     %3:vgpr(s32) = G_ZEXT %2
349     S_ENDPGM 0, implicit %3
354 name:            icmp_ult_s64_vv
355 legalized:       true
356 regBankSelected: true
358 body: |
359   bb.0:
360     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
362     ; GFX8-LABEL: name: icmp_ult_s64_vv
363     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
364     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
365     ; GFX8: [[V_CMP_LT_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_LT_U64_e64 [[COPY]], [[COPY1]], implicit $exec
366     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_LT_U64_e64_]], implicit $exec
367     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
368     ; GFX6-LABEL: name: icmp_ult_s64_vv
369     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
370     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
371     ; GFX6: [[V_CMP_LT_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_LT_U64_e64 [[COPY]], [[COPY1]], implicit $exec
372     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_LT_U64_e64_]], implicit $exec
373     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
374     %0:vgpr(s64) = COPY $vgpr0_vgpr1
375     %1:vgpr(s64) = COPY $vgpr2_vgpr3
376     %2:vcc(s1) = G_ICMP intpred(ult), %0, %1
377     %3:vgpr(s32) = G_ZEXT %2
378     S_ENDPGM 0, implicit %3
383 name:            icmp_ule_s64_vv
384 legalized:       true
385 regBankSelected: true
387 body: |
388   bb.0:
389     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
391     ; GFX8-LABEL: name: icmp_ule_s64_vv
392     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
393     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
394     ; GFX8: [[V_CMP_LE_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_LE_U64_e64 [[COPY]], [[COPY1]], implicit $exec
395     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_LE_U64_e64_]], implicit $exec
396     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
397     ; GFX6-LABEL: name: icmp_ule_s64_vv
398     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
399     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
400     ; GFX6: [[V_CMP_LE_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_LE_U64_e64 [[COPY]], [[COPY1]], implicit $exec
401     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_LE_U64_e64_]], implicit $exec
402     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
403     %0:vgpr(s64) = COPY $vgpr0_vgpr1
404     %1:vgpr(s64) = COPY $vgpr2_vgpr3
405     %2:vcc(s1) = G_ICMP intpred(ule), %0, %1
406     %3:vgpr(s32) = G_ZEXT %2
407     S_ENDPGM 0, implicit %3
412 name:            icmp_eq_p0_ss
413 legalized:       true
414 regBankSelected: true
416 body: |
417   bb.0:
418     liveins:  $sgpr0_sgpr1, $sgpr2_sgpr3
420     ; GFX8-LABEL: name: icmp_eq_p0_ss
421     ; GFX8: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
422     ; GFX8: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
423     ; GFX8: S_CMP_EQ_U64 [[COPY]], [[COPY1]], implicit-def $scc
424     ; GFX8: [[COPY2:%[0-9]+]]:sreg_32 = COPY $scc
425     ; GFX8: $scc = COPY [[COPY2]]
426     ; GFX8: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 1, implicit $scc
427     ; GFX8: S_ENDPGM 0, implicit [[S_CSELECT_B32_]]
428     ; GFX6-LABEL: name: icmp_eq_p0_ss
429     ; GFX6: [[COPY:%[0-9]+]]:sgpr(p0) = COPY $sgpr0_sgpr1
430     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(p0) = COPY $sgpr2_sgpr3
431     ; GFX6: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](p0), [[COPY1]]
432     ; GFX6: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[ICMP]](s1)
433     ; GFX6: $scc = COPY [[COPY2]]
434     ; GFX6: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32(s32) = S_CSELECT_B32 0, 1, implicit $scc
435     ; GFX6: S_ENDPGM 0, implicit [[S_CSELECT_B32_]](s32)
436     %0:sgpr(p0) = COPY $sgpr0_sgpr1
437     %1:sgpr(p0) = COPY $sgpr2_sgpr3
438     %2:scc(s1) = G_ICMP intpred(eq), %0, %1
439     %3:sgpr(s32) = G_ZEXT %2
440     S_ENDPGM 0, implicit %3
445 name:            icmp_eq_p1_ss
446 legalized:       true
447 regBankSelected: true
449 body: |
450   bb.0:
451     liveins:  $sgpr0_sgpr1, $sgpr2_sgpr3
453     ; GFX8-LABEL: name: icmp_eq_p1_ss
454     ; GFX8: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
455     ; GFX8: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
456     ; GFX8: S_CMP_EQ_U64 [[COPY]], [[COPY1]], implicit-def $scc
457     ; GFX8: [[COPY2:%[0-9]+]]:sreg_32 = COPY $scc
458     ; GFX8: $scc = COPY [[COPY2]]
459     ; GFX8: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 1, implicit $scc
460     ; GFX8: S_ENDPGM 0, implicit [[S_CSELECT_B32_]]
461     ; GFX6-LABEL: name: icmp_eq_p1_ss
462     ; GFX6: [[COPY:%[0-9]+]]:sgpr(p1) = COPY $sgpr0_sgpr1
463     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(p1) = COPY $sgpr2_sgpr3
464     ; GFX6: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](p1), [[COPY1]]
465     ; GFX6: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[ICMP]](s1)
466     ; GFX6: $scc = COPY [[COPY2]]
467     ; GFX6: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32(s32) = S_CSELECT_B32 0, 1, implicit $scc
468     ; GFX6: S_ENDPGM 0, implicit [[S_CSELECT_B32_]](s32)
469     %0:sgpr(p1) = COPY $sgpr0_sgpr1
470     %1:sgpr(p1) = COPY $sgpr2_sgpr3
471     %2:scc(s1) = G_ICMP intpred(eq), %0, %1
472     %3:sgpr(s32) = G_ZEXT %2
473     S_ENDPGM 0, implicit %3
478 name:            icmp_eq_p999_ss
479 legalized:       true
480 regBankSelected: true
482 body: |
483   bb.0:
484     liveins:  $sgpr0_sgpr1, $sgpr2_sgpr3
486     ; GFX8-LABEL: name: icmp_eq_p999_ss
487     ; GFX8: [[COPY:%[0-9]+]]:sreg_64 = COPY $sgpr0_sgpr1
488     ; GFX8: [[COPY1:%[0-9]+]]:sreg_64 = COPY $sgpr2_sgpr3
489     ; GFX8: S_CMP_EQ_U64 [[COPY]], [[COPY1]], implicit-def $scc
490     ; GFX8: [[COPY2:%[0-9]+]]:sreg_32 = COPY $scc
491     ; GFX8: $scc = COPY [[COPY2]]
492     ; GFX8: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32 = S_CSELECT_B32 0, 1, implicit $scc
493     ; GFX8: S_ENDPGM 0, implicit [[S_CSELECT_B32_]]
494     ; GFX6-LABEL: name: icmp_eq_p999_ss
495     ; GFX6: [[COPY:%[0-9]+]]:sgpr(p999) = COPY $sgpr0_sgpr1
496     ; GFX6: [[COPY1:%[0-9]+]]:sgpr(p999) = COPY $sgpr2_sgpr3
497     ; GFX6: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](p999), [[COPY1]]
498     ; GFX6: [[COPY2:%[0-9]+]]:sreg_32 = COPY [[ICMP]](s1)
499     ; GFX6: $scc = COPY [[COPY2]]
500     ; GFX6: [[S_CSELECT_B32_:%[0-9]+]]:sreg_32(s32) = S_CSELECT_B32 0, 1, implicit $scc
501     ; GFX6: S_ENDPGM 0, implicit [[S_CSELECT_B32_]](s32)
502     %0:sgpr(p999) = COPY $sgpr0_sgpr1
503     %1:sgpr(p999) = COPY $sgpr2_sgpr3
504     %2:scc(s1) = G_ICMP intpred(eq), %0, %1
505     %3:sgpr(s32) = G_ZEXT %2
506     S_ENDPGM 0, implicit %3
511 name:            icmp_eq_p0_vv
512 legalized:       true
513 regBankSelected: true
515 body: |
516   bb.0:
517     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
519     ; GFX8-LABEL: name: icmp_eq_p0_vv
520     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
521     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
522     ; GFX8: [[V_CMP_EQ_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U64_e64 [[COPY]], [[COPY1]], implicit $exec
523     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_EQ_U64_e64_]], implicit $exec
524     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
525     ; GFX6-LABEL: name: icmp_eq_p0_vv
526     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
527     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
528     ; GFX6: [[V_CMP_EQ_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U64_e64 [[COPY]], [[COPY1]], implicit $exec
529     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_EQ_U64_e64_]], implicit $exec
530     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
531     %0:vgpr(p0) = COPY $vgpr0_vgpr1
532     %1:vgpr(p0) = COPY $vgpr2_vgpr3
533     %2:vcc(s1) = G_ICMP intpred(eq), %0, %1
534     %3:vgpr(s32) = G_ZEXT %2
535     S_ENDPGM 0, implicit %3
540 name:            icmp_eq_p1_vv
541 legalized:       true
542 regBankSelected: true
544 body: |
545   bb.0:
546     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
548     ; GFX8-LABEL: name: icmp_eq_p1_vv
549     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
550     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
551     ; GFX8: [[V_CMP_EQ_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U64_e64 [[COPY]], [[COPY1]], implicit $exec
552     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_EQ_U64_e64_]], implicit $exec
553     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
554     ; GFX6-LABEL: name: icmp_eq_p1_vv
555     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
556     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
557     ; GFX6: [[V_CMP_EQ_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U64_e64 [[COPY]], [[COPY1]], implicit $exec
558     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_EQ_U64_e64_]], implicit $exec
559     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
560     %0:vgpr(p1) = COPY $vgpr0_vgpr1
561     %1:vgpr(p1) = COPY $vgpr2_vgpr3
562     %2:vcc(s1) = G_ICMP intpred(eq), %0, %1
563     %3:vgpr(s32) = G_ZEXT %2
564     S_ENDPGM 0, implicit %3
569 name:            icmp_eq_p999_vv
570 legalized:       true
571 regBankSelected: true
573 body: |
574   bb.0:
575     liveins:  $vgpr0_vgpr1, $vgpr2_vgpr3
577     ; GFX8-LABEL: name: icmp_eq_p999_vv
578     ; GFX8: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
579     ; GFX8: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
580     ; GFX8: [[V_CMP_EQ_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U64_e64 [[COPY]], [[COPY1]], implicit $exec
581     ; GFX8: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_EQ_U64_e64_]], implicit $exec
582     ; GFX8: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
583     ; GFX6-LABEL: name: icmp_eq_p999_vv
584     ; GFX6: [[COPY:%[0-9]+]]:vreg_64 = COPY $vgpr0_vgpr1
585     ; GFX6: [[COPY1:%[0-9]+]]:vreg_64 = COPY $vgpr2_vgpr3
586     ; GFX6: [[V_CMP_EQ_U64_e64_:%[0-9]+]]:sreg_64_xexec = V_CMP_EQ_U64_e64 [[COPY]], [[COPY1]], implicit $exec
587     ; GFX6: [[V_CNDMASK_B32_e64_:%[0-9]+]]:vgpr_32 = V_CNDMASK_B32_e64 0, 0, 0, 1, [[V_CMP_EQ_U64_e64_]], implicit $exec
588     ; GFX6: S_ENDPGM 0, implicit [[V_CNDMASK_B32_e64_]]
589     %0:vgpr(p999) = COPY $vgpr0_vgpr1
590     %1:vgpr(p999) = COPY $vgpr2_vgpr3
591     %2:vcc(s1) = G_ICMP intpred(eq), %0, %1
592     %3:vgpr(s32) = G_ZEXT %2
593     S_ENDPGM 0, implicit %3