1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
6 name: zext_s32_to_s64_s
12 ; CHECK-LABEL: name: zext_s32_to_s64_s
13 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
14 ; CHECK: [[ZEXT:%[0-9]+]]:sgpr(s64) = G_ZEXT [[COPY]](s32)
15 %0:_(s32) = COPY $sgpr0
20 name: zext_s16_to_s64_s
26 ; CHECK-LABEL: name: zext_s16_to_s64_s
27 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
28 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
29 ; CHECK: [[ZEXT:%[0-9]+]]:sgpr(s64) = G_ZEXT [[TRUNC]](s16)
30 %0:_(s32) = COPY $sgpr0
31 %1:_(s16) = G_TRUNC %0
36 name: zext_s32_to_s64_v
42 ; CHECK-LABEL: name: zext_s32_to_s64_v
43 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
44 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
45 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
46 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY1]](s32), [[C]](s32)
47 %0:_(s32) = COPY $vgpr0
52 name: zext_s1_to_s16_scc
57 liveins: $sgpr0, $sgpr1
58 ; CHECK-LABEL: name: zext_s1_to_s16_scc
59 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
60 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
61 ; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
62 ; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 1
63 ; CHECK: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
64 ; CHECK: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
65 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[SELECT]](s32)
66 %0:_(s32) = COPY $sgpr0
67 %1:_(s32) = COPY $sgpr1
68 %2:_(s1) = G_ICMP intpred(eq), %0, %1
73 name: zext_s1_to_s32_scc
78 liveins: $sgpr0, $sgpr1
79 ; CHECK-LABEL: name: zext_s1_to_s32_scc
80 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
81 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
82 ; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
83 ; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 1
84 ; CHECK: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 0
85 ; CHECK: [[SELECT:%[0-9]+]]:sgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
86 %0:_(s32) = COPY $sgpr0
87 %1:_(s32) = COPY $sgpr1
88 %2:_(s1) = G_ICMP intpred(eq), %0, %1
93 name: zext_s1_to_s64_scc
98 liveins: $sgpr0, $sgpr1
99 ; CHECK-LABEL: name: zext_s1_to_s64_scc
100 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
101 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
102 ; CHECK: [[ICMP:%[0-9]+]]:scc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
103 ; CHECK: [[C:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 1
104 ; CHECK: [[C1:%[0-9]+]]:sgpr(s64) = G_CONSTANT i64 0
105 ; CHECK: [[SELECT:%[0-9]+]]:sgpr(s64) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
106 %0:_(s32) = COPY $sgpr0
107 %1:_(s32) = COPY $sgpr1
108 %2:_(s1) = G_ICMP intpred(eq), %0, %1
109 %3:_(s64) = G_ZEXT %2
113 name: zext_s1_to_s16_vcc
118 liveins: $vgpr0, $vgpr1
119 ; CHECK-LABEL: name: zext_s1_to_s16_vcc
120 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
121 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
122 ; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
123 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
124 ; CHECK: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
125 ; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
126 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[SELECT]](s32)
127 %0:_(s32) = COPY $vgpr0
128 %1:_(s32) = COPY $vgpr1
129 %2:_(s1) = G_ICMP intpred(eq), %0, %1
130 %3:_(s16) = G_ZEXT %2
134 name: zext_s1_to_s32_vcc
139 liveins: $vgpr0, $vgpr1
140 ; CHECK-LABEL: name: zext_s1_to_s32_vcc
141 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
142 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
143 ; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
144 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
145 ; CHECK: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
146 ; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
147 %0:_(s32) = COPY $vgpr0
148 %1:_(s32) = COPY $vgpr1
149 %2:_(s1) = G_ICMP intpred(eq), %0, %1
150 %3:_(s32) = G_ZEXT %2
154 name: zext_s1_to_s64_vcc
159 liveins: $vgpr0, $vgpr1
160 ; CHECK-LABEL: name: zext_s1_to_s64_vcc
161 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
162 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
163 ; CHECK: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
164 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 1
165 ; CHECK: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
166 ; CHECK: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
167 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[SELECT]](s32)
168 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SELECT]](s32), [[COPY2]](s32)
169 %0:_(s32) = COPY $vgpr0
170 %1:_(s32) = COPY $vgpr1
171 %2:_(s1) = G_ICMP intpred(eq), %0, %1
172 %3:_(s64) = G_ZEXT %2
176 name: zext_s1_to_s16_sgpr
182 ; CHECK-LABEL: name: zext_s1_to_s16_sgpr
183 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
184 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
185 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s16) = G_ANYEXT [[TRUNC]](s1)
186 ; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 15
187 ; CHECK: [[SHL:%[0-9]+]]:sgpr(s16) = G_SHL [[ANYEXT]], [[C]](s32)
188 ; CHECK: [[LSHR:%[0-9]+]]:sgpr(s16) = G_LSHR [[SHL]], [[C]](s32)
189 %0:_(s32) = COPY $sgpr0
190 %1:_(s1) = G_TRUNC %0
191 %2:_(s16) = G_ZEXT %1
195 name: zext_s1_to_s32_sgpr
201 ; CHECK-LABEL: name: zext_s1_to_s32_sgpr
202 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
203 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
204 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s32) = G_ANYEXT [[TRUNC]](s1)
205 ; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 31
206 ; CHECK: [[SHL:%[0-9]+]]:sgpr(s32) = G_SHL [[ANYEXT]], [[C]](s32)
207 ; CHECK: [[LSHR:%[0-9]+]]:sgpr(s32) = G_LSHR [[SHL]], [[C]](s32)
208 %0:_(s32) = COPY $sgpr0
209 %1:_(s1) = G_TRUNC %0
210 %2:_(s32) = G_ZEXT %1
214 name: zext_s1_to_s64_sgpr
220 ; CHECK-LABEL: name: zext_s1_to_s64_sgpr
221 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
222 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
223 ; CHECK: [[ANYEXT:%[0-9]+]]:sgpr(s64) = G_ANYEXT [[TRUNC]](s1)
224 ; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 63
225 ; CHECK: [[SHL:%[0-9]+]]:sgpr(s64) = G_SHL [[ANYEXT]], [[C]](s32)
226 ; CHECK: [[LSHR:%[0-9]+]]:sgpr(s64) = G_LSHR [[SHL]], [[C]](s32)
227 %0:_(s32) = COPY $sgpr0
228 %1:_(s1) = G_TRUNC %0
229 %2:_(s64) = G_ZEXT %1
233 name: zext_s1_to_s16_vgpr
239 ; CHECK-LABEL: name: zext_s1_to_s16_vgpr
240 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
241 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
242 ; CHECK: [[ANYEXT:%[0-9]+]]:vgpr(s16) = G_ANYEXT [[TRUNC]](s1)
243 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 15
244 ; CHECK: [[SHL:%[0-9]+]]:vgpr(s16) = G_SHL [[ANYEXT]], [[C]](s32)
245 ; CHECK: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[SHL]], [[C]](s32)
246 %0:_(s32) = COPY $vgpr0
247 %1:_(s1) = G_TRUNC %0
248 %2:_(s16) = G_ZEXT %1
252 name: zext_s1_to_s32_vgpr
258 ; CHECK-LABEL: name: zext_s1_to_s32_vgpr
259 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
260 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
261 ; CHECK: [[ANYEXT:%[0-9]+]]:vgpr(s32) = G_ANYEXT [[TRUNC]](s1)
262 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 31
263 ; CHECK: [[SHL:%[0-9]+]]:vgpr(s32) = G_SHL [[ANYEXT]], [[C]](s32)
264 ; CHECK: [[LSHR:%[0-9]+]]:vgpr(s32) = G_LSHR [[SHL]], [[C]](s32)
265 %0:_(s32) = COPY $vgpr0
266 %1:_(s1) = G_TRUNC %0
267 %2:_(s32) = G_ZEXT %1
271 name: zext_s1_to_s64_vgpr
277 ; CHECK-LABEL: name: zext_s1_to_s64_vgpr
278 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
279 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
280 ; CHECK: [[ZEXT:%[0-9]+]]:vgpr(s32) = G_ZEXT [[TRUNC]](s1)
281 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
282 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[ZEXT]](s32), [[C]](s32)
283 %0:_(s32) = COPY $vgpr0
284 %1:_(s1) = G_TRUNC %0
285 %2:_(s64) = G_ZEXT %1
289 name: zext_s16_to_s64_vgpr
295 ; CHECK-LABEL: name: zext_s16_to_s64_vgpr
296 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
297 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
298 ; CHECK: [[ZEXT:%[0-9]+]]:vgpr(s32) = G_ZEXT [[TRUNC]](s16)
299 ; CHECK: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
300 ; CHECK: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[ZEXT]](s32), [[C]](s32)
301 %0:_(s32) = COPY $vgpr0
302 %1:_(s16) = G_TRUNC %0
303 %2:_(s64) = G_ZEXT %1