diff options
author | Michael Meissner <meissner@linux.vnet.ibm.com> | 2017-10-31 18:56:05 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2017-10-31 18:56:05 +0000 |
commit | c67624232a1cb16a99497605dde681eee711dbbd (patch) | |
tree | ba35a870ef34fc78dab1cf19295e5566bcebb694 /gcc/targhooks.c | |
parent | 6ff16d19d26a41cd7abb01e858529fae54de746a (diff) | |
download | gcc-c67624232a1cb16a99497605dde681eee711dbbd.zip gcc-c67624232a1cb16a99497605dde681eee711dbbd.tar.gz gcc-c67624232a1cb16a99497605dde681eee711dbbd.tar.bz2 |
builtins.def (DEF_FLOATN_BUILTIN): Change most _Float<N> and _Float<N>X built-in functions so that the variant...
2017-10-31 Michael Meissner <meissner@linux.vnet.ibm.com>
* builtins.def (DEF_FLOATN_BUILTIN): Change most _Float<N> and
_Float<N>X built-in functions so that the variant without the
"__builtin_" prefix is only enabled for the GNU C and Objective C
languages when they are in non-strict ANSI/ISO mode.
(DEF_EXT_LIB_FLOATN_NX_BUILTINS): Likewise.
* target.def (floatn_builtin_p): Add a target hook to control
whether _Float<N> and _Float<N>X built-in functions without the
"__builtin_" prefix are enabled, and return true for C and
Objective C in the default hook. Include langhooks.h in
targhooks.c.
* targhooks.h (default_floatn_builtin_p): Likewise.
* targhooks.c (default_floatn_builtin_p): Likewise.
* doc/tm.texi.in (TARGET_FLOATN_BUILTIN_P): Document the
floatn_builtin_p target hook.
* doc/tm.texi (TARGET_FLOATN_BUILTIN_P): Likewise.
From-SVN: r254277
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r-- | gcc/targhooks.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 92ecc90..b545bbb 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -81,7 +81,7 @@ along with GCC; see the file COPYING3. If not see #include "predict.h" #include "params.h" #include "real.h" - +#include "langhooks.h" bool default_legitimate_address_p (machine_mode mode ATTRIBUTE_UNUSED, @@ -563,6 +563,28 @@ default_floatn_mode (int n, bool extended) return opt_scalar_float_mode (); } +/* Define this to return true if the _Floatn and _Floatnx built-in functions + should implicitly enable the built-in function without the __builtin_ prefix + in addition to the normal built-in function with the __builtin_ prefix. The + default is to only enable built-in functions without the __builtin_ prefix + for the GNU C langauge. The argument FUNC is the enum builtin_in_function + id of the function to be enabled. */ + +bool +default_floatn_builtin_p (int func ATTRIBUTE_UNUSED) +{ + static bool first_time_p = true; + static bool c_or_objective_c; + + if (first_time_p) + { + first_time_p = false; + c_or_objective_c = lang_GNU_C () || lang_GNU_OBJC (); + } + + return c_or_objective_c; +} + /* Make some target macros useable by target-independent code. */ bool targhook_words_big_endian (void) |