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] c4x: Hookize some target macros.


Hi,

Attached is a patch to hookize some target macros.

Built cc1 of c4x-coff.  OK to apply?

Kazu Hirata

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

	* config/c4x/c4x.c (TARGET_ASM_EXTERNAL_LIBCALL): New.
	(TARGET_STRUCT_VALUE_RTX): Likewise.
	(c4x_external_libcall): Likewise.
	(c4x_struct_value_rtx): Likewise.
	* config/c4x/c4x.h: Remove.
	(STRUCT_VALUE_REGNUM): Likewise.
	(ASM_OUTPUT_EXTERNAL_LIBCALL): Likewise.

Index: c4x.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/c4x/c4x.c,v
retrieving revision 1.136
diff -u -r1.136 c4x.c
--- c4x.c	13 Jan 2004 01:58:42 -0000	1.136
+++ c4x.c	24 Jan 2004 19:18:00 -0000
@@ -200,6 +200,8 @@
 static bool c4x_rtx_costs (rtx, int, int, int *);
 static int c4x_address_cost (rtx);
 static void c4x_init_libfuncs (void);
+static void c4x_external_libcall (rtx);
+static rtx c4x_struct_value_rtx (tree, int);
 
 /* Initialize the GCC target structure.  */
 #undef TARGET_ASM_BYTE_OP
@@ -215,6 +217,9 @@
 #undef TARGET_ASM_FILE_END
 #define TARGET_ASM_FILE_END c4x_file_end
 
+#undef TARGET_ASM_EXTERNAL_LIBCALL
+#define TARGET_ASM_EXTERNAL_LIBCALL c4x_external_libcall
+
 #undef TARGET_ATTRIBUTE_TABLE
 #define TARGET_ATTRIBUTE_TABLE c4x_attribute_table
 
@@ -244,6 +249,9 @@
 #undef TARGET_INIT_LIBFUNCS
 #define TARGET_INIT_LIBFUNCS c4x_init_libfuncs
 
+#undef TARGET_STRUCT_VALUE_RTX
+#define TARGET_STRUCT_VALUE_RTX c4x_struct_value_rtx
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Override command line options.
@@ -4971,4 +4979,18 @@
     default:
       return false;
     }
+}
+
+static void
+c4x_external_libcall (rtx fun)
+{
+  /* This is only needed to keep asm30 happy for ___divqf3 etc.  */
+  c4x_external_ref (XSTR (fun, 0));
+}
+
+static rtx
+c4x_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
+		      int incoming ATTRIBUTE_UNUSED)
+{
+  return gen_rtx_REG (Pmode, AR0_REGNO);
 }
Index: c4x.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/c4x/c4x.h,v
retrieving revision 1.136
diff -u -r1.136 c4x.h
--- c4x.h	5 Oct 2003 13:34:44 -0000	1.136
+++ c4x.h	24 Jan 2004 19:18:01 -0000
@@ -1160,7 +1160,6 @@
 /* How Large Values Are Returned.  */
 
 #define DEFAULT_PCC_STRUCT_RETURN	0
-#define STRUCT_VALUE_REGNUM		AR0_REGNO	/* AR0.  */
 
 /* Varargs handling.  */
 
@@ -1482,13 +1481,6 @@
 
 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
 c4x_external_ref (NAME)
-
-/* A C statement to output on FILE an assembler pseudo-op to
-   declare a library function named external.
-   (Only needed to keep asm30 happy for ___divqf3 etc.)  */
-
-#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
-c4x_external_ref (XSTR (FUN, 0))
 
 /* The prefix to add to user-visible assembler symbols.  */
 


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