[llvm] r310802 - [X86][BMI] Add BEXTR demanded bits test cases (PR34042)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 13 13:35:38 PDT 2017
Author: rksimon
Date: Sun Aug 13 13:35:38 2017
New Revision: 310802
URL: http://llvm.org/viewvc/llvm-project?rev=310802&view=rev
Log:
[X86][BMI] Add BEXTR demanded bits test cases (PR34042)
Modified:
llvm/trunk/test/CodeGen/X86/bmi.ll
Modified: llvm/trunk/test/CodeGen/X86/bmi.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/bmi.ll?rev=310802&r1=310801&r2=310802&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/bmi.ll (original)
+++ llvm/trunk/test/CodeGen/X86/bmi.ll Sun Aug 13 13:35:38 2017
@@ -323,6 +323,18 @@ define i32 @bextr32b_load(i32* %x) uwta
ret i32 %3
}
+; PR34042
+define i32 @bextr32c(i32 %x, i16 zeroext %y) {
+; CHECK-LABEL: bextr32c:
+; CHECK: # BB#0:
+; CHECK-NEXT: movswl %si, %eax
+; CHECK-NEXT: bextrl %eax, %edi, %eax
+; CHECK-NEXT: retq
+ %tmp0 = sext i16 %y to i32
+ %tmp1 = tail call i32 @llvm.x86.bmi.bextr.32(i32 %x, i32 %tmp0)
+ ret i32 %tmp1
+}
+
define i64 @bextr64(i64 %x, i64 %y) {
; CHECK-LABEL: bextr64:
; CHECK: # BB#0:
@@ -357,6 +369,18 @@ define i64 @bextr64b_load(i64* %x) {
ret i64 %3
}
+; PR34042
+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: retq
+ %tmp0 = sext i32 %y to i64
+ %tmp1 = tail call i64 @llvm.x86.bmi.bextr.64(i64 %x, i64 %tmp0)
+ ret i64 %tmp1
+}
+
define i32 @non_bextr32(i32 %x) {
; CHECK-LABEL: non_bextr32:
; CHECK: # BB#0: # %entry
More information about the llvm-commits
mailing list