aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/X86/bmi.ll
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2011-10-21 06:55:01 +0000
committerCraig Topper <craig.topper@gmail.com>2011-10-21 06:55:01 +0000
commitb4c945716f232ee07ec6fd3e1146175801fa1278 (patch)
tree806338b8341599b932b4d4ba3fa110f4fe7af897 /test/CodeGen/X86/bmi.ll
parentdb35087d21f09fdde81cab7e12fc0bcd8b7d00e9 (diff)
downloadexternal_llvm-b4c945716f232ee07ec6fd3e1146175801fa1278.zip
external_llvm-b4c945716f232ee07ec6fd3e1146175801fa1278.tar.gz
external_llvm-b4c945716f232ee07ec6fd3e1146175801fa1278.tar.bz2
Remove intrinsics for X86 BLSI, BLSMSK, and BLSR intrinsics and replace with custom isel lowering code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/bmi.ll')
-rw-r--r--test/CodeGen/X86/bmi.ll42
1 files changed, 18 insertions, 24 deletions
diff --git a/test/CodeGen/X86/bmi.ll b/test/CodeGen/X86/bmi.ll
index 4b40d90..69cf736 100644
--- a/test/CodeGen/X86/bmi.ll
+++ b/test/CodeGen/X86/bmi.ll
@@ -89,59 +89,53 @@ define i64 @bzhi64(i64 %x, i64 %y) nounwind readnone {
declare i64 @llvm.x86.bmi.bzhi.64(i64, i64) nounwind readnone
define i32 @blsi32(i32 %x) nounwind readnone {
- %tmp = tail call i32 @llvm.x86.bmi.blsi.32(i32 %x)
- ret i32 %tmp
+ %tmp = sub i32 0, %x
+ %tmp2 = and i32 %x, %tmp
+ ret i32 %tmp2
; CHECK: blsi32:
; CHECK: blsil
}
-declare i32 @llvm.x86.bmi.blsi.32(i32) nounwind readnone
-
define i64 @blsi64(i64 %x) nounwind readnone {
- %tmp = tail call i64 @llvm.x86.bmi.blsi.64(i64 %x)
- ret i64 %tmp
+ %tmp = sub i64 0, %x
+ %tmp2 = and i64 %tmp, %x
+ ret i64 %tmp2
; CHECK: blsi64:
; CHECK: blsiq
}
-declare i64 @llvm.x86.bmi.blsi.64(i64) nounwind readnone
-
define i32 @blsmsk32(i32 %x) nounwind readnone {
- %tmp = tail call i32 @llvm.x86.bmi.blsmsk.32(i32 %x)
- ret i32 %tmp
+ %tmp = sub i32 %x, 1
+ %tmp2 = xor i32 %x, %tmp
+ ret i32 %tmp2
; CHECK: blsmsk32:
; CHECK: blsmskl
}
-declare i32 @llvm.x86.bmi.blsmsk.32(i32) nounwind readnone
-
define i64 @blsmsk64(i64 %x) nounwind readnone {
- %tmp = tail call i64 @llvm.x86.bmi.blsmsk.64(i64 %x)
- ret i64 %tmp
+ %tmp = sub i64 %x, 1
+ %tmp2 = xor i64 %tmp, %x
+ ret i64 %tmp2
; CHECK: blsmsk64:
; CHECK: blsmskq
}
-declare i64 @llvm.x86.bmi.blsmsk.64(i64) nounwind readnone
-
define i32 @blsr32(i32 %x) nounwind readnone {
- %tmp = tail call i32 @llvm.x86.bmi.blsr.32(i32 %x)
- ret i32 %tmp
+ %tmp = sub i32 %x, 1
+ %tmp2 = and i32 %x, %tmp
+ ret i32 %tmp2
; CHECK: blsr32:
; CHECK: blsrl
}
-declare i32 @llvm.x86.bmi.blsr.32(i32) nounwind readnone
-
define i64 @blsr64(i64 %x) nounwind readnone {
- %tmp = tail call i64 @llvm.x86.bmi.blsr.64(i64 %x)
- ret i64 %tmp
+ %tmp = sub i64 %x, 1
+ %tmp2 = and i64 %tmp, %x
+ ret i64 %tmp2
; CHECK: blsr64:
; CHECK: blsrq
}
-declare i64 @llvm.x86.bmi.blsr.64(i64) nounwind readnone
-
define i32 @pdep32(i32 %x, i32 %y) nounwind readnone {
%tmp = tail call i32 @llvm.x86.bmi.pdep.32(i32 %x, i32 %y)
ret i32 %tmp