[PATCH v2 20/28] aarch64: Use NO_MATH_REDIRECT on pow_advsimd.c

H.J. Lu hjl.tools@gmail.com
Wed Oct 29 20:41:03 GMT 2025


On Wed, Oct 29, 2025 at 10:14 PM Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>
> Hi,
>
> >> clang does not optimize the fma calls, instead issuing __fma.
> >
> > What do you mean by that? Did you inline fma call?
>
> There are calls to fma() which should be inlined and not redirected to __fma
> with PLT avoidance. This issue is likely more widespread since various
> math functions are inlined as a single instruction, and we don't want to
> redirect such functions. It gets harder if one compiler inlines but another
> doesn't, so a better general mechanism might be needed.
>
> The patch looks good to me as a workaround.
>
> Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
>
> Cheers,
> Wilco

sysdeps/aarch64/fpu/math-use-builtins-fma.h has

#define USE_FMA_BUILTIN 1
#define USE_FMAF_BUILTIN 1
#define USE_FMAL_BUILTIN 0
#define USE_FMAF128_BUILTIN 0

which should disable fma redirection.  Why is NO_MATH_REDIRECT
still needed?

-- 
H.J.


More information about the Libc-alpha mailing list