Optimising redundant compares

Jon Beniston jbeniston@compxs.com
Thu Sep 25 21:39:00 GMT 2003


Hi Nathan,

> IIRC powerpc has something like this. To gcc, the compare 
> instruction generates a set of bits indicating =, <, > etc, 
> and the branch instructions select particular patterns. Have 
> you looked there?

Yep, my port is very similar. The only apparent significant difference
is that I was using a fixed hard register, where as I believe the PPC
allows CC regs to be pseduos. I have tried to modify my code to work in
a similar way, but have stumbled across a problem with reloading as the
architecture I'm porting to is 16-bit. The problem is that the size of
MODE_CC is defined as 32-bits in machmode.def and I only have one 16-bit
register in my CC_REG class. The reloader therefore falls over when
trying to allocate 2 registers from CC_REG.

How would I go about modifying the size of MODE_CC in a portable way?
Will this cause any other problems? Should I add a second dummy register
in my CC_REG class? All suggestions greatly received.

Cheers,
Jon







More information about the Gcc mailing list