Index | Thread | Search

From:
Crystal Kolipe <kolipe.c@exoticsilicon.com>
Subject:
Re: [PATCH] amd64: import optimized memcmp from FreeBSD]
To:
tech <tech@openbsd.org>, Mateusz Guzik <mjguzik@gmail.com>, Stuart <stu@spacehopper.org>
Date:
Sat, 07 Jun 2025 06:40:12 -0300

Download raw body.

Thread
On Sat, Jun 07, 2025 at 11:06:39AM +0200, Martin Pieuchot wrote:
> On 06/06/25(Fri) 12:02, Crystal Kolipe wrote:
> > I've ported a cut-down version of this code to i386 in case anybody wants to
> > look for possible performance gains there.
> > 
> > It could probably be improved further if there is interest.
> 
> There is interest.  We just need somebody which will lead the effort, do
> the testing, report back and integrate the comments from the list.
> 
> This might not be trivial.
> 
> Would you like to do it?  Thanks!

Well if anybody actually has any feedback or test reports I'd welcome feedback
on it.

Maybe you mis-understood my 'if there is interest' comment.

The point is that i386 is becoming little used now, and due to the lack of
registers there isn't so much performance to be gained in this code vs amd64.

On the other hand, machines that are running i386 because they can't run amd64
are probably slow enough that _any_ performance benefit is going to be
appreciated.

So the point was whether i386 matters or not.

To be honest, the main possibility for improvements in the code I posted would
be favouring larger or smaller compares.  E.G. make the %ecx <= 4 case faster
at the expense of larger compares being slower, or vice-versa.

Beyond that, not so much.

Amd64 has more scope and is more interesting.