1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=amdgpu-regbankselect -regbankselect-fast -o - %s | FileCheck %s
3 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=amdgpu-regbankselect -regbankselect-greedy -o - %s | FileCheck %s
11 liveins: $sgpr0, $sgpr1
12 ; CHECK-LABEL: name: lshr_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: [[LSHR:%[0-9]+]]:sgpr(s32) = G_LSHR [[COPY]], [[COPY1]](s32)
18 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](s32)
19 %0:_(s32) = COPY $sgpr0
20 %1:_(s32) = COPY $sgpr1
21 %2:_(s32) = G_LSHR %0, %1
22 S_ENDPGM 0, implicit %2
31 liveins: $sgpr0, $vgpr0
32 ; CHECK-LABEL: name: lshr_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: [[LSHR:%[0-9]+]]:vgpr(s32) = G_LSHR [[COPY2]], [[COPY1]](s32)
39 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](s32)
40 %0:_(s32) = COPY $sgpr0
41 %1:_(s32) = COPY $vgpr0
42 %2:_(s32) = G_LSHR %0, %1
43 S_ENDPGM 0, implicit %2
52 liveins: $sgpr0, $vgpr0
53 ; CHECK-LABEL: name: lshr_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: [[LSHR:%[0-9]+]]:vgpr(s32) = G_LSHR [[COPY]], [[COPY2]](s32)
60 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](s32)
61 %0:_(s32) = COPY $vgpr0
62 %1:_(s32) = COPY $sgpr0
63 %2:_(s32) = G_LSHR %0, %1
64 S_ENDPGM 0, implicit %2
73 liveins: $vgpr0, $vgpr1
74 ; CHECK-LABEL: name: lshr_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: [[LSHR:%[0-9]+]]:vgpr(s32) = G_LSHR [[COPY]], [[COPY1]](s32)
80 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](s32)
81 %0:_(s32) = COPY $vgpr0
82 %1:_(s32) = COPY $vgpr1
83 %2:_(s32) = G_LSHR %0, %1
84 S_ENDPGM 0, implicit %2
93 liveins: $sgpr0, $sgpr1
94 ; CHECK-LABEL: name: lshr_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: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC]](s16)
102 ; CHECK-NEXT: [[ZEXT1:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s16)
103 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:sgpr(s32) = G_LSHR [[ZEXT]], [[ZEXT1]](s32)
104 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[LSHR]](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_LSHR %2, %3
111 S_ENDPGM 0, implicit %4
120 liveins: $sgpr0, $vgpr0
122 ; CHECK-LABEL: name: lshr_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: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[COPY2]], [[TRUNC1]](s16)
131 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](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_LSHR %2, %3
137 S_ENDPGM 0, implicit %4
146 liveins: $sgpr0, $vgpr0
147 ; CHECK-LABEL: name: lshr_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: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY2]](s16)
156 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](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_LSHR %2, %3
162 S_ENDPGM 0, implicit %4
172 liveins: $vgpr0, $vgpr1
173 ; CHECK-LABEL: name: lshr_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: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[TRUNC1]](s16)
181 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](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_LSHR %2, %3
187 S_ENDPGM 0, implicit %4
197 liveins: $sgpr0, $sgpr1
198 ; CHECK-LABEL: name: lshr_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: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
205 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:sgpr(s32) = G_LSHR [[BITCAST]], [[C]](s32)
206 ; CHECK-NEXT: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
207 ; CHECK-NEXT: [[AND:%[0-9]+]]:sgpr(s32) = G_AND [[BITCAST]], [[C1]]
208 ; CHECK-NEXT: [[BITCAST1:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY1]](<2 x s16>)
209 ; CHECK-NEXT: [[C2:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
210 ; CHECK-NEXT: [[LSHR1:%[0-9]+]]:sgpr(s32) = G_LSHR [[BITCAST1]], [[C2]](s32)
211 ; CHECK-NEXT: [[C3:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 65535
212 ; CHECK-NEXT: [[AND1:%[0-9]+]]:sgpr(s32) = G_AND [[BITCAST1]], [[C3]]
213 ; CHECK-NEXT: [[LSHR2:%[0-9]+]]:sgpr(s32) = G_LSHR [[AND]], [[AND1]](s32)
214 ; CHECK-NEXT: [[LSHR3:%[0-9]+]]:sgpr(s32) = G_LSHR [[LSHR]], [[LSHR1]](s32)
215 ; CHECK-NEXT: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:sgpr(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[LSHR2]](s32), [[LSHR3]](s32)
216 ; CHECK-NEXT: S_ENDPGM 0, implicit [[BUILD_VECTOR_TRUNC]](<2 x s16>)
217 %0:_(<2 x s16>) = COPY $sgpr0
218 %1:_(<2 x s16>) = COPY $sgpr1
219 %2:_(<2 x s16>) = G_LSHR %0, %1
220 S_ENDPGM 0, implicit %2
230 liveins: $sgpr0, $vgpr0
231 ; CHECK-LABEL: name: lshr_v2s16_sv
232 ; CHECK: liveins: $sgpr0, $vgpr0
234 ; CHECK-NEXT: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
235 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
236 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY]](<2 x s16>)
237 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY2]], [[COPY1]](<2 x s16>)
238 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
239 %0:_(<2 x s16>) = COPY $sgpr0
240 %1:_(<2 x s16>) = COPY $vgpr0
241 %2:_(<2 x s16>) = G_LSHR %0, %1
242 S_ENDPGM 0, implicit %2
251 liveins: $sgpr0, $vgpr0
252 ; CHECK-LABEL: name: lshr_v2s16_vs
253 ; CHECK: liveins: $sgpr0, $vgpr0
255 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
256 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
257 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY1]](<2 x s16>)
258 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY2]](<2 x s16>)
259 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
260 %0:_(<2 x s16>) = COPY $vgpr0
261 %1:_(<2 x s16>) = COPY $sgpr0
262 %2:_(<2 x s16>) = G_LSHR %0, %1
263 S_ENDPGM 0, implicit %2
273 liveins: $vgpr0, $vgpr1
274 ; CHECK-LABEL: name: lshr_v2s16_vv
275 ; CHECK: liveins: $vgpr0, $vgpr1
277 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
278 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
279 ; CHECK-NEXT: [[LSHR:%[0-9]+]]:vgpr(<2 x s16>) = G_LSHR [[COPY]], [[COPY1]](<2 x s16>)
280 ; CHECK-NEXT: S_ENDPGM 0, implicit [[LSHR]](<2 x s16>)
281 %0:_(<2 x s16>) = COPY $vgpr0
282 %1:_(<2 x s16>) = COPY $vgpr1
283 %2:_(<2 x s16>) = G_LSHR %0, %1
284 S_ENDPGM 0, implicit %2