diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2019-02-12 01:46:26 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2019-02-12 01:46:26 +0000 |
| commit | 14fb86310f98fd43c548d676c0e6538ee0b4a703 (patch) | |
| tree | 9e4453f61b83eb0b1b1e8b08500137f772dc5f64 /llvm/test | |
| parent | 26eec703f7a2324a5ec90eb1476f15ce1e402a0c (diff) | |
| download | bcm5719-llvm-14fb86310f98fd43c548d676c0e6538ee0b4a703.tar.gz bcm5719-llvm-14fb86310f98fd43c548d676c0e6538ee0b4a703.zip | |
[PowerPC] add tests for logic of setcc (PR40611); NFC
llvm-svn: 353788
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/PowerPC/setcc-logic.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/setcc-logic.ll b/llvm/test/CodeGen/PowerPC/setcc-logic.ll index e883531d009..b0a44ad6b5b 100644 --- a/llvm/test/CodeGen/PowerPC/setcc-logic.ll +++ b/llvm/test/CodeGen/PowerPC/setcc-logic.ll @@ -478,3 +478,33 @@ define <4 x i1> @and_eq_vec(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, <4 x i32> 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 +} + |

