diff options
author | Joseph Myers <joseph@codesourcery.com> | 2020-11-06 21:55:19 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2020-11-06 21:55:19 +0000 |
commit | 6c8e4f4d79e1c6fb239616e4e07cb46a8c3eb81a (patch) | |
tree | 236697b91fdd8f1dde905d96c56830e3a6c368fc /gcc/doc/extend.texi | |
parent | 43d3b7bc073df27800218b685e6d7dd78dd31905 (diff) | |
download | gcc-6c8e4f4d79e1c6fb239616e4e07cb46a8c3eb81a.zip gcc-6c8e4f4d79e1c6fb239616e4e07cb46a8c3eb81a.tar.gz gcc-6c8e4f4d79e1c6fb239616e4e07cb46a8c3eb81a.tar.bz2 |
builtins: Add DFP signaling NaN built-in functions
Add built-in functions __builtin_nansd32, __builtin_nansd64 and
__builtin_nansd128 to return signaling NaNs of decimal floating-point
types, analogous to the functions already present for binary
floating-point types.
This patch, independent of
<https://gcc.gnu.org/pipermail/gcc-patches/2020-October/557136.html>
(pending review), is in preparation for adding the <float.h> macros
for such signaling NaNs that are in C2x, analogous to the macros for
other types that are in that patch.
Bootstrapped with no regressions for x86_64-pc-linux-gnu. Also ran
the new tests for powerpc64le-linux-gnu to confirm they do work in the
case (hardware DFP) where floating-point exceptions are supported for
DFP.
gcc/
2020-11-06 Joseph Myers <joseph@codesourcery.com>
* builtins.def (BUILT_IN_NANSD32, BUILT_IN_NANSD64)
(BUILT_IN_NANSD128): New built-in functions.
* fold-const-call.c (fold_const_call): Handle the new built-in
functions.
* doc/extend.texi (__builtin_nansd32, __builtin_nansd64)
(__builtin_nansd128): Document.
* doc/sourcebuild.texi (Effective-Target Keywords): Document
fenv_exceptions_dfp.
gcc/testsuite/
2020-11-06 Joseph Myers <joseph@codesourcery.com>
* lib/target-supports.exp
(check_effective_target_fenv_exceptions_dfp): New.
* gcc.dg/dfp/builtin-snan-1.c, gcc.dg/dfp/builtin-snan-2.c: New
tests.
Diffstat (limited to 'gcc/doc/extend.texi')
-rw-r--r-- | gcc/doc/extend.texi | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 7a6ecce..e6a9bdf 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -13865,6 +13865,18 @@ to be a signaling NaN@. The @code{nans} function is proposed by @uref{http://www.open-std.org/jtc1/sc22/wg14/www/docs/n965.htm,,WG14 N965}. @end deftypefn +@deftypefn {Built-in Function} _Decimal32 __builtin_nansd32 (const char *str) +Similar to @code{__builtin_nans}, except the return type is @code{_Decimal32}. +@end deftypefn + +@deftypefn {Built-in Function} _Decimal64 __builtin_nansd64 (const char *str) +Similar to @code{__builtin_nans}, except the return type is @code{_Decimal64}. +@end deftypefn + +@deftypefn {Built-in Function} _Decimal128 __builtin_nansd128 (const char *str) +Similar to @code{__builtin_nans}, except the return type is @code{_Decimal128}. +@end deftypefn + @deftypefn {Built-in Function} float __builtin_nansf (const char *str) Similar to @code{__builtin_nans}, except the return type is @code{float}. @end deftypefn |