Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit 887eb8d

Browse files
committed
[x86] add tests to show miscompile for funnel shift with weird size; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338587 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent a2d22f7 commit 887eb8d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/CodeGen/X86/funnel-shift-rot.ll

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,3 +385,32 @@ define <4 x i32> @rotr_v4i32_shift_by_bitwidth(<4 x i32> %x) nounwind {
385385
ret <4 x i32> %f
386386
}
387387

388+
; FIXME: Non power-of-2 types can't use the negated shift amount to avoid a select.
389+
390+
declare i7 @llvm.fshl.i7(i7, i7, i7)
391+
declare i7 @llvm.fshr.i7(i7, i7, i7)
392+
393+
; extract(concat(0b1110000, 0b1110000) << 9) = 0b1000011
394+
; Try an oversized shift to test modulo functionality.
395+
396+
define i7 @fshl_i7() {
397+
; ANY-LABEL: fshl_i7:
398+
; ANY: # %bb.0:
399+
; ANY-NEXT: movb $112, %al
400+
; ANY-NEXT: ret{{[l|q]}}
401+
%f = call i7 @llvm.fshl.i7(i7 112, i7 112, i7 9)
402+
ret i7 %f
403+
}
404+
405+
; extract(concat(0b1110001, 0b1110001) >> 16) = 0b0111100
406+
; Try an oversized shift to test modulo functionality.
407+
408+
define i7 @fshr_i7() {
409+
; ANY-LABEL: fshr_i7:
410+
; ANY: # %bb.0:
411+
; ANY-NEXT: movb $125, %al
412+
; ANY-NEXT: ret{{[l|q]}}
413+
%f = call i7 @llvm.fshr.i7(i7 113, i7 113, i7 16)
414+
ret i7 %f
415+
}
416+

0 commit comments

Comments
 (0)