[llvm] r353789 - [x86] add tests for logic of setcc (PR40611); NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 11 17:46:30 PST 2019
Author: spatel
Date: Mon Feb 11 17:46:30 2019
New Revision: 353789
URL: http://llvm.org/viewvc/llvm-project?rev=353789&view=rev
Log:
[x86] add tests for logic of setcc (PR40611); NFC
Modified:
llvm/trunk/test/CodeGen/X86/setcc-logic.ll
Modified: llvm/trunk/test/CodeGen/X86/setcc-logic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/setcc-logic.ll?rev=353789&r1=353788&r2=353789&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/setcc-logic.ll (original)
+++ llvm/trunk/test/CodeGen/X86/setcc-logic.ll Mon Feb 11 17:46:30 2019
@@ -482,3 +482,33 @@ define <4 x i1> @and_eq_vec(<4 x i32> %a
ret <4 x i1> %and
}
+define i1 @or_icmps_const_1bit_diff(i8 %x) {
+; CHECK-LABEL: or_icmps_const_1bit_diff:
+; CHECK: # %bb.0:
+; CHECK-NEXT: cmpb $43, %dil
+; CHECK-NEXT: sete %cl
+; CHECK-NEXT: cmpb $45, %dil
+; CHECK-NEXT: sete %al
+; CHECK-NEXT: orb %cl, %al
+; CHECK-NEXT: retq
+ %a = icmp eq i8 %x, 43
+ %b = icmp eq i8 %x, 45
+ %r = or i1 %a, %b
+ ret i1 %r
+}
+
+define i1 @and_icmps_const_1bit_diff(i32 %x) {
+; CHECK-LABEL: and_icmps_const_1bit_diff:
+; CHECK: # %bb.0:
+; CHECK-NEXT: cmpl $44, %edi
+; CHECK-NEXT: setne %cl
+; CHECK-NEXT: cmpl $60, %edi
+; CHECK-NEXT: setne %al
+; CHECK-NEXT: andb %cl, %al
+; CHECK-NEXT: retq
+ %a = icmp ne i32 %x, 44
+ %b = icmp ne i32 %x, 60
+ %r = and i1 %a, %b
+ ret i1 %r
+}
+
More information about the llvm-commits
mailing list