[PATCH 3/5] math: New generic fma implementation

Andreas Schwab schwab@suse.de
Tue Nov 25 15:42:32 GMT 2025


On Nov 13 2025, Adhemerval Zanella wrote:

> diff --git a/sysdeps/ieee754/dbl-64/math_config.h b/sysdeps/ieee754/dbl-64/math_config.h
> index 36a47ae7dbb..b6b5da60545 100644
> --- a/sysdeps/ieee754/dbl-64/math_config.h
> +++ b/sysdeps/ieee754/dbl-64/math_config.h
> @@ -85,6 +85,24 @@ static inline int32_t
>  converttoint (double x);
>  #endif
>  
> +#ifndef TOINT64_INTRINSICS
> +# define TOINT64_INTRINSICS 1
> +#endif
> +
> +static inline double converttoint64 (int64_t a)
> +{
> +#if !TOINT64_INTRINSICS
> +  union { int64_t x; double d; } low = {.d = 0x1.0p52};
> +
> +  double high = (int32_t)(a >> 32) * 0x1.0p32;
> +  low.x |= a & INT64_C(0x00000000ffffffff);
> +
> +  return (high - 0x1.0p52) + low.d;

That's rather convertfromint64.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."


More information about the Libc-alpha mailing list