diff options
author | Joseph Myers <joseph@codesourcery.com> | 2020-11-17 16:25:45 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2020-11-17 16:28:11 +0000 |
commit | ac30c8b8d035cd9259040150f059f1cf3542f626 (patch) | |
tree | 74a267e1b58daaf2b2dc87c438f06a7bc7d88b5d /gcc/ginclude | |
parent | 8895913273b97d07f9576f5eb497d39b78166daf (diff) | |
download | gcc-ac30c8b8d035cd9259040150f059f1cf3542f626.zip gcc-ac30c8b8d035cd9259040150f059f1cf3542f626.tar.gz gcc-ac30c8b8d035cd9259040150f059f1cf3542f626.tar.bz2 |
float.h: C2x *_IS_IEC_60559 macros
C2x adds float.h macros that say whether float, double and long double
match an IEC 60559 (IEEE 754) format and operations. Add these
macros to GCC's float.h.
Bootstrapped with no regressions for x86_64-pc-linux-gnu.
gcc/c-family/
2020-11-17 Joseph Myers <joseph@codesourcery.com>
* c-cppbuiltin.c (builtin_define_float_constants): Define
"*_IS_IEC_60559__" macros.
gcc/
2020-11-17 Joseph Myers <joseph@codesourcery.com>
* ginclude/float.h [__STDC_VERSION__ > 201710L] (FLT_IS_IEC_60559,
DBL_IS_IEC_60559, LDBL_IS_IEC_60559): New macros.
gcc/testsuite/
2020-11-17 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/c11-float-6.c, gcc.dg/c2x-float-10.c: New tests.
Diffstat (limited to 'gcc/ginclude')
-rw-r--r-- | gcc/ginclude/float.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ginclude/float.h b/gcc/ginclude/float.h index 0fa0046..83c5ad5 100644 --- a/gcc/ginclude/float.h +++ b/gcc/ginclude/float.h @@ -248,6 +248,15 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define DBL_NORM_MAX __DBL_NORM_MAX__ #define LDBL_NORM_MAX __LDBL_NORM_MAX__ +/* Whether each type matches an IEC 60559 format (1 for format, 2 for + format and operations). */ +#undef FLT_IS_IEC_60559 +#undef DBL_IS_IEC_60559 +#undef LDBL_IS_IEC_60559 +#define FLT_IS_IEC_60559 __FLT_IS_IEC_60559__ +#define DBL_IS_IEC_60559 __DBL_IS_IEC_60559__ +#define LDBL_IS_IEC_60559 __LDBL_IS_IEC_60559__ + /* Infinity in type float, or overflow if infinity not supported. */ #undef INFINITY #define INFINITY (__builtin_inff ()) |