This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Implementing intrinsics in GCC
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 09 Jul 2010 19:25:23 +0100
- Subject: Re: Implementing intrinsics in GCC
- References: <532483.55939.qm@web51601.mail.re2.yahoo.com>
On 07/09/2010 07:18 PM, Joe Vee wrote:
>
>
>
> Can somebody give me any pointers about implementing intrinsic
> functions for a new processor (functions that expand to a single
> assembly instruction) in GCC? What are the steps involved and is
> there any documentation on how to do this?
There's a ton of examples: just have a look at the way things like
expand_sync_lock_test_and_set are handled, for instance. Have a look
at builtins.c.
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.
Andrew.