This is the mail archive of the gcc-help@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]
Other format: [Raw text]

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


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