This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to clean up i386 machine description?
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: How to clean up i386 machine description?
- From: Jan Hubicka <hubicka at horac dot ta dot jcu dot cz>
- Date: Fri, 13 Nov 1998 22:29:58 +0100
- Cc: Colin Douglas Howell <howell at cs dot stanford dot edu>, rth at cygnus dot com, law at cygnus dot com, pcg at goof dot com, egcs at cygnus dot com
- References: <199811122144.NAA19144@Sunburn.Stanford.EDU> <199811122157.VAA18206@phal.cygnus.co.uk>
>
> There be a sequence that sets a register to one and then adds/subtracts
> that value from another register. Reload might know about the equivalence
> and decide to replace the register with the constant one in the add / subtract.
> The instruction number is not recalculated in reload.
Maybe stupid question, but why it should not be changed and recog the
insn again?
Maybe gcc should take advantage of the fact that it have inc pattern
and don't keep 1 in register (it is actually chaper to do inc eax
then add ebx,eax where ebx=1 IMO)
> If you general add / subtract pattern rejects an increment, the compiler
> will then abort.
> Likewise if your increment / decrement pattern only works on registers
> and global / reload changes a register into a stack slot.
My current implementation is, that I have inc pattern handling same cases
as add pattern (i386 does that) and add pattern still handle the inc
case.
This should be OK in most cases IMO. only ugly bit about it is the inc
handling in add pattern.
Maybe I will really have to do that using attributes. Can someone tell
me how it is possible write operands[2] == 1 in attribute condition
in other way than (match_operand 2 "one" "")?
Thanks
Honza
--
------------------------------------------------------------------------------
Have you browsed my www pages? Look at:
http://www.paru.cas.cz/~hubicka
Koules-the game for Svgalib,X11 and OS/2, Xonix-the game for X11
czech documentation for linux index, original 2D computer art and
funny 100 years old photos and articles are there!