From c67624232a1cb16a99497605dde681eee711dbbd Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Tue, 31 Oct 2017 18:56:05 +0000 Subject: builtins.def (DEF_FLOATN_BUILTIN): Change most _Float and _FloatX built-in functions so that the variant... 2017-10-31 Michael Meissner * builtins.def (DEF_FLOATN_BUILTIN): Change most _Float and _FloatX 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 and _FloatX 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 --- gcc/targhooks.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'gcc/targhooks.c') 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) -- cgit v1.1