aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDhananjay R. Deshpande <dhananjayd@kpit.com>2002-09-13 15:42:47 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2002-09-13 15:42:47 +0000
commitd56c04ce52a5fb8176b2d26ce15113a2ab5cc47d (patch)
tree6c7fc07b03a87e236e59742a9b7670863eb4d82b /gcc
parent69aeba4ed014799980dc331083b7030c5fa0ba9f (diff)
downloadgcc-d56c04ce52a5fb8176b2d26ce15113a2ab5cc47d.zip
gcc-d56c04ce52a5fb8176b2d26ce15113a2ab5cc47d.tar.gz
gcc-d56c04ce52a5fb8176b2d26ce15113a2ab5cc47d.tar.bz2
h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Add support for H8/300, H8/S aa:8 mode.
* config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Add support for H8/300, H8/S aa:8 mode. (TINY_CONSTANT_ADDRESS_P): Add support for H8/S aa:16 mode. * config/h8300/h8300.c (h8300_adjust_insn_length): Adjust length for H8/300 aa:8 mode. From-SVN: r57108
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/h8300/h8300.c6
-rw-r--r--gcc/config/h8300/h8300.h34
3 files changed, 36 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 523f275..e499889 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2002-09-13 Dhananjay Deshpande <dhananjayd@kpit.com>
+
+ * config/h8300/h8300.h (EIGHTBIT_CONSTANT_ADDRESS_P): Add support
+ for H8/300, H8/S aa:8 mode.
+ (TINY_CONSTANT_ADDRESS_P): Add support for H8/S aa:16 mode.
+ * config/h8300/h8300.c (h8300_adjust_insn_length): Adjust length
+ for H8/300 aa:8 mode.
+
2002-09-13 Hartmut Penner <hpenner@de.ibm.com>
* config/s390/s390.md ("trap", "conditional_trap", "*trap"): New
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index cfcea40..a511518 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -3719,6 +3719,12 @@ h8300_adjust_insn_length (insn, length)
/* @Rs is 2 bytes shorter than the longest. */
if (GET_CODE (addr) == REG)
return -2;
+
+ /* @aa:8 is 2 bytes shorter than the longest. */
+ if (GET_MODE (SET_SRC (pat)) == QImode
+ && ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FLAG (addr))
+ || EIGHTBIT_CONSTANT_ADDRESS_P (addr)))
+ return -2;
}
else
{
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 726d47f..f291c12 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -822,20 +822,30 @@ struct cum_arg
? !h8300_shift_needs_scratch_p (INTVAL (OP), SImode) \
: 0)
-/* 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)
+/* Nonzero if X is a constant address suitable as an 8-bit absolute,
+ 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) \
+ || (TARGET_H8300S && 0xffffff00 <= INTVAL (X) \
+ && INTVAL (X) <= 0xffffffff) \
+ || (TARGET_H8300 && 0xff00 <= (INTVAL (X) & 0x0000FFFF) \
+ && (INTVAL (X) & 0x0000FFFF) <= 0xffff)))
/* Nonzero if X is a constant address suitable as an 16-bit absolute
- on the H8/300H. */
-
-#define TINY_CONSTANT_ADDRESS_P(X) \
- (GET_CODE (X) == CONST_INT && TARGET_H8300H \
- && ((0xff8000 <= INTVAL (X) && INTVAL (X) <= 0xffffff) \
- || (0x000000 <= INTVAL (X) && INTVAL (X) <= 0x007fff)))
+ on H8/300H and H8/S. */
+
+#define TINY_CONSTANT_ADDRESS_P(X) \
+ ((GET_CODE (X) == CONST_INT) \
+ && ((TARGET_H8300H \
+ && ((0xff8000 <= INTVAL (X) && INTVAL (X) <= 0xffffff) \
+ || (0x000000 <= INTVAL (X) && INTVAL (X) <= 0x007fff))) \
+ || (TARGET_H8300S \
+ && ((0xffff8000 <= INTVAL (X) && INTVAL (X) <= 0xffffffff) \
+ || (0x00000000 <= INTVAL (X) \
+ && INTVAL (X) <= 0x00007fff)))))
/* 'U' if valid for a bset destination;
i.e. a register, register indirect, or the eightbit memory region