summaryrefslogtreecommitdiffstats
path: root/gcc/config/h8300
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-01 22:07:44 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-01 22:07:44 +0000
commit21c719669503227ea7a6b2a84e48ead78eb70db3 (patch)
treec422d5a6c22460a69afefba5c2bf8d7a946bcc5c /gcc/config/h8300
parent2c3b2bf18cecb3165e185915cb723fe28c2fd1a5 (diff)
downloadppe42-gcc-21c719669503227ea7a6b2a84e48ead78eb70db3.tar.gz
ppe42-gcc-21c719669503227ea7a6b2a84e48ead78eb70db3.zip
* config/h8300/h8300.c (h8300_adjust_insn_length): Clean up.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50207 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/h8300')
-rw-r--r--gcc/config/h8300/h8300.c58
1 files changed, 31 insertions, 27 deletions
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 7a77cc8a024..aa31531e6b9 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -3367,34 +3367,38 @@ h8300_adjust_insn_length (insn, length)
else
addr = XEXP (SET_DEST (pat), 0);
- /* On the H8/300, only one adjustment is necessary; if the
- address mode is register indirect, then this insn is two
- bytes shorter than indicated in the machine description. */
- if (TARGET_H8300 && GET_CODE (addr) == REG)
- return -2;
-
- /* On the H8/300H and H8/S, register indirect is 6 bytes shorter than
- indicated in the machine description. */
- if ((TARGET_H8300H || TARGET_H8300S)
- && GET_CODE (addr) == REG)
- return -6;
+ if (TARGET_H8300)
+ {
+ /* On the H8/300, we subtract the difference between the
+ actual length and the longest one, which is @(d:16,ERs). */
- /* On the H8/300H and H8/S, reg + d, for small displacements is
- 4 bytes shorter than indicated in the machine description. */
- if ((TARGET_H8300H || TARGET_H8300S)
- && GET_CODE (addr) == PLUS
- && GET_CODE (XEXP (addr, 0)) == REG
- && GET_CODE (XEXP (addr, 1)) == CONST_INT
- && INTVAL (XEXP (addr, 1)) > -32768
- && INTVAL (XEXP (addr, 1)) < 32767)
- return -4;
-
- /* On the H8/300H and H8/S, abs:16 is two bytes shorter than the
- more general abs:24. */
- if ((TARGET_H8300H || TARGET_H8300S)
- && GET_CODE (addr) == SYMBOL_REF
- && TINY_DATA_NAME_P (XSTR (addr, 0)))
- return -2;
+ /* @Rs is 2 bytes shorter than the longest. */
+ if (GET_CODE (addr) == REG)
+ return -2;
+ }
+ else
+ {
+ /* On the H8/300H and H8/S, we subtract the difference
+ between the actual length and the longest one, which is
+ @(d:24,ERs). */
+
+ /* @ERs is 6 bytes shorter than the longest. */
+ if (GET_CODE (addr) == REG)
+ return -6;
+
+ /* @(d:16,ERs) is 6 bytes shorter than the longest. */
+ if (GET_CODE (addr) == PLUS
+ && GET_CODE (XEXP (addr, 0)) == REG
+ && GET_CODE (XEXP (addr, 1)) == CONST_INT
+ && INTVAL (XEXP (addr, 1)) > -32768
+ && INTVAL (XEXP (addr, 1)) < 32767)
+ return -4;
+
+ /* @aa:16 is 2 bytes shorter than the longest. */
+ if (GET_CODE (addr) == SYMBOL_REF
+ && TINY_DATA_NAME_P (XSTR (addr, 0)))
+ return -2;
+ }
}
/* Loading some constants needs adjustment. */
OpenPOWER on IntegriCloud