This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: More mips constant-subtraction clean-ups
On Mon, Jul 14, 2003 at 11:31:00AM -0700, Eric Christopher wrote:
>
> > and comparing the assembler output. There was no change except
> > to the stack allocation insns. OK to install?
>
> >
> > * config/mips/mips.c (mips_expand_prologue): Use a single insn to
> > allocate 32768 bytes of stack. Use addition rather than subtraction
> > when a single insn is enough.
> > * config/mips/mips.md: Remove insns and splitters for subtracting
> > constants.
> > (subsi3): Only accept register operands.
> > (subsi3_internal): Likewise. Use for TARGET_MIPS16 as well.
> > (subdi3_internal_3, subsi3_internal_2): Likewise.
> > (casesi): Use expand_binop to subtract the lower bound.
>
> OK. I wish I knew why it was like that in the first place though. hrm.
My vague memory is back in the days of GCC 1.x (particularly GCC 1.27 through
1.34 when I was the active MIPS maintainer), GCC did not automatically convert
subtract of constants into add of the negated value all of the time (or
A. Lichnewsky or I didn't understand that the compiler did this). I believe it
only changed a minus into a plus when optimizing, so you needed to have
subtract of constants work for the non-optimizing case.
Since that time, it would get updated as a matter of course, and whomever did
the prologue as RTL work just used it because it happened to work. Maybe Jim,
Jeff, or Richard have different memories of that period.
--
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org