diff options
author | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-15 17:42:05 +0000 |
---|---|---|
committer | meissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-10-15 17:42:05 +0000 |
commit | 7e0713b19861cf2d5b2a216a5f37e1d486109b76 (patch) | |
tree | 5a6ace72e7cb1c4c33366822e3836c93b74e3f78 /gcc/c-family | |
parent | 9f092e58e1ca92f1851075265ba3dca3884ac648 (diff) | |
download | gcc-7e0713b19861cf2d5b2a216a5f37e1d486109b76.tar.gz |
Add fma support
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165515 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 17 | ||||
-rw-r--r-- | gcc/c-family/c-cppbuiltin.c | 17 |
2 files changed, 26 insertions, 8 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 5ba4659ba30..29fc3a1e37d 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,8 +1,15 @@ +2010-10-14 Michael Meissner <meissner@linux.vnet.ibm.com> + + * c-cppbuiltin.c (builtin_define_float_constants): Emit + __FP_FAST_FMA, __FP_FAST_FMAF, and __FP_FAST_FMAL if the machine + has the appropriate fma builtins. + (c_cpp_builtins): Adjust call to builtin_define_float_constants. + 2010-10-14 Iain Sandoe <iains@gcc.gnu.org> - merge from FSF apple 'trunk' branch. + merge from FSF apple 'trunk' branch. 2006 Fariborz Jahanian <fjahanian@apple.com> - + Radars 4436866, 4505126, 4506903, 4517826 * c-common.c (c_common_resword): Define @property and its attributes. * c-common.h: Define property attribute enum entries. @@ -14,17 +21,17 @@ (objc_add_property_variable): Likewise. (objc_build_getter_call): Likewise. (objc_build_setter_call) Likewise. - + 2010-10-13 Iain Sandoe <iains@gcc.gnu.org> - merge from FSF apple 'trunk' branch. + merge from FSF apple 'trunk' branch. 2006-04-26 Fariborz Jahanian <fjahanian@apple.com> Radar 3803157 (method attributes) * c-common.c (handle_deprecated_attribute): Recognize objc methods as valid declarations. * c-common.h: Declare objc_method_decl (). - * stub-objc.c (objc_method_decl): New stub. + * stub-objc.c (objc_method_decl): New stub. 2010-10-08 Joseph Myers <joseph@codesourcery.com> diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index f946dc243b4..0ad77c7415e 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); |