1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=amdgpu-regbankselect -regbankselect-fast -o - %s | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=amdgpu-regbankselect -regbankselect-greedy -o - %s | FileCheck %s
11 liveins: $sgpr0, $sgpr1
12 ; CHECK-LABEL: name: ashr_s32_ss
13 ; CHECK: liveins: $sgpr0, $sgpr1
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
16 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
17 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:sgpr(s32) = G_ASHR [[COPY]], [[COPY1]](s32)
18 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](s32)
19 %0:_(s32) = COPY $sgpr0
20 %1:_(s32) = COPY $sgpr1
21 %2:_(s32) = G_ASHR %0, %1
22 S_ENDPGM 0, implicit %2
31 liveins: $sgpr0, $vgpr0
32 ; CHECK-LABEL: name: ashr_s32_sv
33 ; CHECK: liveins: $sgpr0, $vgpr0
35 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
36 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
37 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
38 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[COPY2]], [[COPY1]](s32)
39 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](s32)
40 %0:_(s32) = COPY $sgpr0
41 %1:_(s32) = COPY $vgpr0
42 %2:_(s32) = G_ASHR %0, %1
43 S_ENDPGM 0, implicit %2
52 liveins: $sgpr0, $vgpr0
53 ; CHECK-LABEL: name: ashr_s32_vs
54 ; CHECK: liveins: $sgpr0, $vgpr0
56 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
57 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
58 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
59 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[COPY]], [[COPY2]](s32)
60 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](s32)
61 %0:_(s32) = COPY $vgpr0
62 %1:_(s32) = COPY $sgpr0
63 %2:_(s32) = G_ASHR %0, %1
64 S_ENDPGM 0, implicit %2
73 liveins: $vgpr0, $vgpr1
74 ; CHECK-LABEL: name: ashr_s32_vv
75 ; CHECK: liveins: $vgpr0, $vgpr1
77 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
78 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
79 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[COPY]], [[COPY1]](s32)
80 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](s32)
81 %0:_(s32) = COPY $vgpr0
82 %1:_(s32) = COPY $vgpr1
83 %2:_(s32) = G_ASHR %0, %1
84 S_ENDPGM 0, implicit %2
93 liveins: $sgpr0, $sgpr1
94 ; CHECK-LABEL: name: ashr_s16_ss
95 ; CHECK: liveins: $sgpr0, $sgpr1
97 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
98 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
99 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
100 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
101 ; CHECK-NEXT: [[SEXT:%[0-9]+]]:sgpr(s32) = G_SEXT [[TRUNC]](s16)
102 ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s16)
103 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:sgpr(s32) = G_ASHR [[SEXT]], [[ZEXT]](s32)
104 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[ASHR]](s32)
105 ; CHECK-NEXT: S_ENDPGM 0, implicit [[TRUNC2]](s16)
106 %0:_(s32) = COPY $sgpr0
107 %1:_(s32) = COPY $sgpr1
108 %2:_(s16) = G_TRUNC %0
109 %3:_(s16) = G_TRUNC %1
110 %4:_(s16) = G_ASHR %2, %3
111 S_ENDPGM 0, implicit %4
120 liveins: $sgpr0, $vgpr0
122 ; CHECK-LABEL: name: ashr_s16_sv
123 ; CHECK: liveins: $sgpr0, $vgpr0
125 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
126 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
127 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
128 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
129 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC]](s16)
130 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(s16) = G_ASHR [[COPY2]], [[TRUNC1]](s16)
131 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](s16)
132 %0:_(s32) = COPY $sgpr0
133 %1:_(s32) = COPY $vgpr0
134 %2:_(s16) = G_TRUNC %0
135 %3:_(s16) = G_TRUNC %1
136 %4:_(s16) = G_ASHR %2, %3
137 S_ENDPGM 0, implicit %4
146 liveins: $sgpr0, $vgpr0
147 ; CHECK-LABEL: name: ashr_s16_vs
148 ; CHECK: liveins: $sgpr0, $vgpr0
150 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
151 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
152 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
153 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
154 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC1]](s16)
155 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(s16) = G_ASHR [[TRUNC]], [[COPY2]](s16)
156 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](s16)
157 %0:_(s32) = COPY $vgpr0
158 %1:_(s32) = COPY $sgpr0
159 %2:_(s16) = G_TRUNC %0
160 %3:_(s16) = G_TRUNC %1
161 %4:_(s16) = G_ASHR %2, %3
162 S_ENDPGM 0, implicit %4
172 liveins: $vgpr0, $vgpr1
173 ; CHECK-LABEL: name: ashr_s16_vv
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: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
179 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
180 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(s16) = G_ASHR [[TRUNC]], [[TRUNC1]](s16)
181 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](s16)
182 %0:_(s32) = COPY $vgpr0
183 %1:_(s32) = COPY $vgpr1
184 %2:_(s16) = G_TRUNC %0
185 %3:_(s16) = G_TRUNC %1
186 %4:_(s16) = G_ASHR %2, %3
187 S_ENDPGM 0, implicit %4
197 liveins: $sgpr0, $sgpr1
198 ; CHECK-LABEL: name: ashr_v2s16_ss
199 ; CHECK: liveins: $sgpr0, $sgpr1
201 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
202 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
203 ; CHECK-NEXT: [[BITCAST:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY]](<2 x s16>)
204 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[BITCAST]], 16
205 ; CHECK-NEXT: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
206 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:sgpr(s32) = G_ASHR [[BITCAST]], [[C]](s32)
207 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY1]](<2 x s16>)
208 ; CHECK-NEXT: [[SEXT_INREG1:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[BITCAST1]], 16
209 ; CHECK-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
210 ; CHECK-NEXT: [[ASHR1:%[0-9]+]]:sgpr(s32) = G_ASHR [[BITCAST1]], [[C1]](s32)
211 ; CHECK-NEXT: [[ASHR2:%[0-9]+]]:sgpr(s32) = G_ASHR [[SEXT_INREG]], [[SEXT_INREG1]](s32)
212 ; CHECK-NEXT: [[ASHR3:%[0-9]+]]:sgpr(s32) = G_ASHR [[ASHR]], [[ASHR1]](s32)
213 ; CHECK-NEXT: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:sgpr(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[ASHR2]](s32), [[ASHR3]](s32)
214 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR_TRUNC]](<2 x s16>)
215 %0:_(<2 x s16>) = COPY $sgpr0
216 %1:_(<2 x s16>) = COPY $sgpr1
217 %2:_(<2 x s16>) = G_ASHR %0, %1
218 S_ENDPGM 0, implicit %2
228 liveins: $sgpr0, $vgpr0
229 ; CHECK-LABEL: name: ashr_v2s16_sv
230 ; CHECK: liveins: $sgpr0, $vgpr0
232 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
233 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
234 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY]](<2 x s16>)
235 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY2]], [[COPY1]](<2 x s16>)
236 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
237 %0:_(<2 x s16>) = COPY $sgpr0
238 %1:_(<2 x s16>) = COPY $vgpr0
239 %2:_(<2 x s16>) = G_ASHR %0, %1
240 S_ENDPGM 0, implicit %2
249 liveins: $sgpr0, $vgpr0
250 ; CHECK-LABEL: name: ashr_v2s16_vs
251 ; CHECK: liveins: $sgpr0, $vgpr0
253 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
254 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
255 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY1]](<2 x s16>)
256 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY2]](<2 x s16>)
257 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
258 %0:_(<2 x s16>) = COPY $vgpr0
259 %1:_(<2 x s16>) = COPY $sgpr0
260 %2:_(<2 x s16>) = G_ASHR %0, %1
261 S_ENDPGM 0, implicit %2
271 liveins: $vgpr0, $vgpr1
272 ; CHECK-LABEL: name: ashr_v2s16_vv
273 ; CHECK: liveins: $vgpr0, $vgpr1
275 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
276 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
277 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
278 ; CHECK-NEXT: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
279 %0:_(<2 x s16>) = COPY $vgpr0
280 %1:_(<2 x s16>) = COPY $vgpr1
281 %2:_(<2 x s16>) = G_ASHR %0, %1
282 S_ENDPGM 0, implicit %2