h8300.c (print_operand): Print ":8" when the 'R' operand is suitable for 8-bit absolute.
authorKazu Hirata <kazu@hxi.com>
Thu, 27 Jul 2000 01:38:33 +0000 (01:38 +0000)
committerJeff Law <law@gcc.gnu.org>
Thu, 27 Jul 2000 01:38:33 +0000 (19:38 -0600)
        * h8300.c (print_operand): Print ":8" when the 'R' operand is
        suitable for 8-bit absolute.
        * h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): New.
        (OK_FOR_U): Add a case for the 8-bit constant address on the
        H8/300H.

From-SVN: r35278

gcc/ChangeLog
gcc/config/h8300/h8300.c
gcc/config/h8300/h8300.h

index 0f88e0b8bae219e3b37c4272a809d25093b93003..61f1e389285522eb77274b69a773e5391c1f230b 100644 (file)
@@ -1,3 +1,11 @@
+2000-07-26  Kazu Hirata  <kazu@hxi.com>
+
+       * h8300.c (print_operand): Print ":8" when the 'R' operand is
+       suitable for 8-bit absolute.
+       * h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): New.
+       (OK_FOR_U): Add a case for the 8-bit constant address on the
+       H8/300H.
+
 Wed Jul 26 19:26:21 2000  Hans-Peter Nilsson  <hp@axis.com>
 
        * varasm.c (assemble_variable) [! defined(ASM_OUTPUT_ALIGNED_COMMON)
index fd165e84dd66892a2052722ba39853e9bb93907f..c2d74bfcf4bc3e44f9258f4b8df89b9809bc930b 100644 (file)
@@ -1419,6 +1419,9 @@ print_operand (file, x, code)
          else if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
                   && TINY_DATA_NAME_P (XSTR (XEXP (x, 0), 0)))
            fprintf (file, ":16");
+         else if ((code == 'R')
+                  && EIGHTBIT_CONSTANT_ADDRESS_P (XEXP (x, 0)))
+           fprintf (file, ":8");
          break;
 
        case CONST_INT:
index 941a8ad593f0aa589e9e1b3e70d18a19390139f0..5c4604a86e1e9ace16d67d43ab2e691f03f0f263 100644 (file)
@@ -836,6 +836,13 @@ struct cum_arg
   (GET_CODE (OP) == CONST_INT                  \
    && (INTVAL (OP) == -1 || INTVAL (OP) == -2))
 
+/* Nonzero if X is a constant address suitable as an 8-bit absolute on
+   the H8/300H, which is a special case of the 'R' operand.  */
+
+#define EIGHTBIT_CONSTANT_ADDRESS_P(X)                 \
+  (GET_CODE (X) == CONST_INT && TARGET_H8300H          \
+   && 0xffff00 <= INTVAL (X) && INTVAL (X) <= 0xffffff)
+
 /* 'U' if valid for a bset destination;
    i.e. a register, register indirect, or the eightbit memory region
    (a SYMBOL_REF with an SYMBOL_REF_FLAG set).
@@ -851,7 +858,11 @@ struct cum_arg
         && GET_CODE (XEXP (XEXP (OP, 0), 0)) == PLUS \
         && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 0)) == SYMBOL_REF \
         && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 1)) == CONST_INT) \
-        && (TARGET_H8300S || SYMBOL_REF_FLAG (XEXP (XEXP (OP, 0), 0)))))
+        && (TARGET_H8300S || SYMBOL_REF_FLAG (XEXP (XEXP (OP, 0), 0)))) \
+   || (GET_CODE (OP) == MEM                                            \
+       && EIGHTBIT_CONSTANT_ADDRESS_P (XEXP (OP, 0))))
+
+
 
 #define EXTRA_CONSTRAINT(OP, C)                        \
   ((C) == 'T' ? OK_FOR_T (OP) :                        \