diff options
author | Sanjay Patel <spatel@rotateright.com> | 2018-07-27 18:12:29 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2018-07-27 18:12:29 +0000 |
commit | efac39eef679e3336c4952cfb484cb80b7f60cc0 (patch) | |
tree | 0988338845f19b1ac078c50dbf643c1df0370067 /llvm/test/CodeGen/AArch64/signbit-shift.ll | |
parent | 032a0b9f373b59f3cda2ad9985071a659ab2191f (diff) | |
download | bcm5719-llvm-efac39eef679e3336c4952cfb484cb80b7f60cc0.tar.gz bcm5719-llvm-efac39eef679e3336c4952cfb484cb80b7f60cc0.zip |
[AArch64, PowerPC, x86] add more signbit math tests; NFC
llvm-svn: 338143
Diffstat (limited to 'llvm/test/CodeGen/AArch64/signbit-shift.ll')
-rw-r--r-- | llvm/test/CodeGen/AArch64/signbit-shift.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/signbit-shift.ll b/llvm/test/CodeGen/AArch64/signbit-shift.ll index 521a0b8c149..c2f62c24026 100644 --- a/llvm/test/CodeGen/AArch64/signbit-shift.ll +++ b/llvm/test/CodeGen/AArch64/signbit-shift.ll @@ -222,3 +222,26 @@ define <4 x i32> @sub_lshr_not_vec_splat(<4 x i32> %x) { ret <4 x i32> %r } +define i32 @sub_lshr(i32 %x) { +; CHECK-LABEL: sub_lshr: +; CHECK: // %bb.0: +; CHECK-NEXT: mov w8, #43 +; CHECK-NEXT: sub w0, w8, w0, lsr #31 +; CHECK-NEXT: ret + %sh = lshr i32 %x, 31 + %r = sub i32 43, %sh + ret i32 %r +} + +define <4 x i32> @sub_lshr_vec_splat(<4 x i32> %x) { +; CHECK-LABEL: sub_lshr_vec_splat: +; CHECK: // %bb.0: +; CHECK-NEXT: ushr v0.4s, v0.4s, #31 +; CHECK-NEXT: movi v1.4s, #42 +; CHECK-NEXT: sub v0.4s, v1.4s, v0.4s +; CHECK-NEXT: ret + %e = lshr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31> + %r = sub <4 x i32> <i32 42, i32 42, i32 42, i32 42>, %e + ret <4 x i32> %r +} + |