print-rtl.c (print_rtx): For hard register...
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>
Wed, 31 Dec 2003 23:02:44 +0000 (23:02 +0000)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 31 Dec 2003 23:02:44 +0000 (18:02 -0500)
* print-rtl.c (print_rtx): For hard register, write out register
number and register name instead of calling PRINT_REG.
* defaults.h (PRINT_REG): Deleted.
* config/i386/i386.c (print_reg): Remove handling of CODE of -1.
Move comments here from i386.h.
(print_operand, print_operand_address): Call print_reg directly.
* config/i386/i386.h (PRINT_REG): Deleted.

From-SVN: r75282

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/defaults.h
gcc/print-rtl.c

index a21dfac2369251c3d4969f99ad5be21e2f4c378c..b197c751d409a9477448e432ecd5aff44a76b40e 100644 (file)
@@ -1,3 +1,13 @@
+2003-12-31  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * print-rtl.c (print_rtx): For hard register, write out register
+       number and register name instead of calling PRINT_REG.
+       * defaults.h (PRINT_REG): Deleted.
+       * config/i386/i386.c (print_reg): Remove handling of CODE of -1.
+       Move comments here from i386.h.
+       (print_operand, print_operand_address): Call print_reg directly.
+       * config/i386/i386.h (PRINT_REG): Deleted.
+
 2003-12-31  Roger Sayle  <roger@eyesopen.com>
 
        * config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Define
index 6a49d4212d329e3325154fb657909f5b28fc53aa..2762f6349c19007a6143dbddcb14b830746e59b6 100644 (file)
@@ -6968,17 +6968,21 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse,
   fputs (suffix, file);
 }
 
+/* Print the name of register X to FILE based on its machine mode and number.
+   If CODE is 'w', pretend the mode is HImode.
+   If CODE is 'b', pretend the mode is QImode.
+   If CODE is 'k', pretend the mode is SImode.
+   If CODE is 'q', pretend the mode is DImode.
+   If CODE is 'h', pretend the reg is the `high' byte register.
+   If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op.  */
+
 void
 print_reg (rtx x, int code, FILE *file)
 {
-  /* Code -1 indicates we are called from print_rtx, and it is not
-     an error for a virtual register to appear here.  */
-  if (code == -1)
-    code = 0;
-  else if (REGNO (x) == ARG_POINTER_REGNUM
-          || REGNO (x) == FRAME_POINTER_REGNUM
-          || REGNO (x) == FLAGS_REG
-          || REGNO (x) == FPSR_REG)
+  if (REGNO (x) == ARG_POINTER_REGNUM
+      || REGNO (x) == FRAME_POINTER_REGNUM
+      || REGNO (x) == FLAGS_REG
+      || REGNO (x) == FPSR_REG)
     abort ();
 
   if (ASSEMBLER_DIALECT == ASM_ATT || USER_LABEL_PREFIX[0] == 0)
@@ -7389,9 +7393,7 @@ print_operand (FILE *file, rtx x, int code)
     }
 
   if (GET_CODE (x) == REG)
-    {
-      PRINT_REG (x, code, file);
-    }
+    print_reg (x, code, file);
 
   else if (GET_CODE (x) == MEM)
     {
@@ -7570,11 +7572,11 @@ print_operand_address (FILE *file, rtx addr)
 
          putc ('(', file);
          if (base)
-           PRINT_REG (base, 0, file);
+           print_reg (base, 0, file);
          if (index)
            {
              putc (',', file);
-             PRINT_REG (index, 0, file);
+             print_reg (index, 0, file);
              if (scale != 1)
                fprintf (file, ",%d", scale);
            }
@@ -7609,7 +7611,7 @@ print_operand_address (FILE *file, rtx addr)
          putc ('[', file);
          if (base)
            {
-             PRINT_REG (base, 0, file);
+             print_reg (base, 0, file);
              if (offset)
                {
                  if (INTVAL (offset) >= 0)
@@ -7625,7 +7627,7 @@ print_operand_address (FILE *file, rtx addr)
          if (index)
            {
              putc ('+', file);
-             PRINT_REG (index, 0, file);
+             print_reg (index, 0, file);
              if (scale != 1)
                fprintf (file, "*%d", scale);
            }
index f328ebaff31ecaaa43cf3befbd0b3fb4ab8abadb..9ce250f4efe776393f6bcebcb847a1836b3a757c 100644 (file)
@@ -2720,7 +2720,7 @@ do {                                                      \
    For non floating point regs, the following are the HImode names.
 
    For float regs, the stack top is sometimes referred to as "%st(0)"
-   instead of just "%st".  PRINT_REG handles this with the "y" code.  */
+   instead of just "%st".  PRINT_OPERAND handles this with the "y" code.  */
 
 #define HI_REGISTER_NAMES                                              \
 {"ax","dx","cx","bx","si","di","bp","sp",                              \
@@ -2871,18 +2871,6 @@ do {                                                                     \
 #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
   ((CODE) == '*' || (CODE) == '+' || (CODE) == '&')
 
-/* Print the name of a register based on its machine mode and number.
-   If CODE is 'w', pretend the mode is HImode.
-   If CODE is 'b', pretend the mode is QImode.
-   If CODE is 'k', pretend the mode is SImode.
-   If CODE is 'q', pretend the mode is DImode.
-   If CODE is 'h', pretend the reg is the `high' byte register.
-   If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op.
-   If CODE is -1, it is not an error for X to be a virtual register.  */
-
-#define PRINT_REG(X, CODE, FILE)  \
-  print_reg ((X), (CODE), (FILE))
-
 #define PRINT_OPERAND(FILE, X, CODE)  \
   print_operand ((FILE), (X), (CODE))
 
index afe788cdd2696e2fbb7326092e3d1b4e1f9e753e..68ab0ab20b2e427bd2127e93e6b789365fd4ecc2 100644 (file)
@@ -679,12 +679,6 @@ You Lose!  You must define PREFERRED_DEBUGGING_TYPE!
 #define STACK_POINTER_OFFSET    0
 #endif
 
-/* How to print out a register name.  */
-#ifndef PRINT_REG
-#define PRINT_REG(RTX, CODE, FILE) \
-  fprintf ((FILE), "%s", reg_names[REGNO (RTX)])
-#endif
-
 #ifndef LOCAL_REGNO
 #define LOCAL_REGNO(REGNO)  0
 #endif
index 5c3b8d4443eb4752018e4cbfe68f8fb81f591ae9..f5e30fe978272480b8bba4dd1c4e3b13ea7002b3 100644 (file)
@@ -384,10 +384,8 @@ print_rtx (rtx in_rtx)
 
 #ifndef GENERATOR_FILE
            if (GET_CODE (in_rtx) == REG && value < FIRST_PSEUDO_REGISTER)
-             {
-               fputc (' ', outfile);
-               PRINT_REG (in_rtx, -1, outfile);
-             }
+             fprintf (outfile, " %d %s", REGNO (in_rtx),
+                      reg_names[REGNO (in_rtx)]);
            else if (GET_CODE (in_rtx) == REG
                     && value <= LAST_VIRTUAL_REGISTER)
              {