b23995d047382c0b00e7b81a9f4e2029f38163f0
[oota-llvm.git] / test / CodeGen / R600 / llvm.AMDGPU.bfe.i32.ll
1 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN: llc -march=r600 -mcpu=redwood -show-mc-encoding -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
3
4 ; http://llvm.org/bugs/show_bug.cgi?id=20982
5 ; REQUIRES: not_ubsan
6
7 declare i32 @llvm.AMDGPU.bfe.i32(i32, i32, i32) nounwind readnone
8
9 ; FUNC-LABEL: @bfe_i32_arg_arg_arg
10 ; SI: V_BFE_I32
11 ; EG: BFE_INT
12 ; EG: encoding: [{{[x0-9a-f]+,[x0-9a-f]+,[x0-9a-f]+,[x0-9a-f]+,[x0-9a-f]+}},0xac
13 define void @bfe_i32_arg_arg_arg(i32 addrspace(1)* %out, i32 %src0, i32 %src1, i32 %src2) nounwind {
14   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 %src0, i32 %src1, i32 %src1) nounwind readnone
15   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
16   ret void
17 }
18
19 ; FUNC-LABEL: @bfe_i32_arg_arg_imm
20 ; SI: V_BFE_I32
21 ; EG: BFE_INT
22 define void @bfe_i32_arg_arg_imm(i32 addrspace(1)* %out, i32 %src0, i32 %src1) nounwind {
23   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 %src0, i32 %src1, i32 123) nounwind readnone
24   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
25   ret void
26 }
27
28 ; FUNC-LABEL: @bfe_i32_arg_imm_arg
29 ; SI: V_BFE_I32
30 ; EG: BFE_INT
31 define void @bfe_i32_arg_imm_arg(i32 addrspace(1)* %out, i32 %src0, i32 %src2) nounwind {
32   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 %src0, i32 123, i32 %src2) nounwind readnone
33   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
34   ret void
35 }
36
37 ; FUNC-LABEL: @bfe_i32_imm_arg_arg
38 ; SI: V_BFE_I32
39 ; EG: BFE_INT
40 define void @bfe_i32_imm_arg_arg(i32 addrspace(1)* %out, i32 %src1, i32 %src2) nounwind {
41   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 123, i32 %src1, i32 %src2) nounwind readnone
42   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
43   ret void
44 }
45
46 ; FUNC-LABEL: @v_bfe_print_arg
47 ; SI: V_BFE_I32 v{{[0-9]+}}, v{{[0-9]+}}, 2, 8
48 define void @v_bfe_print_arg(i32 addrspace(1)* %out, i32 addrspace(1)* %src0) nounwind {
49   %load = load i32 addrspace(1)* %src0, align 4
50   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 %load, i32 2, i32 8) nounwind readnone
51   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
52   ret void
53 }
54
55 ; FUNC-LABEL: @bfe_i32_arg_0_width_reg_offset
56 ; SI-NOT: BFE
57 ; SI: S_ENDPGM
58 ; EG-NOT: BFE
59 define void @bfe_i32_arg_0_width_reg_offset(i32 addrspace(1)* %out, i32 %src0, i32 %src1) nounwind {
60   %bfe_u32 = call i32 @llvm.AMDGPU.bfe.i32(i32 %src0, i32 %src1, i32 0) nounwind readnone
61   store i32 %bfe_u32, i32 addrspace(1)* %out, align 4
62   ret void
63 }
64
65 ; FUNC-LABEL: @bfe_i32_arg_0_width_imm_offset
66 ; SI-NOT: BFE
67 ; SI: S_ENDPGM
68 ; EG-NOT: BFE
69 define void @bfe_i32_arg_0_width_imm_offset(i32 addrspace(1)* %out, i32 %src0, i32 %src1) nounwind {
70   %bfe_u32 = call i32 @llvm.AMDGPU.bfe.i32(i32 %src0, i32 8, i32 0) nounwind readnone
71   store i32 %bfe_u32, i32 addrspace(1)* %out, align 4
72   ret void
73 }
74
75 ; FUNC-LABEL: @bfe_i32_test_6
76 ; SI: V_LSHLREV_B32_e32 v{{[0-9]+}}, 31, v{{[0-9]+}}
77 ; SI: V_ASHRREV_I32_e32 v{{[0-9]+}}, 1, v{{[0-9]+}}
78 ; SI: S_ENDPGM
79 define void @bfe_i32_test_6(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
80   %x = load i32 addrspace(1)* %in, align 4
81   %shl = shl i32 %x, 31
82   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %shl, i32 1, i32 31)
83   store i32 %bfe, i32 addrspace(1)* %out, align 4
84   ret void
85 }
86
87 ; FUNC-LABEL: @bfe_i32_test_7
88 ; SI-NOT: SHL
89 ; SI-NOT: BFE
90 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0
91 ; SI: BUFFER_STORE_DWORD [[VREG]],
92 ; SI: S_ENDPGM
93 define void @bfe_i32_test_7(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
94   %x = load i32 addrspace(1)* %in, align 4
95   %shl = shl i32 %x, 31
96   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %shl, i32 0, i32 31)
97   store i32 %bfe, i32 addrspace(1)* %out, align 4
98   ret void
99 }
100
101 ; FIXME: The shifts should be 1 BFE
102 ; FUNC-LABEL: @bfe_i32_test_8
103 ; SI: BUFFER_LOAD_DWORD
104 ; SI: V_BFE_I32 v{{[0-9]+}}, v{{[0-9]+}}, 0, 1
105 ; SI: S_ENDPGM
106 define void @bfe_i32_test_8(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
107   %x = load i32 addrspace(1)* %in, align 4
108   %shl = shl i32 %x, 31
109   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %shl, i32 31, i32 1)
110   store i32 %bfe, i32 addrspace(1)* %out, align 4
111   ret void
112 }
113
114 ; FUNC-LABEL: @bfe_i32_test_9
115 ; SI-NOT: BFE
116 ; SI: V_ASHRREV_I32_e32 v{{[0-9]+}}, 31, v{{[0-9]+}}
117 ; SI-NOT: BFE
118 ; SI: S_ENDPGM
119 define void @bfe_i32_test_9(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
120   %x = load i32 addrspace(1)* %in, align 4
121   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %x, i32 31, i32 1)
122   store i32 %bfe, i32 addrspace(1)* %out, align 4
123   ret void
124 }
125
126 ; FUNC-LABEL: @bfe_i32_test_10
127 ; SI-NOT: BFE
128 ; SI: V_ASHRREV_I32_e32 v{{[0-9]+}}, 1, v{{[0-9]+}}
129 ; SI-NOT: BFE
130 ; SI: S_ENDPGM
131 define void @bfe_i32_test_10(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
132   %x = load i32 addrspace(1)* %in, align 4
133   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %x, i32 1, i32 31)
134   store i32 %bfe, i32 addrspace(1)* %out, align 4
135   ret void
136 }
137
138 ; FUNC-LABEL: @bfe_i32_test_11
139 ; SI-NOT: BFE
140 ; SI: V_ASHRREV_I32_e32 v{{[0-9]+}}, 8, v{{[0-9]+}}
141 ; SI-NOT: BFE
142 ; SI: S_ENDPGM
143 define void @bfe_i32_test_11(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
144   %x = load i32 addrspace(1)* %in, align 4
145   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %x, i32 8, i32 24)
146   store i32 %bfe, i32 addrspace(1)* %out, align 4
147   ret void
148 }
149
150 ; FUNC-LABEL: @bfe_i32_test_12
151 ; SI-NOT: BFE
152 ; SI: V_ASHRREV_I32_e32 v{{[0-9]+}}, 24, v{{[0-9]+}}
153 ; SI-NOT: BFE
154 ; SI: S_ENDPGM
155 define void @bfe_i32_test_12(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
156   %x = load i32 addrspace(1)* %in, align 4
157   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %x, i32 24, i32 8)
158   store i32 %bfe, i32 addrspace(1)* %out, align 4
159   ret void
160 }
161
162 ; FUNC-LABEL: @bfe_i32_test_13
163 ; SI: V_ASHRREV_I32_e32 {{v[0-9]+}}, 31, {{v[0-9]+}}
164 ; SI-NOT: BFE
165 ; SI: S_ENDPGM
166 define void @bfe_i32_test_13(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
167   %x = load i32 addrspace(1)* %in, align 4
168   %shl = ashr i32 %x, 31
169   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %shl, i32 31, i32 1)
170   store i32 %bfe, i32 addrspace(1)* %out, align 4 ret void
171 }
172
173 ; FUNC-LABEL: @bfe_i32_test_14
174 ; SI-NOT: LSHR
175 ; SI-NOT: BFE
176 ; SI: S_ENDPGM
177 define void @bfe_i32_test_14(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
178   %x = load i32 addrspace(1)* %in, align 4
179   %shl = lshr i32 %x, 31
180   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %shl, i32 31, i32 1)
181   store i32 %bfe, i32 addrspace(1)* %out, align 4 ret void
182 }
183
184 ; FUNC-LABEL: @bfe_i32_constant_fold_test_0
185 ; SI-NOT: BFE
186 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0
187 ; SI: BUFFER_STORE_DWORD [[VREG]],
188 ; SI: S_ENDPGM
189 ; EG-NOT: BFE
190 define void @bfe_i32_constant_fold_test_0(i32 addrspace(1)* %out) nounwind {
191   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 0, i32 0, i32 0) nounwind readnone
192   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
193   ret void
194 }
195
196 ; FUNC-LABEL: @bfe_i32_constant_fold_test_1
197 ; SI-NOT: BFE
198 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0
199 ; SI: BUFFER_STORE_DWORD [[VREG]],
200 ; SI: S_ENDPGM
201 ; EG-NOT: BFE
202 define void @bfe_i32_constant_fold_test_1(i32 addrspace(1)* %out) nounwind {
203   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 12334, i32 0, i32 0) nounwind readnone
204   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
205   ret void
206 }
207
208 ; FUNC-LABEL: @bfe_i32_constant_fold_test_2
209 ; SI-NOT: BFE
210 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0
211 ; SI: BUFFER_STORE_DWORD [[VREG]],
212 ; SI: S_ENDPGM
213 ; EG-NOT: BFE
214 define void @bfe_i32_constant_fold_test_2(i32 addrspace(1)* %out) nounwind {
215   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 0, i32 0, i32 1) nounwind readnone
216   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
217   ret void
218 }
219
220 ; FUNC-LABEL: @bfe_i32_constant_fold_test_3
221 ; SI-NOT: BFE
222 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], -1
223 ; SI: BUFFER_STORE_DWORD [[VREG]],
224 ; SI: S_ENDPGM
225 ; EG-NOT: BFE
226 define void @bfe_i32_constant_fold_test_3(i32 addrspace(1)* %out) nounwind {
227   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 1, i32 0, i32 1) nounwind readnone
228   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
229   ret void
230 }
231
232 ; FUNC-LABEL: @bfe_i32_constant_fold_test_4
233 ; SI-NOT: BFE
234 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], -1
235 ; SI: BUFFER_STORE_DWORD [[VREG]],
236 ; SI: S_ENDPGM
237 ; EG-NOT: BFE
238 define void @bfe_i32_constant_fold_test_4(i32 addrspace(1)* %out) nounwind {
239   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 4294967295, i32 0, i32 1) nounwind readnone
240   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
241   ret void
242 }
243
244 ; FUNC-LABEL: @bfe_i32_constant_fold_test_5
245 ; SI-NOT: BFE
246 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], -1
247 ; SI: BUFFER_STORE_DWORD [[VREG]],
248 ; SI: S_ENDPGM
249 ; EG-NOT: BFE
250 define void @bfe_i32_constant_fold_test_5(i32 addrspace(1)* %out) nounwind {
251   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 128, i32 7, i32 1) nounwind readnone
252   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
253   ret void
254 }
255
256 ; FUNC-LABEL: @bfe_i32_constant_fold_test_6
257 ; SI-NOT: BFE
258 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0xffffff80
259 ; SI: BUFFER_STORE_DWORD [[VREG]],
260 ; SI: S_ENDPGM
261 ; EG-NOT: BFE
262 define void @bfe_i32_constant_fold_test_6(i32 addrspace(1)* %out) nounwind {
263   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 128, i32 0, i32 8) nounwind readnone
264   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
265   ret void
266 }
267
268 ; FUNC-LABEL: @bfe_i32_constant_fold_test_7
269 ; SI-NOT: BFE
270 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0x7f
271 ; SI: BUFFER_STORE_DWORD [[VREG]],
272 ; SI: S_ENDPGM
273 ; EG-NOT: BFE
274 define void @bfe_i32_constant_fold_test_7(i32 addrspace(1)* %out) nounwind {
275   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 127, i32 0, i32 8) nounwind readnone
276   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
277   ret void
278 }
279
280 ; FUNC-LABEL: @bfe_i32_constant_fold_test_8
281 ; SI-NOT: BFE
282 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 1
283 ; SI: BUFFER_STORE_DWORD [[VREG]],
284 ; SI: S_ENDPGM
285 ; EG-NOT: BFE
286 define void @bfe_i32_constant_fold_test_8(i32 addrspace(1)* %out) nounwind {
287   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 127, i32 6, i32 8) nounwind readnone
288   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
289   ret void
290 }
291
292 ; FUNC-LABEL: @bfe_i32_constant_fold_test_9
293 ; SI-NOT: BFE
294 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 1
295 ; SI: BUFFER_STORE_DWORD [[VREG]],
296 ; SI: S_ENDPGM
297 ; EG-NOT: BFE
298 define void @bfe_i32_constant_fold_test_9(i32 addrspace(1)* %out) nounwind {
299   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 65536, i32 16, i32 8) nounwind readnone
300   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
301   ret void
302 }
303
304 ; FUNC-LABEL: @bfe_i32_constant_fold_test_10
305 ; SI-NOT: BFE
306 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0
307 ; SI: BUFFER_STORE_DWORD [[VREG]],
308 ; SI: S_ENDPGM
309 ; EG-NOT: BFE
310 define void @bfe_i32_constant_fold_test_10(i32 addrspace(1)* %out) nounwind {
311   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 65535, i32 16, i32 16) nounwind readnone
312   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
313   ret void
314 }
315
316 ; FUNC-LABEL: @bfe_i32_constant_fold_test_11
317 ; SI-NOT: BFE
318 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], -6
319 ; SI: BUFFER_STORE_DWORD [[VREG]],
320 ; SI: S_ENDPGM
321 ; EG-NOT: BFE
322 define void @bfe_i32_constant_fold_test_11(i32 addrspace(1)* %out) nounwind {
323   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 160, i32 4, i32 4) nounwind readnone
324   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
325   ret void
326 }
327
328 ; FUNC-LABEL: @bfe_i32_constant_fold_test_12
329 ; SI-NOT: BFE
330 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0
331 ; SI: BUFFER_STORE_DWORD [[VREG]],
332 ; SI: S_ENDPGM
333 ; EG-NOT: BFE
334 define void @bfe_i32_constant_fold_test_12(i32 addrspace(1)* %out) nounwind {
335   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 160, i32 31, i32 1) nounwind readnone
336   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
337   ret void
338 }
339
340 ; FUNC-LABEL: @bfe_i32_constant_fold_test_13
341 ; SI-NOT: BFE
342 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 1
343 ; SI: BUFFER_STORE_DWORD [[VREG]],
344 ; SI: S_ENDPGM
345 ; EG-NOT: BFE
346 define void @bfe_i32_constant_fold_test_13(i32 addrspace(1)* %out) nounwind {
347   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 131070, i32 16, i32 16) nounwind readnone
348   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
349   ret void
350 }
351
352 ; FUNC-LABEL: @bfe_i32_constant_fold_test_14
353 ; SI-NOT: BFE
354 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 40
355 ; SI: BUFFER_STORE_DWORD [[VREG]],
356 ; SI: S_ENDPGM
357 ; EG-NOT: BFE
358 define void @bfe_i32_constant_fold_test_14(i32 addrspace(1)* %out) nounwind {
359   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 160, i32 2, i32 30) nounwind readnone
360   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
361   ret void
362 }
363
364 ; FUNC-LABEL: @bfe_i32_constant_fold_test_15
365 ; SI-NOT: BFE
366 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 10
367 ; SI: BUFFER_STORE_DWORD [[VREG]],
368 ; SI: S_ENDPGM
369 ; EG-NOT: BFE
370 define void @bfe_i32_constant_fold_test_15(i32 addrspace(1)* %out) nounwind {
371   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 160, i32 4, i32 28) nounwind readnone
372   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
373   ret void
374 }
375
376 ; FUNC-LABEL: @bfe_i32_constant_fold_test_16
377 ; SI-NOT: BFE
378 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], -1
379 ; SI: BUFFER_STORE_DWORD [[VREG]],
380 ; SI: S_ENDPGM
381 ; EG-NOT: BFE
382 define void @bfe_i32_constant_fold_test_16(i32 addrspace(1)* %out) nounwind {
383   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 4294967295, i32 1, i32 7) nounwind readnone
384   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
385   ret void
386 }
387
388 ; FUNC-LABEL: @bfe_i32_constant_fold_test_17
389 ; SI-NOT: BFE
390 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0x7f
391 ; SI: BUFFER_STORE_DWORD [[VREG]],
392 ; SI: S_ENDPGM
393 ; EG-NOT: BFE
394 define void @bfe_i32_constant_fold_test_17(i32 addrspace(1)* %out) nounwind {
395   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 255, i32 1, i32 31) nounwind readnone
396   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
397   ret void
398 }
399
400 ; FUNC-LABEL: @bfe_i32_constant_fold_test_18
401 ; SI-NOT: BFE
402 ; SI: V_MOV_B32_e32 [[VREG:v[0-9]+]], 0
403 ; SI: BUFFER_STORE_DWORD [[VREG]],
404 ; SI: S_ENDPGM
405 ; EG-NOT: BFE
406 define void @bfe_i32_constant_fold_test_18(i32 addrspace(1)* %out) nounwind {
407   %bfe_i32 = call i32 @llvm.AMDGPU.bfe.i32(i32 255, i32 31, i32 1) nounwind readnone
408   store i32 %bfe_i32, i32 addrspace(1)* %out, align 4
409   ret void
410 }
411
412 ; XXX - This should really be a single BFE, but the sext_inreg of the
413 ; extended type i24 is never custom lowered.
414 ; FUNC-LABEL: @bfe_sext_in_reg_i24
415 ; SI: BUFFER_LOAD_DWORD [[LOAD:v[0-9]+]],
416 ; SI: V_LSHLREV_B32_e32 {{v[0-9]+}}, 8, {{v[0-9]+}}
417 ; SI: V_ASHRREV_I32_e32 {{v[0-9]+}}, 8, {{v[0-9]+}}
418 ; XSI: V_BFE_I32 [[BFE:v[0-9]+]], [[LOAD]], 0, 8
419 ; XSI-NOT: SHL
420 ; XSI-NOT: SHR
421 ; XSI: BUFFER_STORE_DWORD [[BFE]],
422 define void @bfe_sext_in_reg_i24(i32 addrspace(1)* %out, i32 addrspace(1)* %in) nounwind {
423   %x = load i32 addrspace(1)* %in, align 4
424   %bfe = call i32 @llvm.AMDGPU.bfe.i32(i32 %x, i32 0, i32 24)
425   %shl = shl i32 %bfe, 8
426   %ashr = ashr i32 %shl, 8
427   store i32 %ashr, i32 addrspace(1)* %out, align 4
428   ret void
429 }