public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernardo Innocenti <bernie@develer.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Richard Henderson <rth@redhat.com>,
	Andreas Schwab <schwab@suse.de>,  Gunther Nikl <gni@gecko.de>
Subject: [PATCH]
Date: Sat, 21 Feb 2004 13:45:00 -0000	[thread overview]
Message-ID: <4026A785.6020008@develer.com> (raw)
Message-ID: <20040221134500.FvsuQ-v8AQbHdbAi1H8gjtFQyTCEQvVqQ7crQMKo1g0@z> (raw)


Followup of previous patch by Andreas Schwab, reworked
later by me and then discussed with Gunther Nikl.
This version should hopefully make everyone happy happy :-)


Tested on m68k-uclinux, m68k-netbsd and m68k-linux.

2004-02-08  Andreas Schwab  <schwab@suse.de>
            Bernardo Innocenti  <bernie@develer.com>

	* config/m68k/m68k.h (REGISTER_NAMES): Prefix each name with
	REGISTER_PREFIX.
	* (M68K_FP_REG_NAME): New macro to specify an alternate name for the
	frame pointer register, overridable by OS targets.
	* (M68K_REGNAME): Macro to obtain register name for asm output,
	eventually replacing %a6 with M68K_FP_REG_NAME.
	* config/m68k/coff.h (REGISTER_NAMES): Don't redefine.
	* config/m68k/linux.h (REGISTER_NAMES): Likewise.
	* config/m68k/m68kelf.h (REGISTER_NAMES): Likewise.
	* config/m68k/netbsd-elf.h (REGISTER_NAMES): Likewise.
	* config/m68k/m68k.c: Use M68K_REGNAME(x) in place of reg_names[x].

diff -u -p -a -r1.17 coff.h
--- gcc-3.4.old/gcc/config/m68k/coff.h	27 Sep 2003 04:48:24 -0000	1.17
+++ gcc-3.4/gcc/config/m68k/coff.h	13 Jan 2004 12:56:19 -0000
@@ -1,6 +1,6 @@
 /* Definitions of target machine for GNU compiler.
    m68k series COFF object files and debugging, version.
-   Copyright (C) 1994, 1996, 1997, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1996, 1997, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -67,14 +67,6 @@ Boston, MA 02111-1307, USA.  */
     else						\
       return "jmp %%pc@(2,%0:w)";			\
   } while (0)
-
-/* Here are the new register names.  */
-
-#undef REGISTER_NAMES
-#define REGISTER_NAMES \
-{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",	\
- "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp",	\
- "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", "argptr" }
 
 #define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
 
diff -u -p -a -r1.39 linux.h
--- gcc-3.4/gcc/config/m68k/linux.h	29 Nov 2003 03:08:11 -0000	1.39
+++ gcc-3.4/gcc/config/m68k/linux.h	13 Jan 2004 12:56:19 -0000
@@ -1,6 +1,6 @@
 /* Definitions for Motorola 68k running Linux-based GNU systems with
    ELF format.
-   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -58,17 +58,6 @@ Boston, MA 02111-1307, USA.  */
 #define USER_LABEL_PREFIX ""
 
 #define ASM_COMMENT_START "|"
-
-/* How to refer to registers in assembler output.
-   This sequence is indexed by compiler's hard-register-number.
-   Motorola format uses different register names than defined in m68k.h.  */
-
-#undef REGISTER_NAMES
-
-#define REGISTER_NAMES \
-{"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
- "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%sp", \
- "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7", "argptr" }
 
 #undef SIZE_TYPE
 #define SIZE_TYPE "unsigned int"
diff -u -p -a -r1.103 m68k.h
--- gcc-3.4/gcc/config/m68k/m68k.h	13 Dec 2003 04:44:07 -0000	1.103
+++ gcc-3.4/gcc/config/m68k/m68k.h	13 Jan 2004 12:56:19 -0000
@@ -1,7 +1,7 @@
 /* Definitions of target machine for GNU compiler.
    Sun 68000/68020 version.
    Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -1462,9 +1462,26 @@ do { if (cc_prev_status.flags & CC_IN_68
    This sequence is indexed by compiler's hard-register-number (see above).  */
 
 #define REGISTER_NAMES \
-{"d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",	\
- "a0", "a1", "a2", "a3", "a4", "a5", "a6", "sp",	\
- "fp0", "fp1", "fp2", "fp3", "fp4", "fp5", "fp6", "fp7", "argptr" }
+{REGISTER_PREFIX"d0", REGISTER_PREFIX"d1", REGISTER_PREFIX"d2",	\
+ REGISTER_PREFIX"d3", REGISTER_PREFIX"d4", REGISTER_PREFIX"d5",	\
+ REGISTER_PREFIX"d6", REGISTER_PREFIX"d7",			\
+ REGISTER_PREFIX"a0", REGISTER_PREFIX"a1", REGISTER_PREFIX"a2", \
+ REGISTER_PREFIX"a3", REGISTER_PREFIX"a4", REGISTER_PREFIX"a5", \
+ REGISTER_PREFIX"a6", REGISTER_PREFIX"sp",			\
+ REGISTER_PREFIX"fp0", REGISTER_PREFIX"fp1", REGISTER_PREFIX"fp2", \
+ REGISTER_PREFIX"fp3", REGISTER_PREFIX"fp4", REGISTER_PREFIX"fp5", \
+ REGISTER_PREFIX"fp6", REGISTER_PREFIX"fp7", REGISTER_PREFIX"argptr" }
+
+#define M68K_FP_REG_NAME REGISTER_PREFIX"fp"
+
+  /* Return a register name by index, handling %fp nicely.
+     We don't replace %fp for targets that don't map it to %a6
+     since it may confuse GAS.  */
+#define M68K_REGNAME(r) ( \
+  ((FRAME_POINTER_REGNUM == 14) \
+    && ((r) == FRAME_POINTER_REGNUM) \
+    && frame_pointer_needed) ? \
+    M68K_FP_REG_NAME : reg_names[(r)])
 
 /* How to renumber registers for dbx and gdb.
    On the Sun-3, the floating point registers have numbers
diff -u -p -a -r1.24 m68kelf.h
--- gcc-3.4/gcc/config/m68k/m68kelf.h	30 Nov 2003 04:20:27 -0000	1.24
+++ gcc-3.4/gcc/config/m68k/m68kelf.h	13 Jan 2004 12:56:19 -0000
@@ -1,7 +1,7 @@
 /* m68kelf support, derived from m68kv4.h */
 
 /* Target definitions for GNU compiler for mc680x0 running System V.4
-   Copyright (C) 1991, 1993, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1993, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
 
    Written by Ron Guilmette (rfg@netcom.com) and Fred Fish (fnf@cygnus.com).
 
@@ -76,18 +76,6 @@ Boston, MA 02111-1307, USA.  */
     else						\
       return "jmp %%pc@(2,%0:w)";			\
   } while (0)
-
-/* How to refer to registers in assembler output.
-   This sequence is indexed by compiler's hard-register-number.
-   Motorola format uses different register names than defined 
-   in m68k.h.  */
-
-#undef REGISTER_NAMES
-
-#define REGISTER_NAMES \
-{"%d0",   "%d1",   "%d2",   "%d3",   "%d4",   "%d5",   "%d6",   "%d7",	     \
- "%a0",   "%a1",   "%a2",   "%a3",   "%a4",   "%a5",   "%a6",   "%sp",	     \
- "%fp0",  "%fp1",  "%fp2",  "%fp3",  "%fp4",  "%fp5",  "%fp6",  "%fp7", "argptr" }
 
 /* This is how to output an assembler line that says to advance the
    location counter to a multiple of 2**LOG bytes.  */
diff -u -p -a -r1.19 netbsd-elf.h
--- gcc-3.4/gcc/config/m68k/netbsd-elf.h	30 Nov 2003 04:20:28 -0000	1.19
+++ gcc-3.4/gcc/config/m68k/netbsd-elf.h	13 Jan 2004 12:56:19 -0000
@@ -173,19 +173,6 @@ while (0)
 
 #undef ASM_COMMENT_START
 #define ASM_COMMENT_START "|"
-
-
-/* How to refer to registers in assembler output.
-   This sequence is indexed by compiler's hard-register-number.
-   Motorola format uses different register names than defined in m68k.h.
-   We also take this chance to convert 'a6' to 'fp' */
-
-#undef REGISTER_NAMES
-
-#define REGISTER_NAMES							\
-{"%d0",   "%d1",   "%d2",   "%d3",   "%d4",   "%d5",   "%d6",   "%d7",	\
- "%a0",   "%a1",   "%a2",   "%a3",   "%a4",   "%a5",   "%fp",   "%sp",	\
- "%fp0",  "%fp1",  "%fp2",  "%fp3",  "%fp4",  "%fp5",  "%fp6",  "%fp7", "argptr" }
 
 
 /* Currently, JUMP_TABLES_IN_TEXT_SECTION must be defined in order to
diff -u -p -r1.122 m68k.c
--- gcc-3.4.old/gcc/config/m68k/m68k.c	5 Jan 2004 04:13:49 -0000	1.122
+++ gcc-3.4/gcc/config/m68k/m68k.c	15 Jan 2004 23:38:08 -0000
@@ -491,25 +491,25 @@ m68k_output_function_prologue (FILE *str
 	fprintf (stream, MOTOROLA ?
 			   "\tpea (%s)\n\tmove.l %s,%s\n" :
 			   "\tpea %s@\n\tmovel %s,%s\n",
-		 reg_names[FRAME_POINTER_REGNUM],
-		 reg_names[STACK_POINTER_REGNUM],
-		 reg_names[FRAME_POINTER_REGNUM]);
+		 M68K_REGNAME(FRAME_POINTER_REGNUM),
+		 M68K_REGNAME(STACK_POINTER_REGNUM),
+		 M68K_REGNAME(FRAME_POINTER_REGNUM));
       else if (fsize_with_regs < 0x8000)
 	asm_fprintf (stream, "\tlink" ASM_DOTW " %s,%I%wd\n",
-		     reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
+		     M68K_REGNAME(FRAME_POINTER_REGNUM), -fsize_with_regs);
       else if (TARGET_68020)
 	asm_fprintf (stream, "\tlink" ASM_DOTL " %s,%I%wd\n",
-		     reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
+		     M68K_REGNAME(FRAME_POINTER_REGNUM), -fsize_with_regs);
       else
 	/* Adding negative number is faster on the 68040.  */
 	asm_fprintf (stream, "\tlink" ASM_DOTW " %s,%I0\n"
 			     "\tadd" ASM_DOT "l %I%wd,%Rsp\n",
-		     reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
+		     M68K_REGNAME(FRAME_POINTER_REGNUM), -fsize_with_regs);
 
       if (dwarf2out_do_frame ())
 	{
 	  char *l;
-          l = (char *) dwarf2out_cfi_label ();   
+          l = (char *) dwarf2out_cfi_label ();
 	  cfa_offset += 4;
 	  dwarf2out_reg_save (l, FRAME_POINTER_REGNUM, -cfa_offset);
 	  dwarf2out_def_cfa (l, FRAME_POINTER_REGNUM, cfa_offset);
@@ -577,17 +577,17 @@ m68k_output_function_prologue (FILE *str
 	}
     }
 
-  /* If the stack limit is not a symbol, check it here.  
+  /* If the stack limit is not a symbol, check it here.
      This has the disadvantage that it may be too late...  */
   if (current_function_limit_stack)
     {
       if (REG_P (stack_limit_rtx))
 	asm_fprintf (stream, "\tcmp" ASM_DOT "l %s,%Rsp\n\ttrapcs\n",
-		     reg_names[REGNO (stack_limit_rtx)]);
+		     M68K_REGNAME(REGNO (stack_limit_rtx)));
       else if (GET_CODE (stack_limit_rtx) != SYMBOL_REF)
 	warning ("stack limit expression is not supported");
     }
-  
+
   if (current_frame.reg_no <= 2)
     {
       /* Store each separately in the same order moveml uses.
@@ -603,22 +603,22 @@ m68k_output_function_prologue (FILE *str
 	    asm_fprintf (stream, MOTOROLA ?
 				   "\t%Omove.l %s,-(%Rsp)\n" :
 				   "\tmovel %s,%Rsp@-\n",
-			 reg_names[15 - i]);
+			 M68K_REGNAME(15 - i));
 	    if (dwarf2out_do_frame ())
 	      {
 		char *l = (char *) dwarf2out_cfi_label ();
 
 		cfa_offset += 4;
- 		if (! frame_pointer_needed)
- 		  dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, cfa_offset);
- 		dwarf2out_reg_save (l, 15 - i, -cfa_offset);
+		if (! frame_pointer_needed)
+		  dwarf2out_def_cfa (l, STACK_POINTER_REGNUM, cfa_offset);
+		dwarf2out_reg_save (l, 15 - i, -cfa_offset);
 	      }
 	  }
     }
   else if (current_frame.reg_rev_mask)
     {
       if (TARGET_COLDFIRE)
-	/* The ColdFire does not support the predecrement form of the 
+	/* The ColdFire does not support the predecrement form of the
 	   MOVEM instruction, so we must adjust the stack pointer and
 	   then use the plain address register indirect mode.
 	   The required register save space was combined earlier with
@@ -653,22 +653,22 @@ m68k_output_function_prologue (FILE *str
       if (TARGET_ID_SHARED_LIBRARY)
 	{
 	  asm_fprintf (stream, "\tmovel %s@(%s), %s\n",
-		       reg_names[PIC_OFFSET_TABLE_REGNUM],
+		       M68K_REGNAME(PIC_OFFSET_TABLE_REGNUM),
 		       m68k_library_id_string,
-		       reg_names[PIC_OFFSET_TABLE_REGNUM]);
+		       M68K_REGNAME(PIC_OFFSET_TABLE_REGNUM));
 	}
       else
 	{
 	  if (MOTOROLA)
 	    asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
-	    		 reg_names[PIC_OFFSET_TABLE_REGNUM]);
+			 M68K_REGNAME(PIC_OFFSET_TABLE_REGNUM));
 	  else
 	    {
 	      asm_fprintf (stream, "\tmovel %I%U_GLOBAL_OFFSET_TABLE_, %s\n",
-			   reg_names[PIC_OFFSET_TABLE_REGNUM]);
+			   M68K_REGNAME(PIC_OFFSET_TABLE_REGNUM));
 	      asm_fprintf (stream, "\tlea %Rpc@(0,%s:l),%s\n",
-			   reg_names[PIC_OFFSET_TABLE_REGNUM],
-			   reg_names[PIC_OFFSET_TABLE_REGNUM]);
+			   M68K_REGNAME(PIC_OFFSET_TABLE_REGNUM),
+			   M68K_REGNAME(PIC_OFFSET_TABLE_REGNUM));
 	    }
 	}
     }
@@ -771,31 +771,31 @@ m68k_output_function_epilogue (FILE *str
 		if (MOTOROLA)
 		  asm_fprintf (stream, "\t%Omove.l -%wd(%s,%Ra1.l),%s\n",
 			       offset,
-			       reg_names[FRAME_POINTER_REGNUM],
-			       reg_names[i]);
+			       M68K_REGNAME(FRAME_POINTER_REGNUM),
+			       M68K_REGNAME(i));
 		else
 		  asm_fprintf (stream, "\tmovel %s@(-%wd,%Ra1:l),%s\n",
-			       reg_names[FRAME_POINTER_REGNUM],
+			       M68K_REGNAME(FRAME_POINTER_REGNUM),
 			       offset,
-			       reg_names[i]);
+			       M68K_REGNAME(i));
 	      }
             else if (restore_from_sp)
 	      asm_fprintf (stream, MOTOROLA ?
 				     "\t%Omove.l (%Rsp)+,%s\n" :
 				     "\tmovel %Rsp@+,%s\n",
-			   reg_names[i]);
+			   M68K_REGNAME(i));
             else
 	      {
 	        if (MOTOROLA)
 		  asm_fprintf (stream, "\t%Omove.l -%wd(%s),%s\n",
 			       offset,
-			       reg_names[FRAME_POINTER_REGNUM],
-			       reg_names[i]);
+			       M68K_REGNAME(FRAME_POINTER_REGNUM),
+			       M68K_REGNAME(i));
 		else
 		  asm_fprintf (stream, "\tmovel %s@(-%wd),%s\n",
-			       reg_names[FRAME_POINTER_REGNUM],
+			       M68K_REGNAME(FRAME_POINTER_REGNUM),
 			       offset,
-			       reg_names[i]);
+			       M68K_REGNAME(i));
 	      }
             offset -= 4;
           }
@@ -808,7 +808,7 @@ m68k_output_function_epilogue (FILE *str
           if (big)
             {
               asm_fprintf (stream, "\tadd" ASM_DOT "l %s,%Ra1\n",
-	      		   reg_names[FRAME_POINTER_REGNUM]);
+			   M68K_REGNAME(FRAME_POINTER_REGNUM));
               asm_fprintf (stream, MOTOROLA ?
 				     "\tmovm.l (%Ra1),%I0x%x\n" :
 				     "\tmoveml %Ra1@,%I0x%x\n",
@@ -824,11 +824,11 @@ m68k_output_function_epilogue (FILE *str
 	      if (MOTOROLA)
 		asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n",
 			     current_frame.offset + fsize,
-			     reg_names[FRAME_POINTER_REGNUM],
+			     M68K_REGNAME(FRAME_POINTER_REGNUM),
 			     current_frame.reg_mask);
 	      else
 		asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n",
-			     reg_names[FRAME_POINTER_REGNUM],
+			     M68K_REGNAME(FRAME_POINTER_REGNUM),
 			     current_frame.offset + fsize,
 			     current_frame.reg_mask);
 	    }
@@ -840,11 +840,11 @@ m68k_output_function_epilogue (FILE *str
 	      if (MOTOROLA)
 		asm_fprintf (stream, "\tmovm.l -%wd(%s,%Ra1.l),%I0x%x\n",
 			     current_frame.offset + fsize,
-			     reg_names[FRAME_POINTER_REGNUM],
+			     M68K_REGNAME(FRAME_POINTER_REGNUM),
 			     current_frame.reg_mask);
 	      else
 		asm_fprintf (stream, "\tmoveml %s@(-%wd,%Ra1:l),%I0x%x\n",
-			     reg_names[FRAME_POINTER_REGNUM],
+			     M68K_REGNAME(FRAME_POINTER_REGNUM),
 			     current_frame.offset + fsize,
 			     current_frame.reg_mask);
 	    }
@@ -860,11 +860,11 @@ m68k_output_function_epilogue (FILE *str
 	      if (MOTOROLA)
 		asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n",
 			     current_frame.offset + fsize,
-			     reg_names[FRAME_POINTER_REGNUM],
+			     M68K_REGNAME(FRAME_POINTER_REGNUM),
 			     current_frame.reg_mask);
 	      else
 		asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n",
-			     reg_names[FRAME_POINTER_REGNUM],
+			     M68K_REGNAME(FRAME_POINTER_REGNUM),
 			     current_frame.offset + fsize,
 			     current_frame.reg_mask);
 	    }
@@ -877,11 +877,11 @@ m68k_output_function_epilogue (FILE *str
 	  if (MOTOROLA)
 	    asm_fprintf (stream, "\tfmovm -%wd(%s,%Ra1.l),%I0x%x\n",
 		         current_frame.foffset + fsize,
-		         reg_names[FRAME_POINTER_REGNUM],
+		         M68K_REGNAME(FRAME_POINTER_REGNUM),
 		         current_frame.fpu_rev_mask);
 	  else
 	    asm_fprintf (stream, "\tfmovem %s@(-%wd,%Ra1:l),%I0x%x\n",
-			 reg_names[FRAME_POINTER_REGNUM],
+			 M68K_REGNAME(FRAME_POINTER_REGNUM),
 			 current_frame.foffset + fsize,
 			 current_frame.fpu_rev_mask);
 	}
@@ -899,18 +899,17 @@ m68k_output_function_epilogue (FILE *str
 	  if (MOTOROLA)
 	    asm_fprintf (stream, "\tfmovm -%wd(%s),%I0x%x\n",
 			 current_frame.foffset + fsize,
-			 reg_names[FRAME_POINTER_REGNUM],
+			 M68K_REGNAME(FRAME_POINTER_REGNUM),
 			 current_frame.fpu_rev_mask);
 	  else
 	    asm_fprintf (stream, "\tfmovem %s@(-%wd),%I0x%x\n",
-			 reg_names[FRAME_POINTER_REGNUM],
+			 M68K_REGNAME(FRAME_POINTER_REGNUM),
 			 current_frame.foffset + fsize,
 			 current_frame.fpu_rev_mask);
 	}
     }
   if (frame_pointer_needed)
-    fprintf (stream, "\tunlk %s\n",
-	     reg_names[FRAME_POINTER_REGNUM]);
+    fprintf (stream, "\tunlk %s\n", M68K_REGNAME(FRAME_POINTER_REGNUM));
   else if (fsize_with_regs)
     {
       if (fsize_with_regs <= 8)
@@ -2696,7 +2698,7 @@ print_operand (FILE *file, rtx op, int l
     {
       /* This is only for direct addresses with TARGET_PCREL */
       if (GET_CODE (op) != MEM || GET_CODE (XEXP (op, 0)) != SYMBOL_REF
-          || !TARGET_PCREL) 
+          || !TARGET_PCREL)
 	abort ();
       output_addr_const (file, XEXP (op, 0));
     }
@@ -2705,9 +2707,9 @@ print_operand (FILE *file, rtx op, int l
       if (letter == 'R')
 	/* Print out the second register name of a register pair.
 	   I.e., R (6) => 7.  */
-	fputs (reg_names[REGNO (op) + 1], file);
+	fputs (M68K_REGNAME(REGNO (op) + 1), file);
       else
-	fputs (reg_names[REGNO (op)], file);
+	fputs (M68K_REGNAME(REGNO (op)), file);
     }
   else if (GET_CODE (op) == MEM)
     {
@@ -2805,15 +2807,15 @@ print_operand_address (FILE *file, rtx a
   switch (GET_CODE (addr))
     {
       case REG:
-	fprintf (file, MOTOROLA ? "(%s)" : "%s@", reg_names[REGNO (addr)]);
+	fprintf (file, MOTOROLA ? "(%s)" : "%s@", M68K_REGNAME(REGNO (addr)));
 	break;
       case PRE_DEC:
 	fprintf (file, MOTOROLA ? "-(%s)" : "%s@-",
-	         reg_names[REGNO (XEXP (addr, 0))]);
+	         M68K_REGNAME(REGNO (XEXP (addr, 0))));
 	break;
       case POST_INC:
 	fprintf (file, MOTOROLA ? "(%s)+" : "%s@+",
-		 reg_names[REGNO (XEXP (addr, 0))]);
+		 M68K_REGNAME(REGNO (XEXP (addr, 0))));
 	break;
       case PLUS:
 	reg1 = reg2 = ireg = breg = offset = 0;
@@ -2922,14 +2924,14 @@ print_operand_address (FILE *file, rtx a
 	      {
 		ASM_OUTPUT_CASE_FETCH (file,
 			     CODE_LABEL_NUMBER (XEXP (addr, 0)),
-			     reg_names[REGNO (XEXP (ireg, 0))]);
+			     M68K_REGNAME(REGNO (XEXP (ireg, 0))));
 		fprintf (file, "w");
 	      }
 	    else
 	      {
 		ASM_OUTPUT_CASE_FETCH (file,
 			     CODE_LABEL_NUMBER (XEXP (addr, 0)),
-			     reg_names[REGNO (ireg)]);
+			     M68K_REGNAME(REGNO (ireg)));
 		fprintf (file, "l");
 	      }
 	    if (scale != 1)
@@ -2942,7 +2944,7 @@ print_operand_address (FILE *file, rtx a
 	  {
 	    ASM_OUTPUT_CASE_FETCH (file,
 			 CODE_LABEL_NUMBER (XEXP (addr, 0)),
-			 reg_names[REGNO (breg)]);
+			 M68K_REGNAME(REGNO (breg)));
 	    fprintf (file, "l)");
 	    break;
 	  }
@@ -2969,13 +2971,13 @@ print_operand_address (FILE *file, rtx a
 			  fprintf (file, ".w");
 		      }
 		  }
-		fprintf (file, "(%s", reg_names[REGNO (breg)]);
+		fprintf (file, "(%s", M68K_REGNAME(REGNO (breg)));
 		if (ireg != 0)
 		  putc (',', file);
 	      }
 	    else /* !MOTOROLA */
 	      {
-		fprintf (file, "%s@(", reg_names[REGNO (breg)]);
+		fprintf (file, "%s@(", M68K_REGNAME(REGNO (breg)));
 		if (addr != 0)
 		  {
 		    output_addr_const (file, addr);
@@ -3000,21 +3002,21 @@ print_operand_address (FILE *file, rtx a
 	      }
 	    if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND)
 	      fprintf (file, MOTOROLA ? "%s.w" : "%s:w",
-		       reg_names[REGNO (XEXP (ireg, 0))]);
+		       M68K_REGNAME(REGNO (XEXP (ireg, 0))));
 	    else if (ireg != 0)
 	      fprintf (file, MOTOROLA ? "%s.l" : "%s:l",
-		       reg_names[REGNO (ireg)]);
+		       M68K_REGNAME(REGNO (ireg)));
 	    if (scale != 1)
 	      fprintf (file, MOTOROLA ? "*%d" : ":%d", scale);
 	    putc (')', file);
 	    break;
 	  }
 	else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF
-		 && ! (flag_pic && reg1 == pic_offset_table_rtx))	
+		 && ! (flag_pic && reg1 == pic_offset_table_rtx))
 	  {
 	    ASM_OUTPUT_CASE_FETCH (file,
 			 CODE_LABEL_NUMBER (XEXP (addr, 0)),
-			 reg_names[REGNO (reg1)]);
+			 M68K_REGNAME(REGNO (reg1)));
 	    fprintf (file, "l)");
 	    break;
 	  }


-- 
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/


             reply	other threads:[~2004-02-08 21:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-08 22:05 Bernardo Innocenti [this message]
2004-02-08 22:07 ` [m68k] factorize REGISTER_NAMES Bernardo Innocenti
2004-02-21 13:45   ` Bernardo Innocenti
2004-02-08 22:55 ` [PATCH] Richard Henderson
2004-02-21 13:45   ` [PATCH] Richard Henderson
2004-02-21 13:45 ` [PATCH] Bernardo Innocenti
     [not found] <ormtqpsbuc.fsf@lxoliva.fsfla.org>
2021-09-09  7:11 ` [PATCH] strub: machine-independent stack scrubbing Alexandre Oliva
2022-07-29  6:16   ` [PATCH v2 00/10] Introduce " Alexandre Oliva
2023-06-16  6:09     ` [PATCH v3] " Alexandre Oliva
2023-10-20  6:03       ` [PATCH v4] " Alexandre Oliva
2023-10-26  6:15         ` Alexandre Oliva
2023-11-20 12:40           ` Alexandre Oliva
2023-11-22 14:14             ` Richard Biener
2023-11-23 10:56               ` Alexandre Oliva
2023-11-23 12:05                 ` Richard Biener
2023-11-29  8:53                   ` Alexandre Oliva
2023-11-29 12:48                     ` Richard Biener
2023-11-30  4:13                       ` Alexandre Oliva
2023-11-30 12:00                         ` Richard Biener
2023-12-02 17:56                           ` [PATCH v5] " Alexandre Oliva
2023-12-06  8:36                             ` Causes to nvptx bootstrap fail: " Tobias Burnus
2023-12-06 11:32                               ` Thomas Schwinge
2023-12-06 22:12                                 ` Alexandre Oliva
2023-12-07  3:33                                   ` [PATCH] strub: enable conditional support Alexandre Oliva
2023-12-07 16:44                                     ` Thomas Schwinge
2023-12-07 17:52                                       ` [PATCH] Alexandre Oliva
2023-12-08  6:46                                         ` [PATCH] Richard Biener
  -- strict thread matches above, loose matches on Subject: below --
2006-10-10 19:31 [PATCH]: Kaveh R. GHAZI
2006-05-10 10:44 [patch] François-Xavier Coudert
     [not found] <no.id>
2004-05-04  0:50 ` [PATCH] Ulrich Weigand
2004-05-04  0:52   ` [PATCH] Eric Christopher
2004-05-04  0:42 [PATCH] Ulrich Weigand
2004-05-04  0:52 ` [PATCH] Eric Christopher
2004-05-04  1:14   ` [PATCH] Ulrich Weigand
2004-05-04  2:05     ` [PATCH] Eric Christopher
2004-05-04  1:11 ` [PATCH] Eric Christopher
2004-05-04  1:14   ` [PATCH] Ulrich Weigand
2004-05-04  0:26 [PATCH] Eric Christopher
2003-12-16 14:00 [PATCH] Hartmut Penner
2003-12-16 17:36 ` [PATCH] Zack Weinberg
2003-02-20 12:36 [PATCH] Zdenek Dvorak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4026A785.6020008@develer.com \
    --to=bernie@develer.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gni@gecko.de \
    --cc=rth@redhat.com \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).