[PATCH] powerpc64: strcpy optimization for unaligned string

Adhemerval Zanella azanella@linux.vnet.ibm.com
Wed Dec 31 22:09:00 GMT 2014


On 17-12-2014 14:04, Rajalakshmi Srinivasaraghavan wrote:
>
>
> This patch optimizes strcpy for ppc64 for unaligned source or
> destination address. The source or destination address is aligned
> to doubleword and data is shifted based on the alignment and
> added with the previous loaded data to be written as a doubleword.
> For each load, cmpb instruction is used for faster null check.
>
> More combination of unaligned inputs is also added in benchtest
> to measure the improvement.The new optimization shows 2 to 80% of
> performance improvement for longer string though it does not show
> big difference on string size less than 16 due to additional checks.
>
> This patch is tested on powerpc64 BE and LE and I have also attached
> the benchtest result.
>
>     * sysdeps/powerpc/powerpc64/power7/strcpy.S: Optimize unaligned path.
>     * benchtests/bench-strcpy.c: Add more unaligned inputs.
>
This patch looks ok and I will commit it shortly.  I will also a small note
in commit message saying the patch also removes the word-aligned code path
and remove the comment associate with on the strcpy.S. Thanks!




More information about the Libc-alpha mailing list