generating compare and branch instructions

Øyvind Harboe oyvind.harboe@zylin.com
Tue Nov 9 07:37:00 GMT 2004


tir, 09.11.2004 kl. 01.23 skrev Hans-Peter Nilsson:
> On Mon, 8 Nov 2004, Øyvind Harboe wrote:
> > I'm trying to figure out how to tell GCC in the machine description
> > file how to:
> >
> > - use any register for the result of the cmpsi instruction
> 
> Most ports where any register suffices for the result, saves the
> operands in the compare pattern and emit both the compare and
> the branch at the branch description.  This solves the problem
> of emitting a compare insn that matches the branch insn.  See
> for example the "cmpdi" and "beq" patterns in the MMIX port; the
> compare insn is later matched against e.g. "*cmpcc" and the
> branch against "*bCC" (BTW, looks like a naming inconsistency
> but each name has a valid reason).  Doesn't the manual mention
> this method?

The manual does mention this approach, but for my purposes cbranchsi4
was just the ticket. I will study the MMIX port however.

What I miss in the manual is a complete list of all the named patterns:
"9.8 Standard Pattern Names For Generation".

Is there a way to find out about all the standard patterns via a grep or
reading in some source file, or?

> You want to do it this way rather than use cbranch if you also
> need to schedule insns in your port.
>
> brgds, H-P
-- 
Øyvind Harboe
http://www.zylin.com




More information about the Gcc mailing list