]> granicus.if.org Git - clang/commitdiff
Merging r195804:
authorBill Wendling <isanbard@gmail.com>
Sun, 1 Dec 2013 03:06:29 +0000 (03:06 +0000)
committerBill Wendling <isanbard@gmail.com>
Sun, 1 Dec 2013 03:06:29 +0000 (03:06 +0000)
------------------------------------------------------------------------
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

include/clang/Basic/arm_neon.td
lib/CodeGen/CGBuiltin.cpp
test/CodeGen/aarch64-neon-intrinsics.c

index 63aec20b580b5ea08bb911651f11093995c1a9b7..b7305b13fac94a6108cc8ec66b865708d6b9fde2 100644 (file)
@@ -1201,6 +1201,10 @@ def SCALAR_FACLT : IInst<"vcalt", "bss", "SfSd">;
 // Scalar Absolute Value
 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">;
index 9e135490df5e3f55fbbfad9b948303496e9bb35a..fa571d78cc90f5ab58374a678a35d1492afae5ae 100644 (file)
@@ -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:
index f0533cd9d46281b84046bf5ec437458a0ceb0ade..1cca5d210490879640700fa43d9160f522536c16 100644 (file)
@@ -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);
+}