This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] h8300: Convert two macros to target hooks.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 15 Jan 2004 13:02:44 -0500 (EST)
- Subject: [patch] h8300: Convert two macros to target hooks.
Hi,
Attached is a patch to convert two macros to target hooks.
Tested on h8300-hms. Committed.
Kazu Hirata
2004-01-15 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (h8300_return_in_memory): New.
(TARGET_STRUCT_VALUE_RTX): Likewise.
(TARGET_RETURN_IN_MEMORY): Likewise.
* config/h8300/h8300.h (STRUCT_VALUE): Remove.
(RETURN_IN_MEMORY): Likewise.
Index: h8300/h8300.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.c,v
retrieving revision 1.260
diff -u -r1.260 h8300.c
--- h8300/h8300.c 14 Jan 2004 02:01:05 -0000 1.260
+++ h8300/h8300.c 15 Jan 2004 05:20:08 -0000
@@ -4564,6 +4564,13 @@
set_optab_libfunc (umod_optab, HImode, "__umodhi3");
}
+static bool
+h8300_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
+{
+ return (TYPE_MODE (type) == BLKmode
+ || GET_MODE_SIZE (TYPE_MODE (type)) > (TARGET_H8300 ? 4 : 8));
+}
+
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE h8300_attribute_table
@@ -4590,5 +4597,10 @@
#undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS h8300_init_libfuncs
+
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX hook_rtx_tree_int_null
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY h8300_return_in_memory
struct gcc_target targetm = TARGET_INITIALIZER;
Index: h8300/h8300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.h,v
retrieving revision 1.161
diff -u -r1.161 h8300.h
--- h8300/h8300.h 4 Dec 2003 04:31:16 -0000 1.161
+++ h8300/h8300.h 15 Jan 2004 05:20:09 -0000
@@ -632,16 +632,6 @@
#define FUNCTION_ARG_REGNO_P(N) (TARGET_QUICKCALL ? N < 3 : 0)
-/* Register in which address to store a structure value
- is passed to a function. */
-
-#define STRUCT_VALUE 0
-
-/* Return true if X should be returned in memory. */
-#define RETURN_IN_MEMORY(X) \
- (TYPE_MODE (X) == BLKmode \
- || GET_MODE_SIZE (TYPE_MODE (X)) > (TARGET_H8300 ? 4 : 8))
-
/* When defined, the compiler allows registers explicitly used in the
rtl to be used as spill registers but prevents the compiler from
extending the lifetime of these registers. */