[llvm] r353788 - [PowerPC] add tests for logic of setcc (PR40611); NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 11 17:46:26 PST 2019
Author: spatel
Date: Mon Feb 11 17:46:26 2019
New Revision: 353788
URL: http://llvm.org/viewvc/llvm-project?rev=353788&view=rev
Log:
[PowerPC] add tests for logic of setcc (PR40611); NFC
Modified:
llvm/trunk/test/CodeGen/PowerPC/setcc-logic.ll
Modified: llvm/trunk/test/CodeGen/PowerPC/setcc-logic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/setcc-logic.ll?rev=353788&r1=353787&r2=353788&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/setcc-logic.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/setcc-logic.ll Mon Feb 11 17:46:26 2019
@@ -478,3 +478,33 @@ define <4 x i1> @and_eq_vec(<4 x i32> %a
ret <4 x i1> %and
}
+define i1 @or_icmps_const_1bit_diff(i64 %x) {
+; CHECK-LABEL: or_icmps_const_1bit_diff:
+; CHECK: # %bb.0:
+; CHECK-NEXT: cmpdi 3, 17
+; CHECK-NEXT: cmpdi 1, 3, 13
+; CHECK-NEXT: li 3, 1
+; CHECK-NEXT: crnor 20, 2, 6
+; CHECK-NEXT: isel 3, 0, 3, 20
+; CHECK-NEXT: blr
+ %a = icmp eq i64 %x, 17
+ %b = icmp eq i64 %x, 13
+ %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: cmpwi 3, 4625
+; CHECK-NEXT: cmpwi 1, 3, 4641
+; CHECK-NEXT: li 3, 1
+; CHECK-NEXT: cror 20, 6, 2
+; CHECK-NEXT: isel 3, 0, 3, 20
+; CHECK-NEXT: blr
+ %a = icmp ne i32 %x, 4625
+ %b = icmp ne i32 %x, 4641
+ %r = and i1 %a, %b
+ ret i1 %r
+}
+
More information about the llvm-commits
mailing list