Skip to content

Commit bd31c05

Browse files
committed
AMDGPU: Keep the test while we revert the patch
1 parent d755816 commit bd31c05

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

llvm/test/CodeGen/AMDGPU/extract-lowbits.ll

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,31 @@ define i32 @bzhi32_d0(i32 %val, i32 %numlowbits) nounwind {
171171
ret i32 %masked
172172
}
173173

174+
define i32 @bzhi32_d0_5bits(i32 %val, i32 %numlowbits) nounwind {
175+
; SI-LABEL: bzhi32_d0_5bits:
176+
; SI: ; %bb.0:
177+
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
178+
; SI-NEXT: v_and_b32_e32 v1, 31, v1
179+
; SI-NEXT: v_sub_i32_e32 v1, vcc, 32, v1
180+
; SI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
181+
; SI-NEXT: v_lshrrev_b32_e32 v0, v1, v0
182+
; SI-NEXT: s_setpc_b64 s[30:31]
183+
;
184+
; VI-LABEL: bzhi32_d0_5bits:
185+
; VI: ; %bb.0:
186+
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
187+
; VI-NEXT: v_and_b32_e32 v1, 31, v1
188+
; VI-NEXT: v_sub_u32_e32 v1, vcc, 32, v1
189+
; VI-NEXT: v_lshlrev_b32_e32 v0, v1, v0
190+
; VI-NEXT: v_lshrrev_b32_e32 v0, v1, v0
191+
; VI-NEXT: s_setpc_b64 s[30:31]
192+
%numlow5bits = and i32 %numlowbits, 31
193+
%numhighbits = sub i32 32, %numlow5bits
194+
%highbitscleared = shl i32 %val, %numhighbits
195+
%masked = lshr i32 %highbitscleared, %numhighbits
196+
ret i32 %masked
197+
}
198+
174199
define i32 @bzhi32_d1_indexzext(i32 %val, i8 %numlowbits) nounwind {
175200
; SI-LABEL: bzhi32_d1_indexzext:
176201
; SI: ; %bb.0:

0 commit comments

Comments
 (0)