Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / test / CodeGen / AMDGPU / GlobalISel / inst-select-lshr.s16.mir
blob140edabcab56555b05bd4b266a9eee515767d607
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
13 # ERR-NOT: remark
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)
19 # ERR-NOT: remark
21 ---
22 name: lshr_s16_s16_ss
23 legalized: true
24 regBankSelected: true
26 body: |
27   bb.0:
28     liveins: $sgpr0, $sgpr1
30     ; GFX8-LABEL: name: lshr_s16_s16_ss
31     ; GFX8: liveins: $sgpr0, $sgpr1
32     ; GFX8-NEXT: {{  $}}
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
41     ; GFX9-NEXT: {{  $}}
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
50     ; GFX10-NEXT: {{  $}}
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
59     ; GFX11-NEXT: {{  $}}
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
72 ...
74 ---
75 name: lshr_s16_s16_vs
76 legalized: true
77 regBankSelected: true
79 body: |
80   bb.0:
81     liveins: $sgpr0, $vgpr0
82     ; GFX8-LABEL: name: lshr_s16_s16_vs
83     ; GFX8: liveins: $sgpr0, $vgpr0
84     ; GFX8-NEXT: {{  $}}
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
91     ; GFX9-NEXT: {{  $}}
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
98     ; GFX10-NEXT: {{  $}}
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
105     ; GFX11-NEXT: {{  $}}
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
120 legalized: true
121 regBankSelected: true
123 body: |
124   bb.0:
125     liveins: $vgpr0, $vgpr1
127     ; GFX8-LABEL: name: lshr_s16_s32_vv
128     ; GFX8: liveins: $vgpr0, $vgpr1
129     ; GFX8-NEXT: {{  $}}
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
137     ; GFX9-NEXT: {{  $}}
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
145     ; GFX10-NEXT: {{  $}}
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
153     ; GFX11-NEXT: {{  $}}
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
168 legalized: true
169 regBankSelected: true
171 body: |
172   bb.0:
173     liveins: $vgpr0, $vgpr1
175     ; GFX8-LABEL: name: lshr_s16_s16_vv
176     ; GFX8: liveins: $vgpr0, $vgpr1
177     ; GFX8-NEXT: {{  $}}
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
184     ; GFX9-NEXT: {{  $}}
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
191     ; GFX10-NEXT: {{  $}}
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
198     ; GFX11-NEXT: {{  $}}
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
213 legalized: true
214 regBankSelected: true
216 body: |
217   bb.0:
218     liveins: $vgpr0, $vgpr1
220     ; GFX8-LABEL: name: lshr_s16_s16_vv_zext_to_s32
221     ; GFX8: liveins: $vgpr0, $vgpr1
222     ; GFX8-NEXT: {{  $}}
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
229     ; GFX9-NEXT: {{  $}}
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
236     ; GFX10-NEXT: {{  $}}
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
245     ; GFX11-NEXT: {{  $}}
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
263 legalized: true
264 regBankSelected: true
266 body: |
267   bb.0:
268     liveins: $vgpr0, $vgpr1
270     ; GFX8-LABEL: name: lshr_s16_vv_zext_to_s64
271     ; GFX8: liveins: $vgpr0, $vgpr1
272     ; GFX8-NEXT: {{  $}}
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
284     ; GFX9-NEXT: {{  $}}
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
296     ; GFX10-NEXT: {{  $}}
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
308     ; GFX11-NEXT: {{  $}}
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
329 legalized: true
330 regBankSelected: true
332 body: |
333   bb.0:
334     liveins: $sgpr0, $sgpr1
336     ; GFX8-LABEL: name: lshr_s16_s32_ss
337     ; GFX8: liveins: $sgpr0, $sgpr1
338     ; GFX8-NEXT: {{  $}}
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
346     ; GFX9-NEXT: {{  $}}
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
354     ; GFX10-NEXT: {{  $}}
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
362     ; GFX11-NEXT: {{  $}}
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
377 legalized: true
378 regBankSelected: true
380 body: |
381   bb.0:
382     liveins: $sgpr0, $vgpr0
383     ; GFX8-LABEL: name: lshr_s16_s32_sv
384     ; GFX8: liveins: $sgpr0, $vgpr0
385     ; GFX8-NEXT: {{  $}}
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
393     ; GFX9-NEXT: {{  $}}
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
401     ; GFX10-NEXT: {{  $}}
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
409     ; GFX11-NEXT: {{  $}}
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
424 legalized: true
425 regBankSelected: true
427 body: |
428   bb.0:
429     liveins: $sgpr0, $vgpr0
430     ; GFX8-LABEL: name: lshr_s16_s16_sv
431     ; GFX8: liveins: $sgpr0, $vgpr0
432     ; GFX8-NEXT: {{  $}}
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
439     ; GFX9-NEXT: {{  $}}
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
446     ; GFX10-NEXT: {{  $}}
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
453     ; GFX11-NEXT: {{  $}}
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
468 legalized: true
469 regBankSelected: true
471 body: |
472   bb.0:
473     liveins: $sgpr0, $vgpr0
474     ; GFX8-LABEL: name: lshr_s16_s32_vs
475     ; GFX8: liveins: $sgpr0, $vgpr0
476     ; GFX8-NEXT: {{  $}}
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
484     ; GFX9-NEXT: {{  $}}
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
492     ; GFX10-NEXT: {{  $}}
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
500     ; GFX11-NEXT: {{  $}}
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