diff options
author | Kazu Hirata <kazu@hxi.com> | 2000-07-27 01:38:33 +0000 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2000-07-26 19:38:33 -0600 |
commit | 9f9f0e4f9ec0c98423fe80a860da80893d77e230 (patch) | |
tree | f24e797ffc2e9d3e97dcb8d3f9007fc76e0374c1 | |
parent | ec1bff50af97c7cab92ba2c29ff841e88e697cb6 (diff) | |
download | gcc-9f9f0e4f9ec0c98423fe80a860da80893d77e230.zip gcc-9f9f0e4f9ec0c98423fe80a860da80893d77e230.tar.gz gcc-9f9f0e4f9ec0c98423fe80a860da80893d77e230.tar.bz2 |
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
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.c | 3 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.h | 13 |
3 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0f88e0b..61f1e38 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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) diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index fd165e8..c2d74bf 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 941a8ad..5c4604a 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) : \ |