1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
3 # RUN: llc -mtriple=amdgcn -mcpu=fiji -run-pass=instruction-select -global-isel-abort=2 -disable-gisel-legality-check -pass-remarks-missed='gisel*' -verify-machineinstrs %s -o - 2>%t | FileCheck -check-prefix=GFX8 %s
4 # RUN: FileCheck --check-prefix=ERR %s < %t
6 # RUN: llc -mtriple=amdgcn -mcpu=gfx900 -run-pass=instruction-select -global-isel-abort=2 -disable-gisel-legality-check -pass-remarks-missed='gisel*' -verify-machineinstrs %s -o - 2>%t | FileCheck -check-prefix=GFX9 %s
7 # RUN: FileCheck --check-prefix=ERR %s < %t
9 # RUN: llc -mtriple=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -global-isel-abort=2 -disable-gisel-legality-check -pass-remarks-missed='gisel*' -verify-machineinstrs %s -o - 2>%t | FileCheck -check-prefix=GFX10 %s
10 # RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -run-pass=instruction-select -global-isel-abort=2 -disable-gisel-legality-check -pass-remarks-missed='gisel*' -verify-machineinstrs %s -o - 2>%t | FileCheck -check-prefix=GFX11 %s
11 # RUN: FileCheck --check-prefix=ERR %s < %t
14 # ERR: remark: <unknown>:0:0: cannot select: %4:sgpr(s16) = G_LSHR %2:sgpr, %3:sgpr(s16) (in function: lshr_s16_s16_ss)
15 # ERR-NEXT: remark: <unknown>:0:0: cannot select: %3:vgpr(s16) = G_LSHR %2:vgpr, %1:vgpr(s32) (in function: lshr_s16_s32_vv)
16 # ERR-NEXT: remark: <unknown>:0:0: cannot select: %3:sgpr(s16) = G_LSHR %2:sgpr, %1:sgpr(s32) (in function: lshr_s16_s32_ss)
17 # ERR-NEXT: remark: <unknown>:0:0: cannot select: %3:vgpr(s16) = G_LSHR %2:sgpr, %1:vgpr(s32) (in function: lshr_s16_s32_sv)
18 # ERR-NEXT: remark: <unknown>:0:0: cannot select: %3:vgpr(s16) = G_LSHR %2:vgpr, %1:sgpr(s32) (in function: lshr_s16_s32_vs)
28 liveins: $sgpr0, $sgpr1
30 ; GFX8-LABEL: name: lshr_s16_s16_ss
31 ; GFX8: liveins: $sgpr0, $sgpr1
33 ; GFX8-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
34 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
35 ; GFX8-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
36 ; GFX8-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
37 ; GFX8-NEXT: [[LSHR:%[0-9]+]]:sgpr(s16) = G_LSHR [[TRUNC]], [[TRUNC1]](s16)
38 ; GFX8-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
39 ; GFX9-LABEL: name: lshr_s16_s16_ss
40 ; GFX9: liveins: $sgpr0, $sgpr1
42 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
43 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
44 ; GFX9-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
45 ; GFX9-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
46 ; GFX9-NEXT: [[LSHR:%[0-9]+]]:sgpr(s16) = G_LSHR [[TRUNC]], [[TRUNC1]](s16)
47 ; GFX9-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
48 ; GFX10-LABEL: name: lshr_s16_s16_ss
49 ; GFX10: liveins: $sgpr0, $sgpr1
51 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
52 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
53 ; GFX10-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
54 ; GFX10-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
55 ; GFX10-NEXT: [[LSHR:%[0-9]+]]:sgpr(s16) = G_LSHR [[TRUNC]], [[TRUNC1]](s16)
56 ; GFX10-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
57 ; GFX11-LABEL: name: lshr_s16_s16_ss
58 ; GFX11: liveins: $sgpr0, $sgpr1
60 ; GFX11-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
61 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
62 ; GFX11-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
63 ; GFX11-NEXT: [[TRUNC1:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY1]](s32)
64 ; GFX11-NEXT: [[LSHR:%[0-9]+]]:sgpr(s16) = G_LSHR [[TRUNC]], [[TRUNC1]](s16)
65 ; GFX11-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
66 %0:sgpr(s32) = COPY $sgpr0
67 %1:sgpr(s32) = COPY $sgpr1
68 %2:sgpr(s16) = G_TRUNC %0
69 %3:sgpr(s16) = G_TRUNC %1
70 %4:sgpr(s16) = G_LSHR %2, %3
71 S_ENDPGM 0, implicit %4
81 liveins: $sgpr0, $vgpr0
82 ; GFX8-LABEL: name: lshr_s16_s16_vs
83 ; GFX8: liveins: $sgpr0, $vgpr0
85 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
86 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
87 ; GFX8-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
88 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
89 ; GFX9-LABEL: name: lshr_s16_s16_vs
90 ; GFX9: liveins: $sgpr0, $vgpr0
92 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
93 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
94 ; GFX9-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
95 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
96 ; GFX10-LABEL: name: lshr_s16_s16_vs
97 ; GFX10: liveins: $sgpr0, $vgpr0
99 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
100 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
101 ; GFX10-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
102 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
103 ; GFX11-LABEL: name: lshr_s16_s16_vs
104 ; GFX11: liveins: $sgpr0, $vgpr0
106 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
107 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:sreg_32 = COPY $sgpr0
108 ; GFX11-NEXT: [[V_LSHRREV_B16_t16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_t16_e64 [[COPY1]], [[COPY]], implicit $exec
109 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_t16_e64_]]
110 %0:vgpr(s32) = COPY $vgpr0
111 %1:sgpr(s32) = COPY $sgpr0
112 %2:vgpr(s16) = G_TRUNC %0
113 %3:sgpr(s16) = G_TRUNC %1
114 %4:vgpr(s16) = G_LSHR %2, %3
115 S_ENDPGM 0, implicit %4
119 name: lshr_s16_s32_vv
121 regBankSelected: true
125 liveins: $vgpr0, $vgpr1
127 ; GFX8-LABEL: name: lshr_s16_s32_vv
128 ; GFX8: liveins: $vgpr0, $vgpr1
130 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
131 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
132 ; GFX8-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
133 ; GFX8-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
134 ; GFX8-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
135 ; GFX9-LABEL: name: lshr_s16_s32_vv
136 ; GFX9: liveins: $vgpr0, $vgpr1
138 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
139 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
140 ; GFX9-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
141 ; GFX9-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
142 ; GFX9-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
143 ; GFX10-LABEL: name: lshr_s16_s32_vv
144 ; GFX10: liveins: $vgpr0, $vgpr1
146 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
147 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
148 ; GFX10-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
149 ; GFX10-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
150 ; GFX10-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
151 ; GFX11-LABEL: name: lshr_s16_s32_vv
152 ; GFX11: liveins: $vgpr0, $vgpr1
154 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
155 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr1
156 ; GFX11-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
157 ; GFX11-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
158 ; GFX11-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
159 %0:vgpr(s32) = COPY $vgpr0
160 %1:vgpr(s32) = COPY $vgpr1
161 %2:vgpr(s16) = G_TRUNC %0
162 %3:vgpr(s16) = G_LSHR %2, %1
163 S_ENDPGM 0, implicit %3
167 name: lshr_s16_s16_vv
169 regBankSelected: true
173 liveins: $vgpr0, $vgpr1
175 ; GFX8-LABEL: name: lshr_s16_s16_vv
176 ; GFX8: liveins: $vgpr0, $vgpr1
178 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
179 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
180 ; GFX8-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
181 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
182 ; GFX9-LABEL: name: lshr_s16_s16_vv
183 ; GFX9: liveins: $vgpr0, $vgpr1
185 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
186 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
187 ; GFX9-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
188 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
189 ; GFX10-LABEL: name: lshr_s16_s16_vv
190 ; GFX10: liveins: $vgpr0, $vgpr1
192 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
193 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
194 ; GFX10-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
195 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
196 ; GFX11-LABEL: name: lshr_s16_s16_vv
197 ; GFX11: liveins: $vgpr0, $vgpr1
199 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
200 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
201 ; GFX11-NEXT: [[V_LSHRREV_B16_t16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_t16_e64 [[COPY1]], [[COPY]], implicit $exec
202 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_t16_e64_]]
203 %0:vgpr(s32) = COPY $vgpr0
204 %1:vgpr(s32) = COPY $vgpr1
205 %2:vgpr(s16) = G_TRUNC %0
206 %3:vgpr(s16) = G_TRUNC %1
207 %4:vgpr(s16) = G_LSHR %2, %3
208 S_ENDPGM 0, implicit %4
212 name: lshr_s16_s16_vv_zext_to_s32
214 regBankSelected: true
218 liveins: $vgpr0, $vgpr1
220 ; GFX8-LABEL: name: lshr_s16_s16_vv_zext_to_s32
221 ; GFX8: liveins: $vgpr0, $vgpr1
223 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
224 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
225 ; GFX8-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
226 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
227 ; GFX9-LABEL: name: lshr_s16_s16_vv_zext_to_s32
228 ; GFX9: liveins: $vgpr0, $vgpr1
230 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
231 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
232 ; GFX9-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
233 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
234 ; GFX10-LABEL: name: lshr_s16_s16_vv_zext_to_s32
235 ; GFX10: liveins: $vgpr0, $vgpr1
237 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
238 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
239 ; GFX10-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
240 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 65535
241 ; GFX10-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[V_LSHRREV_B16_e64_]], implicit $exec
242 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_AND_B32_e64_]]
243 ; GFX11-LABEL: name: lshr_s16_s16_vv_zext_to_s32
244 ; GFX11: liveins: $vgpr0, $vgpr1
246 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
247 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
248 ; GFX11-NEXT: [[V_LSHRREV_B16_t16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_t16_e64 [[COPY1]], [[COPY]], implicit $exec
249 ; GFX11-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 65535
250 ; GFX11-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_]], [[V_LSHRREV_B16_t16_e64_]], implicit $exec
251 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_AND_B32_e64_]]
252 %0:vgpr(s32) = COPY $vgpr0
253 %1:vgpr(s32) = COPY $vgpr1
254 %2:vgpr(s16) = G_TRUNC %0
255 %3:vgpr(s16) = G_TRUNC %1
256 %4:vgpr(s16) = G_LSHR %2, %3
257 %5:vgpr(s32) = G_ZEXT %4
258 S_ENDPGM 0, implicit %5
262 name: lshr_s16_vv_zext_to_s64
264 regBankSelected: true
268 liveins: $vgpr0, $vgpr1
270 ; GFX8-LABEL: name: lshr_s16_vv_zext_to_s64
271 ; GFX8: liveins: $vgpr0, $vgpr1
273 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
274 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
275 ; GFX8-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
276 ; GFX8-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
277 ; GFX8-NEXT: [[S_MOV_B32_1:%[0-9]+]]:sreg_32 = S_MOV_B32 65535
278 ; GFX8-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_1]], [[V_LSHRREV_B16_e64_]], implicit $exec
279 ; GFX8-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[S_MOV_B32_]]
280 ; GFX8-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[V_AND_B32_e64_]], %subreg.sub0, [[COPY2]], %subreg.sub1
281 ; GFX8-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
282 ; GFX9-LABEL: name: lshr_s16_vv_zext_to_s64
283 ; GFX9: liveins: $vgpr0, $vgpr1
285 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
286 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
287 ; GFX9-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
288 ; GFX9-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
289 ; GFX9-NEXT: [[S_MOV_B32_1:%[0-9]+]]:sreg_32 = S_MOV_B32 65535
290 ; GFX9-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_1]], [[V_LSHRREV_B16_e64_]], implicit $exec
291 ; GFX9-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[S_MOV_B32_]]
292 ; GFX9-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[V_AND_B32_e64_]], %subreg.sub0, [[COPY2]], %subreg.sub1
293 ; GFX9-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
294 ; GFX10-LABEL: name: lshr_s16_vv_zext_to_s64
295 ; GFX10: liveins: $vgpr0, $vgpr1
297 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
298 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
299 ; GFX10-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
300 ; GFX10-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
301 ; GFX10-NEXT: [[S_MOV_B32_1:%[0-9]+]]:sreg_32 = S_MOV_B32 65535
302 ; GFX10-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_1]], [[V_LSHRREV_B16_e64_]], implicit $exec
303 ; GFX10-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[S_MOV_B32_]]
304 ; GFX10-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[V_AND_B32_e64_]], %subreg.sub0, [[COPY2]], %subreg.sub1
305 ; GFX10-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
306 ; GFX11-LABEL: name: lshr_s16_vv_zext_to_s64
307 ; GFX11: liveins: $vgpr0, $vgpr1
309 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
310 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
311 ; GFX11-NEXT: [[V_LSHRREV_B16_t16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_t16_e64 [[COPY1]], [[COPY]], implicit $exec
312 ; GFX11-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 0
313 ; GFX11-NEXT: [[S_MOV_B32_1:%[0-9]+]]:sreg_32 = S_MOV_B32 65535
314 ; GFX11-NEXT: [[V_AND_B32_e64_:%[0-9]+]]:vgpr_32 = V_AND_B32_e64 [[S_MOV_B32_1]], [[V_LSHRREV_B16_t16_e64_]], implicit $exec
315 ; GFX11-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[S_MOV_B32_]]
316 ; GFX11-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[V_AND_B32_e64_]], %subreg.sub0, [[COPY2]], %subreg.sub1
317 ; GFX11-NEXT: S_ENDPGM 0, implicit [[REG_SEQUENCE]]
318 %0:vgpr(s32) = COPY $vgpr0
319 %1:vgpr(s32) = COPY $vgpr1
320 %2:vgpr(s16) = G_TRUNC %0
321 %3:vgpr(s16) = G_TRUNC %1
322 %4:vgpr(s16) = G_LSHR %2, %3
323 %5:vgpr(s64) = G_ZEXT %4
324 S_ENDPGM 0, implicit %5
328 name: lshr_s16_s32_ss
330 regBankSelected: true
334 liveins: $sgpr0, $sgpr1
336 ; GFX8-LABEL: name: lshr_s16_s32_ss
337 ; GFX8: liveins: $sgpr0, $sgpr1
339 ; GFX8-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
340 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
341 ; GFX8-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
342 ; GFX8-NEXT: [[LSHR:%[0-9]+]]:sgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
343 ; GFX8-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
344 ; GFX9-LABEL: name: lshr_s16_s32_ss
345 ; GFX9: liveins: $sgpr0, $sgpr1
347 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
348 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
349 ; GFX9-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
350 ; GFX9-NEXT: [[LSHR:%[0-9]+]]:sgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
351 ; GFX9-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
352 ; GFX10-LABEL: name: lshr_s16_s32_ss
353 ; GFX10: liveins: $sgpr0, $sgpr1
355 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
356 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
357 ; GFX10-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
358 ; GFX10-NEXT: [[LSHR:%[0-9]+]]:sgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
359 ; GFX10-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
360 ; GFX11-LABEL: name: lshr_s16_s32_ss
361 ; GFX11: liveins: $sgpr0, $sgpr1
363 ; GFX11-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
364 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr1
365 ; GFX11-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
366 ; GFX11-NEXT: [[LSHR:%[0-9]+]]:sgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
367 ; GFX11-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
368 %0:sgpr(s32) = COPY $sgpr0
369 %1:sgpr(s32) = COPY $sgpr1
370 %2:sgpr(s16) = G_TRUNC %0
371 %3:sgpr(s16) = G_LSHR %2, %1
372 S_ENDPGM 0, implicit %3
376 name: lshr_s16_s32_sv
378 regBankSelected: true
382 liveins: $sgpr0, $vgpr0
383 ; GFX8-LABEL: name: lshr_s16_s32_sv
384 ; GFX8: liveins: $sgpr0, $vgpr0
386 ; GFX8-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
387 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
388 ; GFX8-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
389 ; GFX8-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
390 ; GFX8-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
391 ; GFX9-LABEL: name: lshr_s16_s32_sv
392 ; GFX9: liveins: $sgpr0, $vgpr0
394 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
395 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
396 ; GFX9-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
397 ; GFX9-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
398 ; GFX9-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
399 ; GFX10-LABEL: name: lshr_s16_s32_sv
400 ; GFX10: liveins: $sgpr0, $vgpr0
402 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
403 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
404 ; GFX10-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
405 ; GFX10-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
406 ; GFX10-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
407 ; GFX11-LABEL: name: lshr_s16_s32_sv
408 ; GFX11: liveins: $sgpr0, $vgpr0
410 ; GFX11-NEXT: [[COPY:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
411 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
412 ; GFX11-NEXT: [[TRUNC:%[0-9]+]]:sgpr(s16) = G_TRUNC [[COPY]](s32)
413 ; GFX11-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
414 ; GFX11-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
415 %0:sgpr(s32) = COPY $sgpr0
416 %1:vgpr(s32) = COPY $vgpr0
417 %2:sgpr(s16) = G_TRUNC %0
418 %3:vgpr(s16) = G_LSHR %2, %1
419 S_ENDPGM 0, implicit %3
423 name: lshr_s16_s16_sv
425 regBankSelected: true
429 liveins: $sgpr0, $vgpr0
430 ; GFX8-LABEL: name: lshr_s16_s16_sv
431 ; GFX8: liveins: $sgpr0, $vgpr0
433 ; GFX8-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
434 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
435 ; GFX8-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
436 ; GFX8-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
437 ; GFX9-LABEL: name: lshr_s16_s16_sv
438 ; GFX9: liveins: $sgpr0, $vgpr0
440 ; GFX9-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
441 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
442 ; GFX9-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
443 ; GFX9-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
444 ; GFX10-LABEL: name: lshr_s16_s16_sv
445 ; GFX10: liveins: $sgpr0, $vgpr0
447 ; GFX10-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
448 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
449 ; GFX10-NEXT: [[V_LSHRREV_B16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_e64 [[COPY1]], [[COPY]], implicit $exec
450 ; GFX10-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_e64_]]
451 ; GFX11-LABEL: name: lshr_s16_s16_sv
452 ; GFX11: liveins: $sgpr0, $vgpr0
454 ; GFX11-NEXT: [[COPY:%[0-9]+]]:sreg_32 = COPY $sgpr0
455 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr0
456 ; GFX11-NEXT: [[V_LSHRREV_B16_t16_e64_:%[0-9]+]]:vgpr_32 = V_LSHRREV_B16_t16_e64 [[COPY1]], [[COPY]], implicit $exec
457 ; GFX11-NEXT: S_ENDPGM 0, implicit [[V_LSHRREV_B16_t16_e64_]]
458 %0:sgpr(s32) = COPY $sgpr0
459 %1:vgpr(s32) = COPY $vgpr0
460 %2:sgpr(s16) = G_TRUNC %0
461 %3:vgpr(s16) = G_TRUNC %1
462 %4:vgpr(s16) = G_LSHR %2, %3
463 S_ENDPGM 0, implicit %4
467 name: lshr_s16_s32_vs
469 regBankSelected: true
473 liveins: $sgpr0, $vgpr0
474 ; GFX8-LABEL: name: lshr_s16_s32_vs
475 ; GFX8: liveins: $sgpr0, $vgpr0
477 ; GFX8-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
478 ; GFX8-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
479 ; GFX8-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
480 ; GFX8-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
481 ; GFX8-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
482 ; GFX9-LABEL: name: lshr_s16_s32_vs
483 ; GFX9: liveins: $sgpr0, $vgpr0
485 ; GFX9-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
486 ; GFX9-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
487 ; GFX9-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
488 ; GFX9-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
489 ; GFX9-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
490 ; GFX10-LABEL: name: lshr_s16_s32_vs
491 ; GFX10: liveins: $sgpr0, $vgpr0
493 ; GFX10-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
494 ; GFX10-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
495 ; GFX10-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
496 ; GFX10-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
497 ; GFX10-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
498 ; GFX11-LABEL: name: lshr_s16_s32_vs
499 ; GFX11: liveins: $sgpr0, $vgpr0
501 ; GFX11-NEXT: [[COPY:%[0-9]+]]:vgpr(s32) = COPY $vgpr0
502 ; GFX11-NEXT: [[COPY1:%[0-9]+]]:sgpr(s32) = COPY $sgpr0
503 ; GFX11-NEXT: [[TRUNC:%[0-9]+]]:vgpr(s16) = G_TRUNC [[COPY]](s32)
504 ; GFX11-NEXT: [[LSHR:%[0-9]+]]:vgpr(s16) = G_LSHR [[TRUNC]], [[COPY1]](s32)
505 ; GFX11-NEXT: S_ENDPGM 0, implicit [[LSHR]](s16)
506 %0:vgpr(s32) = COPY $vgpr0
507 %1:sgpr(s32) = COPY $sgpr0
508 %2:vgpr(s16) = G_TRUNC %0
509 %3:vgpr(s16) = G_LSHR %2, %1
510 S_ENDPGM 0, implicit %3