This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CC_MODE and cc0
- From: Paul Koning <pkoning at equallogic dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 18 Feb 2004 17:07:14 -0500
- Subject: Re: CC_MODE and cc0
- References: <OF955B058D.A38A52F8-ONC2256E3C.0041AE39-C2256E3C.0049E9F4@nsc.com><20040216.112544.15269207.kazu@cs.umass.edu><orsmhan8sf.fsf@free.redhat.lsd.ic.unicamp.br>
This note is prompted by discussion on the gcc-patches list about the
CR16C/CRX processor port submission.
I'm trying to understand the issue relating to cc0 vs. CC_MODE.
Reading gccint is no help. Reading random mailing list notes isn't
much help either; the one I've seen so far reiterates the points that
Alexandre Oliva made a few days ago but doesn't shed much more light
on the subject.
It sounds like i386 is supposed to be an example of how to do things.
But looking at i386.md, the first thing I see is patterns that match
compare/jump pairs. That doesn't seem the way to optimal code, and
sure enough, in a simple test program I end up with
cmpl $4, %eax
je .L4
cmpl $4, %eax
jle .L3
which looks like a redundant compare, unless I misunderstand i386
machine code. (By comparison, the pdp11 back end, which uses cc0,
produces the desired result: one compare, two branches.)
Is there a recipe documented anywhere that shows how the move away
from cc0 is supposed to happen, and in particular how to make it work
in such a way that the code quality doesn't suffer? It would be nice
if this were captured in documentation somewhere that can be found...
paul