This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Slow memcmp for aligned strings on Pentium 3
- From: Kevin Atkinson <kevina at gnu dot org>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 04 Apr 2003 08:22:09 -0500 (EST)
- Subject: Re: Slow memcmp for aligned strings on Pentium 3
On Thu, 3 Apr 2003, Zack Weinberg wrote:
> Kevin Atkinson <kevin at atkinson dot dhs dot 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