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]
Other format: [Raw text]

Re: generating compare and branch instructions


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?

You want to do it this way rather than use cbranch if you also
need to schedule insns in your port.

brgds, H-P


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