Commit 714b019c by Richard Henderson Committed by Richard Henderson

alpha.h (PRINT_OPERAND_ADDRESS): Break out to ...

        * alpha.h (PRINT_OPERAND_ADDRESS): Break out to ...
        * alpha.c (print_operand_address): here.  Handle subregs.

From-SVN: r26616
parent 4d9a07db
Sat Apr 24 20:49:20 1999 Richard Henderson <rth@cygnus.com>
* alpha.h (PRINT_OPERAND_ADDRESS): Break out to ...
* alpha.c (print_operand_address): here. Handle subregs.
Fri Apr 23 22:35:41 EDT 1999 John Wehle (john@feith.com) Fri Apr 23 22:35:41 EDT 1999 John Wehle (john@feith.com)
* acconfig.h (HAVE_GAS_FILDS_FISTS): Add. * acconfig.h (HAVE_GAS_FILDS_FISTS): Add.
......
...@@ -2930,6 +2930,40 @@ print_operand (file, x, code) ...@@ -2930,6 +2930,40 @@ print_operand (file, x, code)
} }
} }
void
print_operand_address (file, addr)
FILE *file;
rtx addr;
{
rtx basereg = NULL_RTX;
HOST_WIDE_INT offset = 0;
if (GET_CODE (addr) == AND)
addr = XEXP (addr, 0);
if (GET_CODE (addr) == SUBREG)
addr = SUBREG_REG (addr);
if (GET_CODE (addr) == REG)
basereg = addr;
else if (GET_CODE (addr) == CONST_INT)
offset = INTVAL (addr);
else if (GET_CODE (addr) == PLUS
&& GET_CODE (XEXP (addr, 1)) == CONST_INT)
{
offset = INTVAL (XEXP (addr, 1));
basereg = XEXP (addr, 0);
if (GET_CODE (basereg) == SUBREG)
basereg = SUBREG_REG (basereg);
if (GET_CODE (basereg) != REG)
abort ();
}
else
abort ();
fprintf (file, HOST_WIDE_INT_PRINT_DEC, offset);
fprintf (file, "($%d)", basereg ? REGNO (basereg) : 31);
}
/* Emit RTL insns to initialize the variable parts of a trampoline at /* Emit RTL insns to initialize the variable parts of a trampoline at
TRAMP. FNADDR is an RTX for the address of the function's pure TRAMP. FNADDR is an RTX for the address of the function's pure
code. CXT is an RTX for the static chain value for the function. code. CXT is an RTX for the static chain value for the function.
......
...@@ -2298,27 +2298,8 @@ do { \ ...@@ -2298,27 +2298,8 @@ do { \
/* Print a memory address as an operand to reference that memory location. */ /* Print a memory address as an operand to reference that memory location. */
#define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
{ rtx addr = (ADDR); \ print_operand_address((FILE), (ADDR))
int basereg = 31; \
HOST_WIDE_INT offset = 0; \
\
if (GET_CODE (addr) == AND) \
addr = XEXP (addr, 0); \
\
if (GET_CODE (addr) == REG) \
basereg = REGNO (addr); \
else if (GET_CODE (addr) == CONST_INT) \
offset = INTVAL (addr); \
else if (GET_CODE (addr) == PLUS \
&& GET_CODE (XEXP (addr, 0)) == REG \
&& GET_CODE (XEXP (addr, 1)) == CONST_INT) \
basereg = REGNO (XEXP (addr, 0)), offset = INTVAL (XEXP (addr, 1)); \
else \
abort (); \
\
fprintf (FILE, HOST_WIDE_INT_PRINT_DEC, offset); \
fprintf (FILE, "($%d)", basereg); \
}
/* Define the codes that are matched by predicates in alpha.c. */ /* Define the codes that are matched by predicates in alpha.c. */
#define PREDICATE_CODES \ #define PREDICATE_CODES \
...@@ -2524,6 +2505,7 @@ extern int current_file_function_operand (); ...@@ -2524,6 +2505,7 @@ extern int current_file_function_operand ();
extern int alpha_sa_size (); extern int alpha_sa_size ();
extern int alpha_adjust_cost (); extern int alpha_adjust_cost ();
extern void print_operand (); extern void print_operand ();
extern void print_operand_address ();
extern int reg_or_0_operand (); extern int reg_or_0_operand ();
extern int reg_or_8bit_operand (); extern int reg_or_8bit_operand ();
extern int mul8_operand (); extern int mul8_operand ();
......
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