[glibc] powerpc: Update acosf ulps

Paul Zimmermann Paul.Zimmermann@inria.fr
Thu Jan 2 13:32:30 GMT 2025


       Hi Alexander,

> > > Isn't the new acosf implementation supposed to be correctly rounded?
> > 
> > yes, but due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=57245,
> > the new implementation might be miscompiled by gcc < 12.
> 
> can you kindly point me where the new acosf employs problematic conversions?
> I see a couple of instances where the 'f' suffix is missing, producing a
> double literal where a float could work as well:
> 
>  * in as_special there is
> 
>   const float pih = 0x1.921fb6p+1;

should be changed to 0x1.921fb6p+1f for more clarity

>  * and in __ieee754_acosf, in 0x1p-25:
> 
>       if (t == 0x328885a3u)
>        return 0x1.921fb6p+0f + 0x1p-25;
>       if (t == 0x39826222u)
>        return 0x1.920f6ap+0f + 0x1p-25;

both 0x1p-25 should be 0x1p-25f for more clarity

> but I don't see any instance where a double-precision constant is converted
> to float such that result depends on rounding mode.

indeed, this does not change the issue with gcc <= 11

> I'm guessing the '+ 0x1p-25' trick above is a workaround for this exact bug?

no, this is to get correct rounding depending on the rounding mode.

Paul


More information about the Libc-alpha mailing list