Scheduling of asm()

mike stump mrs@windriver.com
Mon Jan 7 10:00:00 GMT 2002


> Date: Sun, 6 Jan 2002 17:19:54 -0800
> From: Richard Henderson <rth@redhat.com>
> To: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
> Cc: gcc@gcc.gnu.org

> On Mon, Jan 07, 2002 at 01:50:01AM +0100, Falk Hueffner wrote:
> > Hmm, okay, I'll try that. I see i386 has lots of builtins already for
> > MMX, so I'll try to do it analogously.

> BTW, I'd like to create generic builtins (and maybe tree nodes and rtx)
> for cttz, ctlz, ctpop.  They exist on a number of targets.

I'll go one farther.  Any builtin that is expressible in normal C,
should be added to gcc as machine independent.  If a machine doesn't
support it, it should be expanded by the compiler as the equivalent C
(rtl).  Any machine that wants to add a builtin that is already
present, should reuse the machine independent one.

Take for example, a SI mode rotate instruction.  Let say we wanted to
add it as a builtin.  Better to add it not as an MD builtin, but as an
MI builtin.

This mirrors what we do with things like plus:DI.  It is mi, and if a
machine doesn't support it, you get slower code that still works.
There is a reason we didn't just fault or say, no such instruction
when the users source code contained the construct.



More information about the Gcc mailing list