This is the mail archive of the mailing list for the glibc 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: PowerPC LE strlen

On Fri, Aug 9, 2013 at 12:18 AM, Alan Modra <> wrote:
> 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.

I'd like Will Schmidt and Adhemerval Zanella to comment on this series
of patches.

There are some assumptions we make about alignment, and the data sizes
that we optimize for and most of our string function implementations
have been run through pipeline analysis tools verify that they perform
as expected.

> This one is LE 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.

I'm fine with the strlen patch itself.

Ryan S. Arnold

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