aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-cppbuiltin.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@gcc.gnu.org>2010-10-15 17:42:05 +0000
committerMichael Meissner <meissner@gcc.gnu.org>2010-10-15 17:42:05 +0000
commit1b1562a55947daed482e2d8ef47a4f577397beb9 (patch)
tree5a6ace72e7cb1c4c33366822e3836c93b74e3f78 /gcc/c-family/c-cppbuiltin.c
parente74bf53a08b08e94ef88b0e1b0401e393efb1dac (diff)
downloadgcc-1b1562a55947daed482e2d8ef47a4f577397beb9.zip
gcc-1b1562a55947daed482e2d8ef47a4f577397beb9.tar.gz
gcc-1b1562a55947daed482e2d8ef47a4f577397beb9.tar.bz2
Add fma support
From-SVN: r165515
Diffstat (limited to 'gcc/c-family/c-cppbuiltin.c')
-rw-r--r--gcc/c-family/c-cppbuiltin.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index f946dc2..0ad77c7 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -62,6 +62,7 @@ static void builtin_define_type_sizeof (const char *, tree);
static void builtin_define_float_constants (const char *,
const char *,
const char *,
+ const char *,
tree);
/* Define NAME with value TYPE size_unit. */
@@ -78,6 +79,7 @@ static void
builtin_define_float_constants (const char *name_prefix,
const char *fp_suffix,
const char *fp_cast,
+ const char *fma_suffix,
tree type)
{
/* Used to convert radix-based values to base 10 values in several cases.
@@ -260,6 +262,13 @@ builtin_define_float_constants (const char *name_prefix,
NaN has quiet NaNs. */
sprintf (name, "__%s_HAS_QUIET_NAN__", name_prefix);
builtin_define_with_int_value (name, MODE_HAS_NANS (TYPE_MODE (type)));
+
+ /* Note whether we have fast FMA. */
+ if (mode_has_fma (TYPE_MODE (type)))
+ {
+ sprintf (name, "__FP_FAST_FMA%s", fma_suffix);
+ builtin_define_with_int_value (name, 1);
+ }
}
/* Define __DECx__ constants for TYPE using NAME_PREFIX and SUFFIX. */
@@ -607,13 +616,15 @@ c_cpp_builtins (cpp_reader *pfile)
builtin_define_with_int_value ("__DEC_EVAL_METHOD__",
TARGET_DEC_EVAL_METHOD);
- builtin_define_float_constants ("FLT", "F", "%s", float_type_node);
+ builtin_define_float_constants ("FLT", "F", "%s", "F", float_type_node);
/* Cast the double precision constants. This is needed when single
precision constants are specified or when pragma FLOAT_CONST_DECIMAL64
is used. The correct result is computed by the compiler when using
macros that include a cast. */
- builtin_define_float_constants ("DBL", "L", "((double)%s)", double_type_node);
- builtin_define_float_constants ("LDBL", "L", "%s", long_double_type_node);
+ builtin_define_float_constants ("DBL", "L", "((double)%s)", "",
+ double_type_node);
+ builtin_define_float_constants ("LDBL", "L", "%s", "L",
+ long_double_type_node);
/* For decfloat.h. */
builtin_define_decimal_float_constants ("DEC32", "DF", dfloat32_type_node);