On Mon, Jan 12, 2015 at 7:52 AM, Kyrill Tkachov <kyrylo.tkac...@arm.com> wrote:
> 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?

Maybe have a target fold which folds this into sqrt if -fno-math-errno
is supplied.  This might be useful the -ffast-math case.
Maybe also fold it when a constant is supplied too.

Thanks,
Andrew

>
> Thanks,
> Kyrill
>
> 2015-01-12  Kyrylo Tkachov  <kyrylo.tkac...@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.

Reply via email to