summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/bmi.ll
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-04-22 07:40:34 +0000
committerLang Hames <lhames@gmail.com>2014-04-22 07:40:34 +0000
commitf6f42cac3fa294aba6225c749165486bf6142135 (patch)
tree96f6138b95d6da7d9165c8b23b4019a3b17ed365 /llvm/test/CodeGen/X86/bmi.ll
parentafd2c6be0e90b6e069d768b6a65668186985b5e8 (diff)
downloadbcm5719-llvm-f6f42cac3fa294aba6225c749165486bf6142135.tar.gz
bcm5719-llvm-f6f42cac3fa294aba6225c749165486bf6142135.zip
[X86] Don't use BZHI for short masks (>=32 bits). Thanks to Ben Kramer for the
review. llvm-svn: 206869
Diffstat (limited to 'llvm/test/CodeGen/X86/bmi.ll')
-rw-r--r--llvm/test/CodeGen/X86/bmi.ll19
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/test/CodeGen/X86/bmi.ll b/llvm/test/CodeGen/X86/bmi.ll
index c04fe9b5cfa..a70720926de 100644
--- a/llvm/test/CodeGen/X86/bmi.ll
+++ b/llvm/test/CodeGen/X86/bmi.ll
@@ -216,22 +216,21 @@ entry:
; CHECK: bzhiq
}
-define i32 @bzhi32_constant_mask(i32 %x) #0 {
-entry:
- %and = and i32 %x, 1073741823
- ret i32 %and
-; CHECK-LABEL: bzhi32_constant_mask:
-; CHECK: movb $30, %al
-; CHECK: bzhil %eax, %e[[ARG1:di|cx]], %eax
-}
-
define i64 @bzhi64_constant_mask(i64 %x) #0 {
entry:
%and = and i64 %x, 4611686018427387903
ret i64 %and
; CHECK-LABEL: bzhi64_constant_mask:
; CHECK: movb $62, %al
-; CHECK: bzhiq %rax, %r[[ARG1]], %rax
+; CHECK: bzhiq %rax, %r[[ARG1:di|cx]], %rax
+}
+
+define i64 @bzhi64_small_constant_mask(i64 %x) #0 {
+entry:
+ %and = and i64 %x, 2147483647
+ ret i64 %and
+; CHECK-LABEL: bzhi64_small_constant_mask:
+; CHECK: andq $2147483647, %r[[ARG1]]
}
define i32 @blsi32(i32 %x) nounwind readnone {
OpenPOWER on IntegriCloud