Slow memcmp for aligned strings on Pentium 3

Kevin Atkinson kevina@gnu.org
Fri Apr 4 15:16:00 GMT 2003


On Thu, 3 Apr 2003, Zack Weinberg wrote:

> Kevin Atkinson <kevin@atkinson.dhs.org> writes:
> 
> > I was doing some tests with with memcmp and it seams that gcc 3.2.2 always
> > uses cmps, even for aligned strings.
> >
> > I did some tests and discovered that using cmps was rather slow, compared 
> > to a simple loop and then a bswap and subtract at the end.
> 
> Patches are welcome.
> 
The best I can give you is a memcmp implementation.  I know nothing about 
gcc internals.

-- 
http://kevin.atkinson.dhs.org



More information about the Gcc mailing list