1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=regbankselect -regbankselect-fast -o - %s | FileCheck %s
3 # RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -run-pass=regbankselect -regbankselect-greedy -o - %s | FileCheck %s
11 liveins: $sgpr0, $sgpr1
12 ; CHECK-LABEL: name: ashr_s32_ss
13 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
14 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
15 ; CHECK: [[ASHR:%[0-9]+]]:sgpr(s32) = G_ASHR [[COPY]], [[COPY1]](s32)
16 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](s32)
17 %0:_(s32) = COPY $sgpr0
18 %1:_(s32) = COPY $sgpr1
19 %2:_(s32) = G_ASHR %0, %1
20 S_ENDPGM 0, implicit %2
29 liveins: $sgpr0, $vgpr0
30 ; CHECK-LABEL: name: ashr_s32_sv
31 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
32 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
33 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY]](s32)
34 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[COPY2]], [[COPY1]](s32)
35 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](s32)
36 %0:_(s32) = COPY $sgpr0
37 %1:_(s32) = COPY $vgpr0
38 %2:_(s32) = G_ASHR %0, %1
39 S_ENDPGM 0, implicit %2
48 liveins: $sgpr0, $vgpr0
49 ; CHECK-LABEL: name: ashr_s32_vs
50 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
51 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
52 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s32) = COPY [[COPY1]](s32)
53 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[COPY]], [[COPY2]](s32)
54 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](s32)
55 %0:_(s32) = COPY $vgpr0
56 %1:_(s32) = COPY $sgpr0
57 %2:_(s32) = G_ASHR %0, %1
58 S_ENDPGM 0, implicit %2
67 liveins: $vgpr0, $vgpr1
68 ; CHECK-LABEL: name: ashr_s32_vv
69 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
70 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
71 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(s32) = G_ASHR [[COPY]], [[COPY1]](s32)
72 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](s32)
73 %0:_(s32) = COPY $vgpr0
74 %1:_(s32) = COPY $vgpr1
75 %2:_(s32) = G_ASHR %0, %1
76 S_ENDPGM 0, implicit %2
85 liveins: $sgpr0, $sgpr1
86 ; CHECK-LABEL: name: ashr_s16_ss
87 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
88 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
89 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
90 ; CHECK: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
91 ; CHECK: [[SEXT:%[0-9]+]]:sgpr(s32) = G_SEXT [[TRUNC]](s16)
92 ; CHECK: [[ZEXT:%[0-9]+]]:sgpr(s32) = G_ZEXT [[TRUNC1]](s16)
93 ; CHECK: [[ASHR:%[0-9]+]]:sgpr(s32) = G_ASHR [[SEXT]], [[ZEXT]](s32)
94 ; CHECK: [[TRUNC2:%[0-9]+]]:sgpr(s16) = G_TRUNC [[ASHR]](s32)
95 ; CHECK: S_ENDPGM 0, implicit [[TRUNC2]](s16)
96 %0:_(s32) = COPY $sgpr0
97 %1:_(s32) = COPY $sgpr1
98 %2:_(s16) = G_TRUNC %0
99 %3:_(s16) = G_TRUNC %1
100 %4:_(s16) = G_ASHR %2, %3
101 S_ENDPGM 0, implicit %4
110 liveins: $sgpr0, $vgpr0
112 ; CHECK-LABEL: name: ashr_s16_sv
113 ; CHECK: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
114 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
115 ; CHECK: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
116 ; CHECK: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
117 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC]](s16)
118 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(s16) = G_ASHR [[COPY2]], [[TRUNC1]](s16)
119 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](s16)
120 %0:_(s32) = COPY $sgpr0
121 %1:_(s32) = COPY $vgpr0
122 %2:_(s16) = G_TRUNC %0
123 %3:_(s16) = G_TRUNC %1
124 %4:_(s16) = G_ASHR %2, %3
125 S_ENDPGM 0, implicit %4
134 liveins: $sgpr0, $vgpr0
135 ; CHECK-LABEL: name: ashr_s16_vs
136 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
137 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
138 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
139 ; CHECK: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
140 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(s16) = COPY [[TRUNC1]](s16)
141 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(s16) = G_ASHR [[TRUNC]], [[COPY2]](s16)
142 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](s16)
143 %0:_(s32) = COPY $vgpr0
144 %1:_(s32) = COPY $sgpr0
145 %2:_(s16) = G_TRUNC %0
146 %3:_(s16) = G_TRUNC %1
147 %4:_(s16) = G_ASHR %2, %3
148 S_ENDPGM 0, implicit %4
158 liveins: $vgpr0, $vgpr1
159 ; CHECK-LABEL: name: ashr_s16_vv
160 ; CHECK: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
161 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
162 ; CHECK: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
163 ; CHECK: [[TRUNC1:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY1]](s32)
164 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(s16) = G_ASHR [[TRUNC]], [[TRUNC1]](s16)
165 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](s16)
166 %0:_(s32) = COPY $vgpr0
167 %1:_(s32) = COPY $vgpr1
168 %2:_(s16) = G_TRUNC %0
169 %3:_(s16) = G_TRUNC %1
170 %4:_(s16) = G_ASHR %2, %3
171 S_ENDPGM 0, implicit %4
181 liveins: $sgpr0, $sgpr1
182 ; CHECK-LABEL: name: ashr_v2s16_ss
183 ; CHECK: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
184 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr1
185 ; CHECK: [[BITCAST:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY]](<2 x s16>)
186 ; CHECK: [[SEXT_INREG:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[BITCAST]], 16
187 ; CHECK: [[C:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
188 ; CHECK: [[ASHR:%[0-9]+]]:sgpr(s32) = G_ASHR [[BITCAST]], [[C]](s32)
189 ; CHECK: [[BITCAST1:%[0-9]+]]:sgpr(s32) = G_BITCAST [[COPY1]](<2 x s16>)
190 ; CHECK: [[SEXT_INREG1:%[0-9]+]]:sgpr(s32) = G_SEXT_INREG [[BITCAST1]], 16
191 ; CHECK: [[C1:%[0-9]+]]:sgpr(s32) = G_CONSTANT i32 16
192 ; CHECK: [[ASHR1:%[0-9]+]]:sgpr(s32) = G_ASHR [[BITCAST1]], [[C1]](s32)
193 ; CHECK: [[ASHR2:%[0-9]+]]:sgpr(s32) = G_ASHR [[SEXT_INREG]], [[SEXT_INREG1]](s32)
194 ; CHECK: [[ASHR3:%[0-9]+]]:sgpr(s32) = G_ASHR [[ASHR]], [[ASHR1]](s32)
195 ; CHECK: [[BUILD_VECTOR_TRUNC:%[0-9]+]]:sgpr(<2 x s16>) = G_BUILD_VECTOR_TRUNC [[ASHR2]](s32), [[ASHR3]](s32)
196 ; CHECK: S_ENDPGM 0, implicit [[BUILD_VECTOR_TRUNC]](<2 x s16>)
197 %0:_(<2 x s16>) = COPY $sgpr0
198 %1:_(<2 x s16>) = COPY $sgpr1
199 %2:_(<2 x s16>) = G_ASHR %0, %1
200 S_ENDPGM 0, implicit %2
210 liveins: $sgpr0, $vgpr0
211 ; CHECK-LABEL: name: ashr_v2s16_sv
212 ; CHECK: [[COPY:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
213 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
214 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY]](<2 x s16>)
215 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY2]], [[COPY1]](<2 x s16>)
216 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
217 %0:_(<2 x s16>) = COPY $sgpr0
218 %1:_(<2 x s16>) = COPY $vgpr0
219 %2:_(<2 x s16>) = G_ASHR %0, %1
220 S_ENDPGM 0, implicit %2
229 liveins: $sgpr0, $vgpr0
230 ; CHECK-LABEL: name: ashr_v2s16_vs
231 ; CHECK: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
232 ; CHECK: [[COPY1:%[0-9]+]]:sgpr(<2 x s16>) = COPY $sgpr0
233 ; CHECK: [[COPY2:%[0-9]+]]:vgpr(<2 x s16>) = COPY [[COPY1]](<2 x s16>)
234 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY2]](<2 x s16>)
235 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
236 %0:_(<2 x s16>) = COPY $vgpr0
237 %1:_(<2 x s16>) = COPY $sgpr0
238 %2:_(<2 x s16>) = G_ASHR %0, %1
239 S_ENDPGM 0, implicit %2
249 liveins: $vgpr0, $vgpr1
250 ; CHECK-LABEL: name: ashr_v2s16_vv
251 ; CHECK: [[COPY:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr0
252 ; CHECK: [[COPY1:%[0-9]+]]:vgpr(<2 x s16>) = COPY $vgpr1
253 ; CHECK: [[ASHR:%[0-9]+]]:vgpr(<2 x s16>) = G_ASHR [[COPY]], [[COPY1]](<2 x s16>)
254 ; CHECK: S_ENDPGM 0, implicit [[ASHR]](<2 x s16>)
255 %0:_(<2 x s16>) = COPY $vgpr0
256 %1:_(<2 x s16>) = COPY $vgpr1
257 %2:_(<2 x s16>) = G_ASHR %0, %1
258 S_ENDPGM 0, implicit %2