aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2003-12-31 23:02:44 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2003-12-31 18:02:44 -0500
commita55f4481282f3274a0712e2a1e0b80ee54b987c9 (patch)
tree5f258284a00af9c99b77923dab2e2c78109e1b51 /gcc
parenta5a8386f2d409144f400bd73d675f21e1b2396e8 (diff)
downloadgcc-a55f4481282f3274a0712e2a1e0b80ee54b987c9.zip
gcc-a55f4481282f3274a0712e2a1e0b80ee54b987c9.tar.gz
gcc-a55f4481282f3274a0712e2a1e0b80ee54b987c9.tar.bz2
print-rtl.c (print_rtx): For hard register...
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/i386/i386.c32
-rw-r--r--gcc/config/i386/i386.h14
-rw-r--r--gcc/defaults.h6
-rw-r--r--gcc/print-rtl.c6
5 files changed, 30 insertions, 38 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a21dfac..b197c75 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 6a49d42..2762f63 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -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);
}
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index f328eba..9ce250f 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -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))
diff --git a/gcc/defaults.h b/gcc/defaults.h
index afe788c..68ab0ab 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -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
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 5c3b8d4..f5e30fe 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -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)
{