This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GCC compiler intrinsics


Andy Hanson wrote:

> 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.)

memset is potentially an intrinsic in the newer versions.  But that
doesn't meant the compiler always can/will inline it so there may still
be calls to the libc version.

> 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.

GNU C is an ISO C compiler.  So I would hope that non-standard functions
_don't_ get inlined by the compiler.   Still, you're free to whack on your
local copy as you see fit.

> 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

They're hidden in 'builtins.c'.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]