This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] ip2k: Hookize some target macros.


Hi,

Attached is a patch to hookize some target macros.

Built cc1 of ip2k-elf.  OK to apply?

Kazu Hirata

2004-01-24  Kazu Hirata  <kazu@cs.umass.edu>

	* config/ip2k/ip2k.c (TARGET_STRUCT_VALUE_RTX): New.
	(TARGET_RETURN_IN_MEMORY): Likewise.
	(TARGET_SETUP_INCOMING_VARARGS): Likewise.
	(ip2k_return_in_memory): Likewise.
	(ip2k_setup_incoming_varargs): Likewise.
	* config/ip2k/ip2k.h (RETURN_IN_MEMORY): Remove.
	(STRUCT_VALUE): Likewise.
	(STRUCT_VALUE_INCOMING): Likewise.
	(SETUP_INCOMING_VARARGS): Likewise.

Index: ip2k.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ip2k/ip2k.c,v
retrieving revision 1.29
diff -u -r1.29 ip2k.c
--- ip2k.c	13 Jan 2004 01:58:43 -0000	1.29
+++ ip2k.c	25 Jan 2004 04:28:50 -0000
@@ -81,6 +81,9 @@
 static bool ip2k_rtx_costs (rtx, int, int, int *);
 static int ip2k_address_cost (rtx);
 static void ip2k_init_libfuncs (void);
+static bool ip2k_return_in_memory (tree, tree);
+static void ip2k_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
+					 tree, int *, int);
 
 const struct attribute_spec ip2k_attribute_table[];
 
@@ -112,6 +115,14 @@
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS ip2k_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 ip2k_return_in_memory
+
+#undef TARGET_SETUP_INCOMING_VARARGS
+#define TARGET_SETUP_INCOMING_VARARGS ip2k_setup_incoming_varargs
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Prologue/Epilogue size in words.  */
@@ -6183,4 +6194,20 @@
 {
   return (comparison_operator (op, mode)
           && unsigned_condition (GET_CODE (op)) == GET_CODE (op));
+}
+
+static bool
+ip2k_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
+{
+  return (TYPE_MODE (type) == BLKmode) ? int_size_in_bytes (type) > 8 : 0;
+}
+
+static void
+ip2k_setup_incoming_varargs (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED,
+			     enum machine_mode mode ATTRIBUTE_UNUSED,
+			     tree type ATTRIBUTE_UNUSED,
+			     int *pretend_arg_size,
+			     int second_time ATTRIBUTE_UNUSED)
+{
+  *pretend_arg_size = 0;
 }
Index: ip2k.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ip2k/ip2k.h,v
retrieving revision 1.30
diff -u -r1.30 ip2k.h
--- ip2k.h	10 Oct 2003 20:33:06 -0000	1.30
+++ ip2k.h	25 Jan 2004 04:28:51 -0000
@@ -462,23 +462,12 @@
 
 #define FUNCTION_VALUE_REGNO_P(N) ((N) == REG_RESULT)
 
-#define RETURN_IN_MEMORY(TYPE) \
-  ((TYPE_MODE (TYPE) == BLKmode) ? int_size_in_bytes (TYPE) > 8 : 0)
-
 /* Indicate that large structures are passed by reference.  */
 #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM,MODE,TYPE,NAMED)	0
 
 #define DEFAULT_PCC_STRUCT_RETURN 0
 
-#define STRUCT_VALUE 0
-
-#define STRUCT_VALUE_INCOMING 0
-
 #define EPILOGUE_USES(REGNO) 0
-
-#define SETUP_INCOMING_VARARGS(ARGS_SO_FAR,MODE,TYPE,		\
-			       PRETEND_ARGS_SIZE,SECOND_TIME)	\
-  ((PRETEND_ARGS_SIZE) = (0))
 
 
 /*  Hmmm.  We don't actually like constants as addresses - they always need


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]