This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Projects for beginners
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Subject: Re: Projects for beginners
- From: Michael Meissner <meissner at cygnus dot com>
- Date: Wed, 31 Jan 2001 13:49:37 -0500
- Cc: meissner at cygnus dot com, bernds at redhat dot com, zackw at Stanford dot EDU, gcc at gcc dot gnu dot org
- References: <20010131114412.B26755@cse.cygnus.com> <200101311834.TAA23274@ignucius.axis.se>
On Wed, Jan 31, 2001 at 07:34:32PM +0100, Hans-Peter Nilsson wrote:
> > Date: Wed, 31 Jan 2001 11:44:12 -0500
> > From: Michael Meissner <meissner@cygnus.com>
>
> > My quick view of the history is (note some of this predates my involvement with
> > GCC) is (using a branch if register is > 2 as an example):
>
> That's a very nice summary, something to put into md.texi at some time.
Thanks.
> > Cbranch was added for the thumb subport of the arm, and it allows the
> > comparison and branch to be folded together early on. I personally haven't
> > hacked one of these machines yet.
> >
> > (set (pc)
> > (if_then_else (gt (reg:CC n) (const_int 0))
> > (label_ref ...)
> > (pc)))
>
> If this insn example is supposed to be the cbranch insn, then I
> believe it's slightly wrong; a cbranch insn seems to use the
> original operands. I think it should say (using your reg > 2
> example):
>
> (set (pc)
> (if_then_else (gt (reg:SI n) (const_int 2))
> (label_ref ...)
> (pc)))
Yep, simple cut+paste error. One problem that exists in cbranch, at least a
few months ago, is you can't use a parallel with clobbers in it (to avoid
problems with reloading cc regisers on the machine I'm working on, I wanted to
keep the branch + compare together with appropriate clobbers of cc registers).
> > All (almost all?) machines set this up via the compare named insns just storing
> > the arguments, and the appropriate branch or scc instruction actually
> > generating the appropriate code.
>
> All non-cc0 machines, it seems. I don't know whether this is
> also necessary for cbranch-machines. There is a comment in
> optabs.c that says that "a target is still required to implement
> all of the normal bcc operations". Maybe that isn't true anymore.
Yeah, on cc0 machines the result of cc0 is implied. Having to save the
arguments and use them in a later pattern is kind of ugly.
> > > > I guess this is actually a call for documentation of that
> > > > appraised "cbranch" stuff. Maybe an item for the GCC-related
> > > > projects, unless the cbranch author or equivalent steps forward.
> > >
> > > Emphatic agreement.
> >
> > Bernd is probably the person to talk to about cbranch.
>
> Bernd, if this isn't a good time to update md.texi, could you
> please give hints, thoughts or mumbles :-) on how to use
> cbranch/cset/cstore, perhaps even with focus on rewriting
> cc0-ports? Does this allow a port to *not* use any of the
> classic non-cc0 store-the-arguments, expand-compare-in-branch as
> seen in e.g. sparc.md (just to say something else than arm.md)?
>
> brgds, H-P
--
Michael Meissner, Red Hat, Inc. (GCC group)
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886, USA
Work: meissner@redhat.com phone: +1 978-486-9304
Non-work: meissner@spectacle-pond.org fax: +1 978-692-4482