+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
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)
}
if (GET_CODE (x) == REG)
- {
- PRINT_REG (x, code, file);
- }
+ print_reg (x, code, file);
else if (GET_CODE (x) == MEM)
{
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);
}
putc ('[', file);
if (base)
{
- PRINT_REG (base, 0, file);
+ print_reg (base, 0, file);
if (offset)
{
if (INTVAL (offset) >= 0)
if (index)
{
putc ('+', file);
- PRINT_REG (index, 0, file);
+ print_reg (index, 0, file);
if (scale != 1)
fprintf (file, "*%d", scale);
}
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", \
#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))
#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
#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)
{