[PATCH 5/8] math: Remove erfcf fma usage
Paul Zimmermann
Paul.Zimmermann@inria.fr
Mon Oct 13 09:28:36 GMT 2025
LGTM.
Tested by exhaustive search for all four rounding modes with the CORE-MATH
test suite and -march=x86-64-v2.
Reviewed-by: Paul Zimmermann <Paul.Zimmermann@inria.fr>
Paul
> From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> Cc: Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
> Paul Zimmermann <Paul.Zimmermann@inria.fr>,
> DJ Delorie <dj@redhat.com>
> Date: Fri, 10 Oct 2025 14:49:23 -0300
>
> The fma is not required to provide correctly rounded and it helps
> on !__FP_FAST_FMA ISAs.
> ---
> sysdeps/ieee754/flt-32/s_erfcf.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sysdeps/ieee754/flt-32/s_erfcf.c b/sysdeps/ieee754/flt-32/s_erfcf.c
> index 955f129148d..7d77eceb9cb 100644
> --- a/sysdeps/ieee754/flt-32/s_erfcf.c
> +++ b/sysdeps/ieee754/flt-32/s_erfcf.c
> @@ -140,7 +140,7 @@ __erfcf (float xf)
> const double iln2 = 0x1.71547652b82fep+0;
> const double ln2h = 0x1.62e42fefap-8;
> const double ln2l = 0x1.cf79abd6f5dc8p-47;
> - uint64_t jt = asuint64 (fma (x2, iln2, -(1024 + 0x1p-8)));
> + uint64_t jt = asuint64 (x2 * iln2 + -(1024 + 0x1p-8));
> int64_t j = (int64_t) (jt << 12) >> 48;
> double S = asdouble ((uint64_t)((j >> 7) + (0x3ff | sgn << 11)) << 52);
> static const double ch[] =
> --
> 2.43.0
>
>
More information about the Libc-alpha
mailing list