Implementing intrinsics in GCC

Ian Lance Taylor iant@google.com
Mon Jul 12 09:32:00 GMT 2010


Andrew Haley <aph@redhat.com> writes:

> But you can trivially do the job with an inline asm in a header file
> in almost all cases, so I don't really understand why you want to
> submit to the pain of defining a new intrinsic.

I would say that the advantage to an intrinsic over an asm is that the
instruction is exposed to the scheduler.  On some processors good
instruction scheduling is essential for good performance.  And on some
special purpose processors intrinsic functions (or asm statements) are
needed for a lot of useful code.

Ian



More information about the Gcc-help mailing list