This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][AArch64] Use target builtin instead of __builtin_sqrt for vsqrt_f64
- From: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, Richard Earnshaw <Richard dot Earnshaw at arm dot com>, James Greenhalgh <james dot greenhalgh at arm dot com>
- Date: Mon, 12 Jan 2015 15:52:41 +0000
- Subject: [PATCH][AArch64] Use target builtin instead of __builtin_sqrt for vsqrt_f64
- Authentication-results: sourceware.org; auth=none
Hi all,
As raised in https://gcc.gnu.org/ml/gcc-patches/2014-12/msg01237.html
and discussed in that thread, using __builtin_sqrt for vsqrt_f64 may end
up in a call to the library sqrt at -O0. To avoid that this patch uses a
target builtin for sqrt on DF mode and uses that to implement the intrinsic.
With this patch I don't see sqrt calls being created at -O0 on a large
arm_neon.h testcase where they were generated before.
aarch64-none-elf testing and the intrinsics testsuite in particular are
clean.
Ok for trunk?
Thanks,
Kyrill
2015-01-12 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/aarch64/aarch64-simd-builtins.def (sqrt): Use BUILTIN_VDQF_DF.
* config/aarch64/arm_neon.h (vsqrt_f64): Use __builtin_aarch64_sqrtdf
instead of __builtin_sqrt.commit 865be1cc8365886904d571e244746815e2317162
Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Date: Fri Jan 9 12:18:59 2015 +0000
[AArch64] Use target builtin for vsqrt_f64
diff --git a/gcc/config/aarch64/aarch64-simd-builtins.def b/gcc/config/aarch64/aarch64-simd-builtins.def
index b41d9f6..60cd1d7 100644
--- a/gcc/config/aarch64/aarch64-simd-builtins.def
+++ b/gcc/config/aarch64/aarch64-simd-builtins.def
@@ -41,7 +41,7 @@
BUILTIN_VDC (COMBINE, combine, 0)
BUILTIN_VB (BINOP, pmul, 0)
- BUILTIN_VDQF (UNOP, sqrt, 2)
+ BUILTIN_VDQF_DF (UNOP, sqrt, 2)
BUILTIN_VD_BHSI (BINOP, addp, 0)
VAR1 (UNOP, addp, 0, di)
BUILTIN_VDQ_BHSI (UNOP, clrsb, 2)
diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h
index c679802..3b151a2 100644
--- a/gcc/config/aarch64/arm_neon.h
+++ b/gcc/config/aarch64/arm_neon.h
@@ -22194,7 +22194,7 @@ vsqrtq_f32 (float32x4_t a)
__extension__ static __inline float64x1_t __attribute__ ((__always_inline__))
vsqrt_f64 (float64x1_t a)
{
- return (float64x1_t) { __builtin_sqrt (a[0]) };
+ return (float64x1_t) { __builtin_aarch64_sqrtdf (a[0]) };
}
__extension__ static __inline float64x2_t __attribute__ ((__always_inline__))