https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82207

--- Comment #14 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Created attachment 52101
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52101&action=edit
First attempt at a patch

This is a first version of a patch for support of signalling NaNs. What it
does:

- In the code implementing IEEE_CLASS, use the target issignaling macro (from
TS 18661-1:2014) to check whether a NaN is signalling.
- Sadly, very few targets implement this (I think only glibc targets,
currently). This means we will have to provide fallback implementations. A
first attempt at fallback implementations is included in the patch, but has not
been tested thoroughly. It will require testing on many platforms to be
validated.
- I moved the library implementation of IEEE_VALUE from Fortran to C code,
which gives us access to GCC's built-in functions for NaN generation (both
quiet and signalling).

What remains to be done:
- Write testcases that exercise the different aspects of these functions
- Figure out a weird behaviour for __builtin_nanq() in C code:
https://gcc.gnu.org/pipermail/gcc/2021-December/237976.html
- More testcases :)
- Testing the behaviour on different targets

Help would be appreciated in finding good testcases.

Reply via email to