This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC compiler intrinsics
- To: <gcc at gcc dot gnu dot org>
- Subject: GCC compiler intrinsics
- From: "Andy Hanson" <andrew_g_hanson at yahoo dot com>
- Date: Thu, 4 May 2000 05:36:13 -0500
< I got a weird mail error back the last time I sent this, hopefully it
isn't hitting the list twice.
I've been doing a fair amount of linux coding for a web server, the last few
weeks, and recently I ran across a linker error claiming an unresolved
reference to memset. Most of the link errors were my fault, but I was
simply shocked. The fact that memset was unresolved, implied that memset
isn't a compiler intrinsic. I mean, if strcpy is an intrinsic, why the hell
isn't memset. (I'm using a semi-old version (egcs-2.91.66), so it might be
an intrinsic in newer versions.)
Which got me to thinking, now that I am free from relying on VC 6+, and the
compiler is open sourced, I can finally add my own compiler intrinsics.
Things like bsf (bit scan forward), or maybe a simple hash function.
Currently for quick and dirty asm functions, I typically use an
__attribute__((regparm(x))) style of function, but an intrinsic would be so
much cleaner.
Now the big question is where to start. I did a little digging through the
egcs release, and binutils, and I can't seem to see where intrinsics like
strcpy get processed by the compiler. I did my traditional web search to
pick up any info on doing this, talked to all the linux coders I know, but I
haven't been able to find a thing.
Any help, or further guidance, direction pointing, examples, the source
file(s) I should look at etc. would be greatly appreciated.
Andy
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com