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: CC_MODE and cc0


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


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