Implement C23 pown [committed]
Joseph Myers
josmyers@redhat.com
Wed Jun 4 15:58:02 GMT 2025
On Wed, 4 Jun 2025, Vincent Lefevre wrote:
> On 2025-06-03 11:09:07 -0500, Segher Boessenkool wrote:
> > The commit message clearly says this implementation isd correct for
> > IEEE float only. And indeed it is not for double-double, which is very
> > much not IEEE.
> >
> > Maybe these tests should require IEEE float? The implementation does,
> > after all!
>
> Shouldn't this implementation rather be disabled with non-IEEE floats
> (thus not just the tests), as it is not correct?
The basic principle is that we provide the same API across architectures
and floating-point types (modulo some obsolescent functions not being
provided for _FloatN / _FloatNx). So pownl is supported for all glibc
configurations. Having a generic implementation (that works for IBM long
double as well as the underlying arithmetic in libgcc does, which isn't
that well outside round-to-nearest mode) avoids needing to write five
separate implementations for five different floating-point formats in
order to add the feature to glibc. (And while people might well add
better - faster and more accurate - implementations for particular formats
in future, for example taken from CORE-MATH if that gains pown
implementations at some point, I very much doubt anyone is going to care
about IBM long double enough to write a custom implementation for that
format of any new math.h functions.)
--
Joseph S. Myers
josmyers@redhat.com
More information about the Libc-alpha
mailing list