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]

[cris] hookize PRINT_OPERAND &co.


The patch below converts the cris port to TARGET_PRINT_OPERAND &co.  I am
planning to commit this at the end of the week if there are no comments.

Tested on cris-elf.

-Nathan

	* cris-protos.h (cris_print_operand): Delete.
	(cris_print_operand_address): Delete.
	* cris.h (PRINT_OPERAND): Delete.
	(PRINT_OPERAND_PUNCT_VALID_P): Delete.
	(PRINT_OPERAND_ADDRESS): Delete.
	* cris.c (cris_print_operand_address): Make static.
	(cris_print_operand): Make static.
	(cris_print_operand_punct_valid_p): New function.
	(TARGET_PRINT_OPERAND, TARGET_PRINT_OPERAND_ADDRESS):
	(TARGET_PRINT_OPERAND_ADDRESS): Define.

--- a/gcc/config/cris/cris-protos.h
+++ b/gcc/config/cris/cris-protos.h
@@ -33,8 +33,6 @@ extern void cris_notice_update_cc (rtx, rtx);
 extern bool cris_reload_address_legitimized (rtx, enum machine_mode, int, int, int);
 extern int cris_register_move_cost (enum machine_mode, enum reg_class,
 				    enum reg_class);
-extern void cris_print_operand (FILE *, rtx, int);
-extern void cris_print_operand_address (FILE *, rtx);
 extern int cris_side_effect_mode_ok (enum rtx_code, rtx *, int, int,
                                      int, int, int);
 extern bool cris_cc0_user_requires_cmp (rtx);
--- a/gcc/config/cris/cris.c
+++ b/gcc/config/cris/cris.c
@@ -108,6 +108,12 @@ static void cris_operand_lossage (const char *, rtx);
 
 static int cris_reg_saved_in_regsave_area  (unsigned int, bool);
 
+static void cris_print_operand (FILE *, rtx, int);
+
+static void cris_print_operand_address (FILE *, rtx);
+
+static bool cris_print_operand_punct_valid_p (unsigned char code);
+
 static void cris_asm_output_mi_thunk
   (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
 
@@ -158,6 +164,13 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
 #undef TARGET_ASM_UNALIGNED_DI_OP
 #define TARGET_ASM_UNALIGNED_DI_OP TARGET_ASM_ALIGNED_DI_OP
 
+#undef TARGET_PRINT_OPERAND
+#define TARGET_PRINT_OPERAND cris_print_operand
+#undef TARGET_PRINT_OPERAND_ADDRESS
+#define TARGET_PRINT_OPERAND_ADDRESS cris_print_operand_address
+#undef TARGET_PRINT_OPERAND_PUNCT_VALID_P
+#define TARGET_PRINT_OPERAND_PUNCT_VALID_P cris_print_operand_punct_valid_p
+
 #undef TARGET_ASM_OUTPUT_MI_THUNK
 #define TARGET_ASM_OUTPUT_MI_THUNK cris_asm_output_mi_thunk
 #undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -687,7 +700,7 @@ saved_regs_mentioned (rtx x)
 
 /* The PRINT_OPERAND worker.  */
 
-void
+static void
 cris_print_operand (FILE *file, rtx x, int code)
 {
   rtx operand = x;
@@ -1114,9 +1127,15 @@ cris_print_operand (FILE *file, rtx x, int code)
     }
 }
 
+static bool
+cris_print_operand_punct_valid_p (unsigned char code)
+{
+  return (code == '#' || code == '!' || code == ':');
+}
+
 /* The PRINT_OPERAND_ADDRESS worker.  */
 
-void
+static void
 cris_print_operand_address (FILE *file, rtx x)
 {
   /* All these were inside MEM:s so output indirection characters.  */
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -1253,16 +1253,6 @@ enum cris_pic_symbol_type
 #define ADDITIONAL_REGISTER_NAMES \
  {{"r14", 14}, {"r15", 15}, {"pc", 15}}
 
-#define PRINT_OPERAND(FILE, X, CODE)		\
- cris_print_operand (FILE, X, CODE)
-
-/* For delay-slot handling.  */
-#define PRINT_OPERAND_PUNCT_VALID_P(CODE)	\
- ((CODE) == '#' || (CODE) == '!' || (CODE) == ':')
-
-#define PRINT_OPERAND_ADDRESS(FILE, ADDR)	\
-   cris_print_operand_address (FILE, ADDR)
-
 /* Output an empty line to illustrate the presence of the delay slot.  */
 #define DBR_OUTPUT_SEQEND(FILE) \
   fprintf (FILE, "\n")


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