On Tue, Jan 25, 2022 at 08:52:34PM +0100, FX wrote:
> > With --disable-multilib, so no -m32 support, I still
> > signaling_3.f90 failing. In
> >
> > ! { dg-do run { xfail { { i?86-*-* x86_64-*-* } && ilp32 } } }
> > ! x87 / x86-32 ABI is unsuitable for signaling NaNs
>
> This just means the test shouldn’t be run on 32-bit Intel.
>
> Can you run this:
>
> #include <stdint.h>
> #include <stdio.h>
> #include "issignaling_fallback.h"
>
> int main (void) {
> long double z;
>
> z = __builtin_nansl("");
> printf("%d\n", issignaling(z));
>
> z = __builtin_nanl("");
> printf("%d\n", issignaling(z));
> }
>
> compiled with -fsignaling-nans and the issignaling_fallback.h file from
> libgfortran?
>
If in issignaling_fallback.h, I change
#if __FLOAT_WORD_ORDER == __BIG_ENDIAN
...
#elif __FLOAT_WORD_ORDER == __LITTLE_ENDIAN
...
#endif
to
#if 0
...
#else
...
#endif
to force little endian, I get
% ~/work/x/bin/gcc -o -I. -fsignaling-nans -o z b.c && ./z
1
0
so need an equivalent of __FLOAT_WORD_ORDER for at least
FreeBSD.
Found it. https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html
Add trailing undersores to __FLOAT_WORD_ORDER and change
__BIG_ENDIAN to __ORDER_BIG_ENDIAN__. Likewise for LITTLE.
--
Steve