Commit a55f4481 by Richard Kenner Committed by Richard Kenner

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
parent a5a8386f
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
......
......@@ -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);
}
......
......@@ -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))
......
......@@ -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
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment