summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2018-06-06 10:52:10 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2018-06-06 10:52:10 +0000
commit3d1415889103642e9c6cc943345d36ac53886337 (patch)
tree5319697ab7f46666303b34d4a97f352cbeb22f41 /llvm/test/CodeGen
parent1b8bfd7e7d63704eb665922d331c7317ae8b1786 (diff)
downloadbcm5719-llvm-3d1415889103642e9c6cc943345d36ac53886337.tar.gz
bcm5719-llvm-3d1415889103642e9c6cc943345d36ac53886337.zip
[X86][BMI][TBM] Only demand bottom 16-bits of the BEXTR control op (PR34042)
Only the bottom 16-bits of BEXTR's control op are required (0:8 INDEX, 15:8 LENGTH). Differential Revision: https://reviews.llvm.org/D47690 llvm-svn: 334083
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/bmi-x86_64.ll4
-rw-r--r--llvm/test/CodeGen/X86/bmi.ll3
-rw-r--r--llvm/test/CodeGen/X86/tbm-intrinsics-x86_64.ll10
3 files changed, 13 insertions, 4 deletions
diff --git a/llvm/test/CodeGen/X86/bmi-x86_64.ll b/llvm/test/CodeGen/X86/bmi-x86_64.ll
index 5a733ca3cf0..970dafdde4b 100644
--- a/llvm/test/CodeGen/X86/bmi-x86_64.ll
+++ b/llvm/test/CodeGen/X86/bmi-x86_64.ll
@@ -52,8 +52,8 @@ define i64 @bextr64b_load(i64* %x) {
define i64 @bextr64c(i64 %x, i32 %y) {
; CHECK-LABEL: bextr64c:
; CHECK: # %bb.0:
-; CHECK-NEXT: movslq %esi, %rax
-; CHECK-NEXT: bextrq %rax, %rdi, %rax
+; CHECK-NEXT: # kill: def $esi killed $esi def $rsi
+; CHECK-NEXT: bextrq %rsi, %rdi, %rax
; CHECK-NEXT: retq
%tmp0 = sext i32 %y to i64
%tmp1 = tail call i64 @llvm.x86.bmi.bextr.64(i64 %x, i64 %tmp0)
diff --git a/llvm/test/CodeGen/X86/bmi.ll b/llvm/test/CodeGen/X86/bmi.ll
index 40e4c66959b..5ec2da420c4 100644
--- a/llvm/test/CodeGen/X86/bmi.ll
+++ b/llvm/test/CodeGen/X86/bmi.ll
@@ -404,8 +404,7 @@ define i32 @bextr32c(i32 %x, i16 zeroext %y) {
;
; X64-LABEL: bextr32c:
; X64: # %bb.0:
-; X64-NEXT: movswl %si, %eax
-; X64-NEXT: bextrl %eax, %edi, %eax
+; X64-NEXT: bextrl %esi, %edi, %eax
; X64-NEXT: retq
%tmp0 = sext i16 %y to i32
%tmp1 = tail call i32 @llvm.x86.bmi.bextr.32(i32 %x, i32 %tmp0)
diff --git a/llvm/test/CodeGen/X86/tbm-intrinsics-x86_64.ll b/llvm/test/CodeGen/X86/tbm-intrinsics-x86_64.ll
index 0f4b7ce6c93..98ee8f07c00 100644
--- a/llvm/test/CodeGen/X86/tbm-intrinsics-x86_64.ll
+++ b/llvm/test/CodeGen/X86/tbm-intrinsics-x86_64.ll
@@ -24,6 +24,16 @@ entry:
ret i64 %0
}
+define i64 @test_x86_tbm_bextri_u64_bigint(i64 %a) nounwind readnone {
+; CHECK-LABEL: test_x86_tbm_bextri_u64_bigint:
+; CHECK: # %bb.0: # %entry
+; CHECK-NEXT: bextrq $65535, %rdi, %rax # imm = 0xFFFF
+; CHECK-NEXT: retq
+entry:
+ %0 = tail call i64 @llvm.x86.tbm.bextri.u64(i64 %a, i64 549755813887)
+ ret i64 %0
+}
+
define i64 @test_x86_tbm_bextri_u64_z(i64 %a, i64 %b) nounwind readnone {
; CHECK-LABEL: test_x86_tbm_bextri_u64_z:
; CHECK: # %bb.0: # %entry
OpenPOWER on IntegriCloud