diff options
author | Joseph Myers <joseph@codesourcery.com> | 2020-11-17 00:27:06 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2020-11-17 00:27:06 +0000 |
commit | f8e4c55cbc09fbbe136b2ba2da405d7bdced07ae (patch) | |
tree | b937d5e9dc9e4b0c6182e10ceb6ee47c5372308a /gcc/ginclude | |
parent | 3cfe746fc5255f8dd1674bf4a8873b7b8e178c89 (diff) | |
download | gcc-f8e4c55cbc09fbbe136b2ba2da405d7bdced07ae.zip gcc-f8e4c55cbc09fbbe136b2ba2da405d7bdced07ae.tar.gz gcc-f8e4c55cbc09fbbe136b2ba2da405d7bdced07ae.tar.bz2 |
float.h: C2x decimal signaling NaN macros
C2x adds macros for decimal floating-point signaling NaNs to
<float.h>. Add these macros to GCC's <float.h> implementation.
Note that the current C2x draft has these under incorrect names
D32_SNAN, D64_SNAN, D128_SNAN. The intent was to change the naming
convention to be consistent with other <float.h> macros when they were
moved to <float.h>, so DEC32_SNAN, DEC64_SNAN, DEC128_NAN, which this
patch uses (as does the current draft integration of TS 18661-3 as an
Annex to C2x, for its _Decimal* and _Decimal*x types).
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
gcc/
2020-11-17 Joseph Myers <joseph@codesourcery.com>
* ginclude/float.h (DEC32_SNAN, DEC64_SNAN, DEC128_SNAN): New C2x
macros.
gcc/testsuite/
2020-11-17 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/dfp/c2x-float-dfp-7.c, gcc.dg/dfp/c2x-float-dfp-8.c: New
tests.
* gcc.dg/c2x-float-no-dfp-3.c: Also check that DEC32_SNAN,
DEC64_SNAN and DEC128_SNAN are not defined.
Diffstat (limited to 'gcc/ginclude')
-rw-r--r-- | gcc/ginclude/float.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ginclude/float.h b/gcc/ginclude/float.h index 7744699..0fa0046 100644 --- a/gcc/ginclude/float.h +++ b/gcc/ginclude/float.h @@ -601,6 +601,14 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #undef DEC_NAN #define DEC_NAN (__builtin_nand32 ("")) +/* Signaling NaN in each decimal floating-point type. */ +#undef DEC32_SNAN +#define DEC32_SNAN (__builtin_nansd32 ("")) +#undef DEC64_SNAN +#define DEC64_SNAN (__builtin_nansd64 ("")) +#undef DEC128_SNAN +#define DEC128_SNAN (__builtin_nansd128 ("")) + #endif /* C2X */ #endif /* __DEC32_MANT_DIG__ */ |