This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: making library calls inline w/ and w/o optimization ebabled
- From: John Love-Jensen <eljay at adobe dot com>
- To: Aaron Case <aaron dot case at dynazign dot com>, gcc-help at gcc dot gnu dot org
- Date: Thu, 28 Aug 2003 10:53:43 -0500
- Subject: Re: making library calls inline w/ and w/o optimization ebabled
Hi Aaron,
To port MSVC 5.1 code that has "#pragma intrinsic(memset)" stuff, just
comment out the #pragma.
That kind of #pragma is used in conjunction with built-ins that MSVC 5.1
has, which GCC does not have.
If you are really ambitious, you can write your own memset routine. But I
think that would be overkill.
"Premature optimization is the root of all evil." ~ Donald Knuth
Having an inline memset is a premature optimization, unless you already know
that it is a bottleneck. And as far as memset routines go, you could write
customized code that takes advantage of moving 32 or 64-bits around at a
time, whereas a plain-and-simple/naïve memset moves only a byte around at a
time.
NOTE: I'm not claiming that any given compiler vendor's memset is
necessarily a naïve implementation. I've seen memset routines that use the
whole bandwidth of the data-bus when possible.
HTH,
--Eljay