summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/bmi.ll
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-04-09 16:02:52 +0000
committerSanjay Patel <spatel@rotateright.com>2016-04-09 16:02:52 +0000
commit4abae4e0faea4930ca7d941358ba535835cba1c0 (patch)
tree317f10654af1f78a2ed4f32fdcce4b4a54156fac /llvm/test/CodeGen/X86/bmi.ll
parent1cc5712763e6af3aa1f181680a9359280e6adc14 (diff)
downloadbcm5719-llvm-4abae4e0faea4930ca7d941358ba535835cba1c0.tar.gz
bcm5719-llvm-4abae4e0faea4930ca7d941358ba535835cba1c0.zip
[x86] use BMI 'andn' for logic + compare ops
With BMI, we can use 'andn' to save an instruction when the result is only used in a compare. This is related to one of the potential sequences to check 'isfinite' in: https://llvm.org/bugs/show_bug.cgi?id=27164 Differential Revision: http://reviews.llvm.org/D18910 llvm-svn: 265875
Diffstat (limited to 'llvm/test/CodeGen/X86/bmi.ll')
-rw-r--r--llvm/test/CodeGen/X86/bmi.ll10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/test/CodeGen/X86/bmi.ll b/llvm/test/CodeGen/X86/bmi.ll
index c4b9951f57a..0be3e56e663 100644
--- a/llvm/test/CodeGen/X86/bmi.ll
+++ b/llvm/test/CodeGen/X86/bmi.ll
@@ -136,12 +136,11 @@ define i64 @andn64(i64 %x, i64 %y) {
ret i64 %tmp2
}
-; FIXME: Don't choose a 'test' if an 'andn' can be used.
+; Don't choose a 'test' if an 'andn' can be used.
define i1 @andn_cmp(i32 %x, i32 %y) {
; CHECK-LABEL: andn_cmp:
; CHECK: # BB#0:
-; CHECK-NEXT: notl %edi
-; CHECK-NEXT: testl %esi, %edi
+; CHECK-NEXT: andnl %esi, %edi, %eax
; CHECK-NEXT: sete %al
; CHECK-NEXT: retq
;
@@ -151,12 +150,11 @@ define i1 @andn_cmp(i32 %x, i32 %y) {
ret i1 %cmp
}
-; FIXME: Don't choose a 'test' if an 'andn' can be used.
+; Don't choose a 'test' if an 'andn' can be used.
define i1 @andn_cmp_swap_ops(i64 %x, i64 %y) {
; CHECK-LABEL: andn_cmp_swap_ops:
; CHECK: # BB#0:
-; CHECK-NEXT: notq %rdi
-; CHECK-NEXT: testq %rdi, %rsi
+; CHECK-NEXT: andnq %rsi, %rdi, %rax
; CHECK-NEXT: sete %al
; CHECK-NEXT: retq
;
OpenPOWER on IntegriCloud