summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/extract-bits.ll78
-rw-r--r--llvm/test/CodeGen/X86/tbm_patterns.ll6
2 files changed, 66 insertions, 18 deletions
diff --git a/llvm/test/CodeGen/X86/extract-bits.ll b/llvm/test/CodeGen/X86/extract-bits.ll
index b16aeb3d350..06f316b14d0 100644
--- a/llvm/test/CodeGen/X86/extract-bits.ll
+++ b/llvm/test/CodeGen/X86/extract-bits.ll
@@ -5568,23 +5568,69 @@ define i64 @bextr64_d5_skipextrauses(i64 %val, i64 %numskipbits, i64 %numlowbits
; https://bugs.llvm.org/show_bug.cgi?id=38938
define void @pr38938(i32* %a0, i64* %a1) {
-; X86-LABEL: pr38938:
-; X86: # %bb.0:
-; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
-; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
-; X86-NEXT: movl (%ecx), %ecx
-; X86-NEXT: shrl $19, %ecx
-; X86-NEXT: andl $4092, %ecx # imm = 0xFFC
-; X86-NEXT: incl (%eax,%ecx)
-; X86-NEXT: retl
+; X86-NOBMI-LABEL: pr38938:
+; X86-NOBMI: # %bb.0:
+; X86-NOBMI-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-NOBMI-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-NOBMI-NEXT: movl (%ecx), %ecx
+; X86-NOBMI-NEXT: shrl $19, %ecx
+; X86-NOBMI-NEXT: andl $4092, %ecx # imm = 0xFFC
+; X86-NOBMI-NEXT: incl (%eax,%ecx)
+; X86-NOBMI-NEXT: retl
;
-; X64-LABEL: pr38938:
-; X64: # %bb.0:
-; X64-NEXT: movq (%rsi), %rax
-; X64-NEXT: shrq $19, %rax
-; X64-NEXT: andl $4092, %eax # imm = 0xFFC
-; X64-NEXT: incl (%rdi,%rax)
-; X64-NEXT: retq
+; X86-BMI1NOTBM-LABEL: pr38938:
+; X86-BMI1NOTBM: # %bb.0:
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BMI1NOTBM-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBM-NEXT: movl $2581, %edx # imm = 0xA15
+; X86-BMI1NOTBM-NEXT: bextrl %edx, (%ecx), %ecx
+; X86-BMI1NOTBM-NEXT: incl (%eax,%ecx,4)
+; X86-BMI1NOTBM-NEXT: retl
+;
+; X86-BMI1TBM-LABEL: pr38938:
+; X86-BMI1TBM: # %bb.0:
+; X86-BMI1TBM-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BMI1TBM-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1TBM-NEXT: bextrl $2581, (%ecx), %ecx # imm = 0xA15
+; X86-BMI1TBM-NEXT: incl (%eax,%ecx,4)
+; X86-BMI1TBM-NEXT: retl
+;
+; X86-BMI1NOTBMBMI2-LABEL: pr38938:
+; X86-BMI1NOTBMBMI2: # %bb.0:
+; X86-BMI1NOTBMBMI2-NEXT: movl {{[0-9]+}}(%esp), %eax
+; X86-BMI1NOTBMBMI2-NEXT: movl {{[0-9]+}}(%esp), %ecx
+; X86-BMI1NOTBMBMI2-NEXT: movl $2581, %edx # imm = 0xA15
+; X86-BMI1NOTBMBMI2-NEXT: bextrl %edx, (%ecx), %ecx
+; X86-BMI1NOTBMBMI2-NEXT: incl (%eax,%ecx,4)
+; X86-BMI1NOTBMBMI2-NEXT: retl
+;
+; X64-NOBMI-LABEL: pr38938:
+; X64-NOBMI: # %bb.0:
+; X64-NOBMI-NEXT: movq (%rsi), %rax
+; X64-NOBMI-NEXT: shrq $19, %rax
+; X64-NOBMI-NEXT: andl $4092, %eax # imm = 0xFFC
+; X64-NOBMI-NEXT: incl (%rdi,%rax)
+; X64-NOBMI-NEXT: retq
+;
+; X64-BMI1NOTBM-LABEL: pr38938:
+; X64-BMI1NOTBM: # %bb.0:
+; X64-BMI1NOTBM-NEXT: movl $2581, %eax # imm = 0xA15
+; X64-BMI1NOTBM-NEXT: bextrq %rax, (%rsi), %rax
+; X64-BMI1NOTBM-NEXT: incl (%rdi,%rax,4)
+; X64-BMI1NOTBM-NEXT: retq
+;
+; X64-BMI1TBM-LABEL: pr38938:
+; X64-BMI1TBM: # %bb.0:
+; X64-BMI1TBM-NEXT: bextrq $2581, (%rsi), %rax # imm = 0xA15
+; X64-BMI1TBM-NEXT: incl (%rdi,%rax,4)
+; X64-BMI1TBM-NEXT: retq
+;
+; X64-BMI1NOTBMBMI2-LABEL: pr38938:
+; X64-BMI1NOTBMBMI2: # %bb.0:
+; X64-BMI1NOTBMBMI2-NEXT: movl $2581, %eax # imm = 0xA15
+; X64-BMI1NOTBMBMI2-NEXT: bextrq %rax, (%rsi), %rax
+; X64-BMI1NOTBMBMI2-NEXT: incl (%rdi,%rax,4)
+; X64-BMI1NOTBMBMI2-NEXT: retq
%tmp = load i64, i64* %a1, align 8
%tmp1 = lshr i64 %tmp, 21
%tmp2 = and i64 %tmp1, 1023
diff --git a/llvm/test/CodeGen/X86/tbm_patterns.ll b/llvm/test/CodeGen/X86/tbm_patterns.ll
index 2b335ea4268..6865cc5a0ef 100644
--- a/llvm/test/CodeGen/X86/tbm_patterns.ll
+++ b/llvm/test/CodeGen/X86/tbm_patterns.ll
@@ -53,7 +53,8 @@ define i32 @test_x86_tbm_bextri_u32_z2(i32 %a, i32 %b, i32 %c) nounwind {
; CHECK-LABEL: test_x86_tbm_bextri_u32_z2:
; CHECK: # %bb.0:
; CHECK-NEXT: movl %esi, %eax
-; CHECK-NEXT: bextrl $3076, %edi, %ecx # imm = 0xC04
+; CHECK-NEXT: shrl $4, %edi
+; CHECK-NEXT: testl $4095, %edi # imm = 0xFFF
; CHECK-NEXT: cmovnel %edx, %eax
; CHECK-NEXT: retq
%t0 = lshr i32 %a, 4
@@ -113,7 +114,8 @@ define i64 @test_x86_tbm_bextri_u64_z2(i64 %a, i64 %b, i64 %c) nounwind {
; CHECK-LABEL: test_x86_tbm_bextri_u64_z2:
; CHECK: # %bb.0:
; CHECK-NEXT: movq %rsi, %rax
-; CHECK-NEXT: bextrl $3076, %edi, %ecx # imm = 0xC04
+; CHECK-NEXT: shrl $4, %edi
+; CHECK-NEXT: testl $4095, %edi # imm = 0xFFF
; CHECK-NEXT: cmovneq %rdx, %rax
; CHECK-NEXT: retq
%t0 = lshr i64 %a, 4
OpenPOWER on IntegriCloud