1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-fast | FileCheck %s
3 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=amdgpu-regbankselect %s -verify-machineinstrs -o - -regbankselect-greedy | FileCheck %s
6 name: sext_s32_to_s64_s
12 ; CHECK-LABEL: name: sext_s32_to_s64_s
13 ; CHECK: liveins: $sgpr0
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
16 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:sgpr(s64) = G_SEXT [[COPY]](s32)
17 %0:_(s32) = COPY $sgpr0
22 name: sext_s16_to_s64_s
28 ; CHECK-LABEL: name: sext_s16_to_s64_s
29 ; CHECK: liveins: $sgpr0
31 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
32 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
33 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:sgpr(s64) = G_SEXT [[TRUNC]](s16)
34 %0:_(s32) = COPY $sgpr0
35 %1:_(s16) = G_TRUNC %0
40 name: sext_s32_to_s64_v
46 ; CHECK-LABEL: name: sext_s32_to_s64_v
47 ; CHECK: liveins: $vgpr0_vgpr1
49 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
50 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
51 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 31
52 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[COPY1]], [[C]](s32)
53 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[COPY1]](s32), [[ASHR]](s32)
54 %0:_(s32) = COPY $vgpr0
59 name: sext_s1_to_s16_scc
64 liveins: $sgpr0, $sgpr1
65 ; CHECK-LABEL: name: sext_s1_to_s16_scc
66 ; CHECK: liveins: $sgpr0, $sgpr1
68 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
69 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
70 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
71 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
72 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:sgpr(s16) = G_SEXT [[TRUNC]](s1)
73 %0:_(s32) = COPY $sgpr0
74 %1:_(s32) = COPY $sgpr1
75 %2:_(s1) = G_ICMP intpred(eq), %0, %1
80 name: sext_s1_to_s32_scc
85 liveins: $sgpr0, $sgpr1
86 ; CHECK-LABEL: name: sext_s1_to_s32_scc
87 ; CHECK: liveins: $sgpr0, $sgpr1
89 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
90 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
91 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
92 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
93 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:sgpr(s32) = G_SEXT [[TRUNC]](s1)
94 %0:_(s32) = COPY $sgpr0
95 %1:_(s32) = COPY $sgpr1
96 %2:_(s1) = G_ICMP intpred(eq), %0, %1
101 name: sext_s1_to_s64_scc
106 liveins: $sgpr0, $sgpr1
107 ; CHECK-LABEL: name: sext_s1_to_s64_scc
108 ; CHECK: liveins: $sgpr0, $sgpr1
110 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
111 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
112 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:sgpr(s32) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
113 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[ICMP]](s32)
114 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:sgpr(s64) = G_SEXT [[TRUNC]](s1)
115 %0:_(s32) = COPY $sgpr0
116 %1:_(s32) = COPY $sgpr1
117 %2:_(s1) = G_ICMP intpred(eq), %0, %1
118 %3:_(s64) = G_SEXT %2
122 name: sext_s1_to_s16_vcc
127 liveins: $vgpr0, $vgpr1
128 ; CHECK-LABEL: name: sext_s1_to_s16_vcc
129 ; CHECK: liveins: $vgpr0, $vgpr1
131 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
132 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
133 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
134 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 -1
135 ; CHECK-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
136 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
137 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[SELECT]](s32)
138 %0:_(s32) = COPY $vgpr0
139 %1:_(s32) = COPY $vgpr1
140 %2:_(s1) = G_ICMP intpred(eq), %0, %1
141 %3:_(s16) = G_SEXT %2
145 name: sext_s1_to_s32_vcc
150 liveins: $vgpr0, $vgpr1
151 ; CHECK-LABEL: name: sext_s1_to_s32_vcc
152 ; CHECK: liveins: $vgpr0, $vgpr1
154 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
155 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
156 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
157 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 -1
158 ; CHECK-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
159 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
160 %0:_(s32) = COPY $vgpr0
161 %1:_(s32) = COPY $vgpr1
162 %2:_(s1) = G_ICMP intpred(eq), %0, %1
163 %3:_(s32) = G_SEXT %2
167 name: sext_s1_to_s64_vcc
172 liveins: $vgpr0, $vgpr1
173 ; CHECK-LABEL: name: sext_s1_to_s64_vcc
174 ; CHECK: liveins: $vgpr0, $vgpr1
176 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
177 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
178 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:vcc(s1) = G_ICMP intpred(eq), [[COPY]](s32), [[COPY1]]
179 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 -1
180 ; CHECK-NEXT: [[C1:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 0
181 ; CHECK-NEXT: [[SELECT:%[0-9]+]]:vgpr(s32) = G_SELECT [[ICMP]](s1), [[C]], [[C1]]
182 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[SELECT]](s32)
183 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SELECT]](s32), [[COPY2]](s32)
184 %0:_(s32) = COPY $vgpr0
185 %1:_(s32) = COPY $vgpr1
186 %2:_(s1) = G_ICMP intpred(eq), %0, %1
187 %3:_(s64) = G_SEXT %2
191 name: sext_s1_to_s16_sgpr
197 ; CHECK-LABEL: name: sext_s1_to_s16_sgpr
198 ; CHECK: liveins: $sgpr0
200 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
201 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
202 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:sgpr(s16) = G_SEXT [[TRUNC]](s1)
203 %0:_(s32) = COPY $sgpr0
204 %1:_(s1) = G_TRUNC %0
205 %2:_(s16) = G_SEXT %1
209 name: sext_s1_to_s32_sgpr
215 ; CHECK-LABEL: name: sext_s1_to_s32_sgpr
216 ; CHECK: liveins: $sgpr0
218 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
219 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
220 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:sgpr(s32) = G_SEXT [[TRUNC]](s1)
221 %0:_(s32) = COPY $sgpr0
222 %1:_(s1) = G_TRUNC %0
223 %2:_(s32) = G_SEXT %1
227 name: sext_s1_to_s64_sgpr
233 ; CHECK-LABEL: name: sext_s1_to_s64_sgpr
234 ; CHECK: liveins: $sgpr0
236 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
237 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s1) = G_TRUNC [[COPY]](s32)
238 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:sgpr(s64) = G_SEXT [[TRUNC]](s1)
239 %0:_(s32) = COPY $sgpr0
240 %1:_(s1) = G_TRUNC %0
241 %2:_(s64) = G_SEXT %1
245 name: sext_s1_to_s16_vgpr
251 ; CHECK-LABEL: name: sext_s1_to_s16_vgpr
252 ; CHECK: liveins: $vgpr0
254 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
255 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
256 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:vgpr(s16) = G_SEXT [[TRUNC]](s1)
257 %0:_(s32) = COPY $vgpr0
258 %1:_(s1) = G_TRUNC %0
259 %2:_(s16) = G_SEXT %1
263 name: sext_s1_to_s32_vgpr
269 ; CHECK-LABEL: name: sext_s1_to_s32_vgpr
270 ; CHECK: liveins: $vgpr0
272 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
273 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
274 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:vgpr(s32) = G_SEXT [[TRUNC]](s1)
275 %0:_(s32) = COPY $vgpr0
276 %1:_(s1) = G_TRUNC %0
277 %2:_(s32) = G_SEXT %1
281 name: sext_s1_to_s64_vgpr
287 ; CHECK-LABEL: name: sext_s1_to_s64_vgpr
288 ; CHECK: liveins: $vgpr0
290 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
291 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s1) = G_TRUNC [[COPY]](s32)
292 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:vgpr(s32) = G_SEXT [[TRUNC]](s1)
293 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 31
294 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[SEXT]], [[C]](s32)
295 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SEXT]](s32), [[ASHR]](s32)
296 %0:_(s32) = COPY $vgpr0
297 %1:_(s1) = G_TRUNC %0
298 %2:_(s64) = G_SEXT %1
302 name: sext_s16_to_s64_vgpr
308 ; CHECK-LABEL: name: sext_s16_to_s64_vgpr
309 ; CHECK: liveins: $vgpr0
311 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
312 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
313 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:vgpr(s32) = G_SEXT [[TRUNC]](s16)
314 ; CHECK-NEXT: [[C:%[0-9]+]]:vgpr(s32) = G_CONSTANT i32 31
315 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[SEXT]], [[C]](s32)
316 ; CHECK-NEXT: [[MV:%[0-9]+]]:vgpr(s64) = G_MERGE_VALUES [[SEXT]](s32), [[ASHR]](s32)
317 %0:_(s32) = COPY $vgpr0
318 %1:_(s16) = G_TRUNC %0
319 %2:_(s64) = G_SEXT %1