diff options
author | Chad Rosier <mcrosier@codeaurora.org> | 2013-10-15 21:18:44 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@codeaurora.org> | 2013-10-15 21:18:44 +0000 |
commit | 1824bd0ef84bd162065f9d1fad4c325a39736248 (patch) | |
tree | 4047d24f8d091142f41d2fc704e75b2ed52900b5 /test/CodeGen/AArch64/neon-scalar-abs.ll | |
parent | ab950f5f334d30a7b5bfb1e009846dfb0b47f61c (diff) | |
download | external_llvm-1824bd0ef84bd162065f9d1fad4c325a39736248.zip external_llvm-1824bd0ef84bd162065f9d1fad4c325a39736248.tar.gz external_llvm-1824bd0ef84bd162065f9d1fad4c325a39736248.tar.bz2 |
[AArch64] Add support for NEON scalar signed saturating absolute value and
scalar signed saturating negate instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192733 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/AArch64/neon-scalar-abs.ll')
-rw-r--r-- | test/CodeGen/AArch64/neon-scalar-abs.ll | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/CodeGen/AArch64/neon-scalar-abs.ll b/test/CodeGen/AArch64/neon-scalar-abs.ll new file mode 100644 index 0000000..7a1c73a --- /dev/null +++ b/test/CodeGen/AArch64/neon-scalar-abs.ll @@ -0,0 +1,49 @@ +; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s + +define i8 @test_vqabsb_s8(i8 %a) { +; CHECK: test_vqabsb_s8 +; CHECK: sqabs {{b[0-9]+}}, {{b[0-9]+}} +entry: + %vqabs.i = insertelement <1 x i8> undef, i8 %a, i32 0 + %vqabs1.i = call <1 x i8> @llvm.arm.neon.vqabs.v1i8(<1 x i8> %vqabs.i) + %0 = extractelement <1 x i8> %vqabs1.i, i32 0 + ret i8 %0 +} + +declare <1 x i8> @llvm.arm.neon.vqabs.v1i8(<1 x i8>) + +define i16 @test_vqabsh_s16(i16 %a) { +; CHECK: test_vqabsh_s16 +; CHECK: sqabs {{h[0-9]+}}, {{h[0-9]+}} +entry: + %vqabs.i = insertelement <1 x i16> undef, i16 %a, i32 0 + %vqabs1.i = call <1 x i16> @llvm.arm.neon.vqabs.v1i16(<1 x i16> %vqabs.i) + %0 = extractelement <1 x i16> %vqabs1.i, i32 0 + ret i16 %0 +} + +declare <1 x i16> @llvm.arm.neon.vqabs.v1i16(<1 x i16>) + +define i32 @test_vqabss_s32(i32 %a) { +; CHECK: test_vqabss_s32 +; CHECK: sqabs {{s[0-9]+}}, {{s[0-9]+}} +entry: + %vqabs.i = insertelement <1 x i32> undef, i32 %a, i32 0 + %vqabs1.i = call <1 x i32> @llvm.arm.neon.vqabs.v1i32(<1 x i32> %vqabs.i) + %0 = extractelement <1 x i32> %vqabs1.i, i32 0 + ret i32 %0 +} + +declare <1 x i32> @llvm.arm.neon.vqabs.v1i32(<1 x i32>) + +define i64 @test_vqabsd_s64(i64 %a) { +; CHECK: test_vqabsd_s64 +; CHECK: sqabs {{d[0-9]+}}, {{d[0-9]+}} +entry: + %vqabs.i = insertelement <1 x i64> undef, i64 %a, i32 0 + %vqabs1.i = call <1 x i64> @llvm.arm.neon.vqabs.v1i64(<1 x i64> %vqabs.i) + %0 = extractelement <1 x i64> %vqabs1.i, i32 0 + ret i64 %0 +} + +declare <1 x i64> @llvm.arm.neon.vqabs.v1i64(<1 x i64>) |