This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64] Implement vsqrt_f64 intrinsic
- From: James Greenhalgh <james dot greenhalgh at arm dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Cc: 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>
- Date: Mon, 15 Dec 2014 12:13:53 +0000
- Subject: Re: [PATCH][AArch64] Implement vsqrt_f64 intrinsic
- Authentication-results: sourceware.org; auth=none
- References: <546A31DB dot 7040102 at arm dot com>
On Mon, Nov 17, 2014 at 05:35:23PM +0000, Kyrill Tkachov wrote:
> Hi all,
>
> This patch implements the vsqrt_f64 intrinsic in arm_neon.h.
> There's not much to it, we can reuse __builtin_sqrt.
> It's a fairly straightforward and self-contained patch,
> do we still want it at this stage?
>
> A new execute test is added.
>
> Tested aarch64-none-elf.
>
>
> Thanks,
> Kyrill
>
> 2014-11-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * config/aarch64/arm_neon.h (vsqrt_f64): New intrinsic.
>
> 2014-11-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * gcc.target/aarch64/simd/vsqrt_f64_1.c
> commit d9e42debe2655287eef7b8c3ecf29bbdd11e6425
> Author: Kyrylo Tkachov <kyrylo.tkachov@arm.com>
> Date: Mon Nov 17 15:02:01 2014 +0000
>
> [AArch64] Implement vsqrt_f64 intrinsic
>
> diff --git a/gcc/config/aarch64/arm_neon.h b/gcc/config/aarch64/arm_neon.h
> index b3b80b8..c58213a 100644
> --- a/gcc/config/aarch64/arm_neon.h
> +++ b/gcc/config/aarch64/arm_neon.h
> @@ -22792,6 +22792,12 @@ vsqrtq_f32 (float32x4_t a)
> return __builtin_aarch64_sqrtv4sf (a);
> }
>
> +__extension__ static __inline float64x1_t __attribute__ ((__always_inline__))
> +vsqrt_f64 (float64x1_t a)
> +{
> + return (float64x1_t) { __builtin_sqrt (a[0]) };
> +}
Hi Kyrill,
Does this introduce an implicit need to link against a maths library if
we want arm_neon.h to work correctly? If so, I think we need to take a
different approach.
At O0 I've started to see:
" undefined reference to `sqrt' "
When checking a large arm_neon.h testcase.
It does seem strange that the mid-end would convert a __builtin_sqrt back
to a library call at O0 when the target has an optab for it, so perhaps
there is a bug there to go hunt?
Thanks,
James