unnormal Intel 80-bit long doubles and isnanl

Florian Weimer fweimer@redhat.com
Tue Nov 24 13:49:31 GMT 2020


* Szabolcs Nagy:

> ideally fpclassify (and other classification macros) would
> handle all representations.
>
> architecturally invalid or trap representations can be a
> non-standard class but i think classifying them as FP_NAN
> would break the least amount of code.

I think the fpclassify macro has the wrong signature for trap
representation checks.  It's macro, so in theory we could make it behave
in any way we want, but I think it's awkward to pass a dereferenced
pointer as a macro argument when it's as best unclear whether the
dereferencing operation itself triggers undefined behavior.

We can avoid that if we do not make these representations trap
representations, but give them a defined meaning.

>> glibc evaluates the bit pattern of the 80-bit long double and in the
>> process, ignores the integer bit, i.e. bit 63.  As a result, it considers
>> the unnormal number as a valid long double and isnanl returns 0.
>
> i think m68k and x86 are different here.

I think you are right.

Thanks,
Florian
-- 
Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill



More information about the Gcc mailing list