From: Kazu Hirata Date: Thu, 27 Jul 2000 01:38:33 +0000 (+0000) Subject: h8300.c (print_operand): Print ":8" when the 'R' operand is suitable for 8-bit absolute. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f9f0e4f9ec0c98423fe80a860da80893d77e230;p=gcc.git h8300.c (print_operand): Print ":8" when the 'R' operand is suitable for 8-bit absolute. * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f88e0b8bae..61f1e389285 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2000-07-26 Kazu Hirata + + * 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 * varasm.c (assemble_variable) [! defined(ASM_OUTPUT_ALIGNED_COMMON) diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index fd165e84dd6..c2d74bfcf4b 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -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: diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 941a8ad593f..5c4604a86e1 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -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) : \