diff options
author | Kazu Hirata <kazu@cs.umass.edu> | 2003-06-25 11:54:44 +0000 |
---|---|---|
committer | Kazu Hirata <kazu@gcc.gnu.org> | 2003-06-25 11:54:44 +0000 |
commit | f5139cc523535e77d5971aff50403cb2b063e94b (patch) | |
tree | 3c49c0b8a763abbd01d4777646f9461ada1231f8 | |
parent | 7099616c53df127058c1fbee5b6cbdfdfa2575dc (diff) | |
download | gcc-f5139cc523535e77d5971aff50403cb2b063e94b.zip gcc-f5139cc523535e77d5971aff50403cb2b063e94b.tar.gz gcc-f5139cc523535e77d5971aff50403cb2b063e94b.tar.bz2 |
h8300.c (compute_mov_length): Adjust for the new optimization.
* config/h8300/h8300.c (compute_mov_length): Adjust for the
new optimization.
* config/h8300/h8300.md (*movsi_h8300): Optimize the load of
an SImode constant whose upper and lower are the same.
From-SVN: r68475
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.c | 4 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.md | 9 |
3 files changed, 18 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6199994..493e045 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-06-25 Kazu Hirata <kazu@cs.umass.edu> + + * config/h8300/h8300.c (compute_mov_length): Adjust for the + new optimization. + * config/h8300/h8300.md (*movsi_h8300): Optimize the load of + an SImode constant whose upper and lower are the same. + Wed Jun 25 11:31:59 CEST 2003 Jan Hubicka <jh@suse.cz> * varasm.c (assemble_name): Mark needed variables even when diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index 3a5334b..edb7820 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -1876,6 +1876,10 @@ compute_mov_length (rtx *operands) if ((INTVAL (src) & 0xffff) == 0) return 6; + + if ((INTVAL (src) & 0xffff) + == ((INTVAL (src) >> 16) & 0xffff)) + return 6; } return 8; } diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index ec9f1c6..341e167 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -396,14 +396,19 @@ } else { - /* See if either half is zero. If so, use sub.w to clear - that half. */ if (GET_CODE (operands[1]) == CONST_INT) { + /* If either half is zero, use sub.w to clear that + half. */ if ((INTVAL (operands[1]) & 0xffff) == 0) return \"mov.w %e1,%e0\;sub.w %f0,%f0\"; if (((INTVAL (operands[1]) >> 16) & 0xffff) == 0) return \"sub.w %e0,%e0\;mov.w %f1,%f0\"; + /* If the upper half and the lower half are the same, + copy one half to the other. */ + if ((INTVAL (operands[1]) & 0xffff) + == ((INTVAL (operands[1]) >> 16) & 0xffff)) + return \"mov.w\\t%e1,%e0\;mov.w\\t%e0,%f0\"; } return \"mov.w %e1,%e0\;mov.w %f1,%f0\"; } |