OSDN Git Service

* alpha.h (PRINT_OPERAND_ADDRESS): Break out to ...
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 24 Apr 1999 20:50:46 +0000 (20:50 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 24 Apr 1999 20:50:46 +0000 (20:50 +0000)
        * alpha.c (print_operand_address): here.  Handle subregs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26616 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/config/alpha/alpha.h

index dd95dcc..8af5855 100644 (file)
@@ -1,3 +1,8 @@
+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)
 
        * acconfig.h (HAVE_GAS_FILDS_FISTS): Add.
index cf60507..7b6966e 100644 (file)
@@ -2929,6 +2929,40 @@ print_operand (file, x, code)
       output_operand_lossage ("invalid %%xn 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);
+}
 \f
 /* 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
index bf41334..857ba0d 100644 (file)
@@ -2297,28 +2297,9 @@ do {                                                                     \
 \f
 /* Print a memory address as an operand to reference that memory location.  */
 
-#define PRINT_OPERAND_ADDRESS(FILE, ADDR)              \
-{ rtx addr = (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 PRINT_OPERAND_ADDRESS(FILE, ADDR) \
+  print_operand_address((FILE), (ADDR))
+
 /* Define the codes that are matched by predicates in alpha.c.  */
 
 #define PREDICATE_CODES                                                \
@@ -2524,6 +2505,7 @@ extern int current_file_function_operand ();
 extern int alpha_sa_size ();
 extern int alpha_adjust_cost ();
 extern void print_operand ();
+extern void print_operand_address ();
 extern int reg_or_0_operand ();
 extern int reg_or_8bit_operand ();
 extern int mul8_operand ();