diff options
author | Michael Meissner <meissner@gcc.gnu.org> | 2010-10-18 22:37:32 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2010-10-18 22:37:32 +0000 |
commit | 0069111f9c747028548f8c5dd7b91c4e5358039d (patch) | |
tree | 2de2f4a8635e093411b80f7af2f4ffe4987f3195 | |
parent | cd9c769aabbdf7ee4c5ad0954c099ebfd26b27b8 (diff) | |
download | gcc-0069111f9c747028548f8c5dd7b91c4e5358039d.zip gcc-0069111f9c747028548f8c5dd7b91c4e5358039d.tar.gz gcc-0069111f9c747028548f8c5dd7b91c4e5358039d.tar.bz2 |
Fix PR 46041
From-SVN: r165666
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/builtins.c | 8 | ||||
-rw-r--r-- | gcc/c-family/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/c-family/c-cppbuiltin.c | 37 | ||||
-rw-r--r-- | gcc/tree.h | 1 |
5 files changed, 54 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a27d064..b21e191 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-10-18 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/46041 + * tree.h (mode_has_fma): Delete, move to c-cppbuiltins.c. + * builtins.c (mode_has_fma): Ditto. + 2010-10-18 Steve Ellcey <sje@cup.hp.com> PR target/36898 diff --git a/gcc/builtins.c b/gcc/builtins.c index 370d521..ca69efa 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -13909,11 +13909,3 @@ is_inexpensive_builtin (tree decl) return false; } - -/* Return true if MODE provides a fast multiply/add (FMA) builtin function. */ - -bool -mode_has_fma (enum machine_mode mode) -{ - return optab_handler (fma_optab, mode) != CODE_FOR_nothing; -} diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 63b7f74..7a17df7 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,7 +1,15 @@ +2010-10-18 Michael Meissner <meissner@linux.vnet.ibm.com> + + PR target/46041 + * c-cppbuiltin.c (mode_has_fma): Move function here from + builtins.c. Don't use the fma optab, instead just use the + HAVE_fma* macros, so that __FP_FAST_FMA* will be defined when + using -save-temps. + 2010-10-18 Nicola Pero <nicola.pero@meta-innovation.com> Merge from 'apple/trunk' branch on FSF servers. - + 2005-11-08 Fariborz Jahanian <fjahanian@apple.com> Radar 4330422 @@ -16,7 +24,7 @@ Radar 4133425 * c-common.h (objc_diagnose_private_ivar): New decl. - * stub-objc.c (objc_diagnose_private_ivar): New stub. + * stub-objc.c (objc_diagnose_private_ivar): New stub. 2010-10-17 Iain Sandoe <iains@gcc.gnu.org> @@ -24,7 +32,7 @@ * c-common.h (enum rid): Add RID_AT_PACKAGE. (objc_ivar_visibility_kind): New enum. (objc_set_visibility): Adjust prototype to use visibility enum. - * stub-objc.c (objc_set_visibility): Adjust stub to use + * stub-objc.c (objc_set_visibility): Adjust stub to use visibility enum. 2010-10-14 Michael Meissner <meissner@linux.vnet.ibm.com> diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 0ad77c7..7b5a14d 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -65,6 +65,43 @@ static void builtin_define_float_constants (const char *, const char *, tree); +/* Return true if MODE provides a fast multiply/add (FMA) builtin function. + Originally this function used the fma optab, but that doesn't work with + -save-temps, so just rely on the HAVE_fma macros for the standard floating + point types. */ + +static bool +mode_has_fma (enum machine_mode mode) +{ + switch (mode) + { +#ifdef HAVE_fmasf4 + case SFmode: + return !!HAVE_fmasf4; +#endif + +#ifdef HAVE_fmadf4 + case DFmode: + return !!HAVE_fmadf4; +#endif + +#ifdef HAVE_fmaxf4 + case XFmode: + return !!HAVE_fmaxf4; +#endif + +#ifdef HAVE_fmatf4 + case TFmode: + return !!HAVE_fmatf4; +#endif + + default: + break; + } + + return false; +} + /* Define NAME with value TYPE size_unit. */ static void builtin_define_type_sizeof (const char *name, tree type) @@ -5069,7 +5069,6 @@ extern bool merge_ranges (int *, tree *, tree *, int, tree, tree, int, extern void set_builtin_user_assembler_name (tree decl, const char *asmspec); extern bool is_simple_builtin (tree); extern bool is_inexpensive_builtin (tree); -extern bool mode_has_fma (enum machine_mode mode); /* In convert.c */ extern tree strip_float_extensions (tree); |