summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-10-21 19:57:55 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-10-21 19:57:55 +0000
commite9bd49824d471b79fd54ae014a998ba3996f9640 (patch)
tree9d2ad70e73f639bef709df6a7cd09b38f7754716 /llvm/test/CodeGen/X86
parentab488723134a42e85211d67a591537f2f2ad0ca0 (diff)
downloadbcm5719-llvm-e9bd49824d471b79fd54ae014a998ba3996f9640.tar.gz
bcm5719-llvm-e9bd49824d471b79fd54ae014a998ba3996f9640.zip
X86: Improve BT instruction selection for 64-bit values.
If a 64-bit value is tested against a bit which is known to be in the range [0..31) (modulo 64), we can use the 32-bit BT instruction, which has a slightly shorter encoding. Differential Revision: https://reviews.llvm.org/D25862 llvm-svn: 284864
Diffstat (limited to 'llvm/test/CodeGen/X86')
-rw-r--r--llvm/test/CodeGen/X86/bt.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/bt.ll b/llvm/test/CodeGen/X86/bt.ll
index a6705088745..6576f33a5b9 100644
--- a/llvm/test/CodeGen/X86/bt.ll
+++ b/llvm/test/CodeGen/X86/bt.ll
@@ -596,3 +596,15 @@ define zeroext i1 @invert(i32 %flags, i32 %flag) nounwind {
ret i1 %tobool
}
+define zeroext i1 @extend(i32 %bit, i64 %bits) {
+; CHECK-LABEL: extend:
+; CHECK: # BB#0:
+; CHECK-NEXT: btl %edi, %esi
+entry:
+ %and = and i32 %bit, 31
+ %sh_prom = zext i32 %and to i64
+ %shl = shl i64 1, %sh_prom
+ %and1 = and i64 %shl, %bits
+ %tobool = icmp ne i64 %and1, 0
+ ret i1 %tobool
+}
OpenPOWER on IntegriCloud