sh.c (addsubcosts): CONST is not cheap.

* sh.c (addsubcosts): CONST is not cheap.
	(find_barrier): For Sh1, take alignment after jumps into account.

From-SVN: r36512
This commit is contained in:
J"orn Rennecke 2000-09-18 19:31:28 +00:00 committed by Joern Rennecke
parent 659e47fb24
commit 50ceefc2f5
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Mon Sep 18 20:26:50 2000 J"orn Rennecke <amylaar@redhat.co.uk>
* sh.c (addsubcosts): CONST is not cheap.
(find_barrier): For Sh1, take alignment after jumps into account.
2000-09-15 Andrew Haley <aph@redhat.com>
* toplev.c (rest_of_compilation): Call purge_hard_subreg_sets to

View File

@ -1020,7 +1020,8 @@ addsubcosts (x)
rtx x;
{
/* Adding a register is a single cycle insn. */
if (GET_CODE (XEXP (x, 1)) != CONST_INT)
if (GET_CODE (XEXP (x, 1)) == REG
|| GET_CODE (XEXP (x, 1)) == SUBREG)
return 1;
/* Likewise for small constants. */
@ -2247,26 +2248,31 @@ find_barrier (num_mova, mova, from)
inc = XVECLEN (body, 1) * GET_MODE_SIZE (GET_MODE (body));
}
}
/* For the SH1, we generate alignments even after jumps-around-jumps. */
else if (GET_CODE (from) == JUMP_INSN
&& ! TARGET_SH2
&& ! TARGET_SMALLCODE)
new_align = 4;
if (found_si)
{
count_si += inc;
if (new_align > si_align)
{
si_limit -= (count_si - 1) & (new_align - si_align);
si_align = new_align;
}
count_si = (count_si + new_align - 1) & -new_align;
count_si += inc;
}
if (found_hi)
{
count_hi += inc;
if (new_align > hi_align)
{
hi_limit -= (count_hi - 1) & (new_align - hi_align);
hi_align = new_align;
}
count_hi = (count_hi + new_align - 1) & -new_align;
count_hi += inc;
}
from = NEXT_INSN (from);
}