PowerPC LE strlen
authorAlan Modra <amodra@gmail.com>
Sat, 17 Aug 2013 09:10:11 +0000 (18:40 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 4 Oct 2013 01:09:32 +0000 (10:39 +0930)
commitdb9b4570c5dc550074140ac1d1677077fba29a26
treec6469b8ce6b7ec28cc9f7c27484e67d351ce3349
parentf7c399cff5bd04ee9dc117fb6b0f39597dc047c6
PowerPC LE strlen
http://sourceware.org/ml/libc-alpha/2013-08/msg00097.html

This is the first of nine patches adding little-endian support to the
existing optimised string and memory functions.  I did spend some
time with a power7 simulator looking at cycle by cycle behaviour for
memchr, but most of these patches have not been run on cpu simulators
to check that we are going as fast as possible.  I'm sure PowerPC can
do better.  However, the little-endian support mostly leaves main
loops unchanged, so I'm banking on previous authors having done a
good job on big-endian..  As with most code you stare at long enough,
I found some improvements for big-endian too.

Little-endian support for strlen.  Like most of the string functions,
I leave the main word or multiple-word loops substantially unchanged,
just needing to modify the tail.

Removing the branch in the power7 functions is just a tidy.  .align
produces a branch anyway.  Modifying regs in the non-power7 functions
is to suit the new little-endian tail.

* sysdeps/powerpc/powerpc64/power7/strlen.S (strlen): Add little-endian
support.  Don't branch over align.
* sysdeps/powerpc/powerpc32/power7/strlen.S: Likewise.
* sysdeps/powerpc/powerpc64/strlen.S (strlen): Add little-endian support.
Rearrange tmp reg use to suit.  Comment.
* sysdeps/powerpc/powerpc32/strlen.S: Likewise.
ChangeLog
sysdeps/powerpc/powerpc32/power7/strlen.S
sysdeps/powerpc/powerpc32/strlen.S
sysdeps/powerpc/powerpc64/power7/strlen.S
sysdeps/powerpc/powerpc64/strlen.S