summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/AArch64/signbit-shift.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/CodeGen/AArch64/signbit-shift.ll')
-rw-r--r--llvm/test/CodeGen/AArch64/signbit-shift.ll23
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
+}
+
OpenPOWER on IntegriCloud