diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-12-01 03:06:29 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-12-01 03:06:29 +0000 |
commit | 38750138231fbf4e9ef18ce93e55ee3bc6ac592d (patch) | |
tree | 4d19cc13ef2568d48128beb42c2de24023b58dd8 | |
parent | c02b18c27fa9b586291d016a99970ce78a41f4cd (diff) | |
download | clang-38750138231fbf4e9ef18ce93e55ee3bc6ac592d.tar.gz clang-38750138231fbf4e9ef18ce93e55ee3bc6ac592d.tar.bz2 clang-38750138231fbf4e9ef18ce93e55ee3bc6ac592d.tar.xz |
Merging r195804:
------------------------------------------------------------------------
r195804 | mcrosier | 2013-11-26 17:46:19 -0800 (Tue, 26 Nov 2013) | 1 line
[AArch64] Add support for NEON scalar floating-point absolute difference.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195995 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/arm_neon.td | 4 | ||||
-rw-r--r-- | lib/CodeGen/CGBuiltin.cpp | 5 | ||||
-rw-r--r-- | test/CodeGen/aarch64-neon-intrinsics.c | 12 |
3 files changed, 21 insertions, 0 deletions
diff --git a/include/clang/Basic/arm_neon.td b/include/clang/Basic/arm_neon.td index 63aec20b58..b7305b13fa 100644 --- a/include/clang/Basic/arm_neon.td +++ b/include/clang/Basic/arm_neon.td @@ -1202,6 +1202,10 @@ def SCALAR_FACLT : IInst<"vcalt", "bss", "SfSd">; def SCALAR_ABS : SInst<"vabs", "ss", "Sl">; //////////////////////////////////////////////////////////////////////////////// +// Scalar Absolute Difference +def SCALAR_ABD : IInst<"vabd", "sss", "SfSd">; + +//////////////////////////////////////////////////////////////////////////////// // Scalar Signed Saturating Absolute Value def SCALAR_SQABS : SInst<"vqabs", "ss", "ScSsSiSl">; diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index 9e135490df..fa571d78cc 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -2334,6 +2334,11 @@ static Value *EmitAArch64ScalarBuiltinExpr(CodeGenFunction &CGF, case AArch64::BI__builtin_neon_vabsd_s64: Int = Intrinsic::aarch64_neon_vabs; s = "vabs"; OverloadInt = false; break; + // Scalar Absolute Difference + case AArch64::BI__builtin_neon_vabds_f32: + case AArch64::BI__builtin_neon_vabdd_f64: + Int = Intrinsic::aarch64_neon_vabd; + s = "vabd"; OverloadInt = true; break; // Scalar Signed Saturating Absolute Value case AArch64::BI__builtin_neon_vqabsb_s8: case AArch64::BI__builtin_neon_vqabsh_s16: diff --git a/test/CodeGen/aarch64-neon-intrinsics.c b/test/CodeGen/aarch64-neon-intrinsics.c index f0533cd9d4..1cca5d2104 100644 --- a/test/CodeGen/aarch64-neon-intrinsics.c +++ b/test/CodeGen/aarch64-neon-intrinsics.c @@ -11200,3 +11200,15 @@ poly64x2_t test_vreinterpretq_p64_p8(poly8x16_t a) { poly64x2_t test_vreinterpretq_p64_p16(poly16x8_t a) { return vreinterpretq_p64_p16(a); } + +float32_t test_vabds_f32(float32_t a, float32_t b) { +// CHECK-LABEL: test_vabds_f32 +// CHECK: fabd {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}} + return vabds_f32(a, b); +} + +float64_t test_vabdd_f64(float64_t a, float64_t b) { +// CHECK-LABEL: test_vabdd_f64 +// CHECK: fabd {{d[0-9]+}}, {{d[0-9]+}}, {{d[0-9]+}} + return vabdd_f64(a, b); +} |