From 0884546e1b92fe109e30cca3295e6212e4b24567 Mon Sep 17 00:00:00 2001
From: Ben Elliston <bje@au.ibm.com>
Date: Tue, 3 Jan 2006 05:08:19 +0000
Subject: [PATCH] targhooks.h (default_decimal_float_supported_p): Declare.

	* targhooks.h (default_decimal_float_supported_p): Declare.
	* targhooks.c (default_decimal_float_supported_p): Define.
	* target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): Redefine to
	`default_decimal_float_supported_p'.
	* doc/tm.texi (TARGET_DECIMAL_FLOAT_SUPPORTED_P): Update.

From-SVN: r109262
---
 gcc/ChangeLog    | 8 ++++++++
 gcc/doc/tm.texi  | 1 -
 gcc/target-def.h | 8 ++++----
 gcc/targhooks.c  | 8 ++++++++
 gcc/targhooks.h  | 1 +
 5 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1be3f95da3ff..c451a7eac1ca 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2006-01-03  Ben Elliston  <bje@au.ibm.com>
+
+	* targhooks.h (default_decimal_float_supported_p): Declare.
+	* targhooks.c (default_decimal_float_supported_p): Define.
+	* target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): Redefine to
+	`default_decimal_float_supported_p'.
+	* doc/tm.texi (TARGET_DECIMAL_FLOAT_SUPPORTED_P): Update.
+
 2006-01-02  Adam Nemet  <anemet@caviumnetworks.com>
 
 	* combine.c (apply_distributive_law <SUBREG>): Check
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 4960599ed773..c9e657375fe8 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -1423,7 +1423,6 @@ may affect its placement.
 
 @deftypefn {Target Hook} {bool} TARGET_DECIMAL_FLOAT_SUPPORTED_P (void)
 Returns true if the target supports decimal floating point.
-The default version of this hook always returns false.
 @end deftypefn
 
 @deftypefn {Target Hook} {const char *} TARGET_MANGLE_FUNDAMENTAL_TYPE (tree @var{type})
diff --git a/gcc/target-def.h b/gcc/target-def.h
index de0f19b4e4a4..5848868f818a 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -339,6 +339,10 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #define TARGET_SCALAR_MODE_SUPPORTED_P default_scalar_mode_supported_p
 #endif
 
+#ifndef TARGET_DECIMAL_FLOAT_SUPPORTED_P
+#define TARGET_DECIMAL_FLOAT_SUPPORTED_P default_decimal_float_supported_p
+#endif
+
 #ifndef TARGET_VECTOR_MODE_SUPPORTED_P
 #define TARGET_VECTOR_MODE_SUPPORTED_P hook_bool_mode_false
 #endif
@@ -366,10 +370,6 @@ Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #define TARGET_MANGLE_FUNDAMENTAL_TYPE hook_constcharptr_tree_null
 #define TARGET_ALLOCATE_INITIAL_VALUE NULL
 
-#ifndef TARGET_DECIMAL_FLOAT_SUPPORTED_P
-#define TARGET_DECIMAL_FLOAT_SUPPORTED_P hook_bool_void_false
-#endif
-
 #ifndef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS hook_void_void
 #endif
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 5ef2369ea6ba..2ff2b9b5a44c 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -270,6 +270,14 @@ default_scalar_mode_supported_p (enum machine_mode mode)
     }
 }
 
+/* True if the target supports decimal floating point.  */
+
+bool
+default_decimal_float_supported_p (void)
+{
+  return ENABLE_DECIMAL_FLOAT;
+}
+
 /* NULL if INSN insn is valid within a low-overhead loop, otherwise returns
    an error message.
   
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 8acccfdcb052..96bff20aebee 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -49,6 +49,7 @@ extern bool hook_callee_copies_named
 extern void default_unwind_emit (FILE *, rtx);
 
 extern bool default_scalar_mode_supported_p (enum machine_mode);
+extern bool default_decimal_float_supported_p (void);
 
 extern const char * default_invalid_within_doloop (rtx);
 
-- 
GitLab