This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to clean up i386 machine description?


> 
> 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!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]