Skip to content

Commit

Permalink
powerpc: Fix POWER7/PPC64 performance regression on LE
Browse files Browse the repository at this point in the history
This patch fixes a performance regression on the POWER7/PPC64 memcmp
porting for Little Endian.  The LE code uses 'ldbrx' instruction to read
the memory on byte reversed form, however ISA 2.06 just provide the indexed
form which uses a register value as additional index, instead of a fixed value
enconded in the instruction.

And the port strategy for LE uses r0 index value and update the address
value on each compare loop interation.  For large compare size values,
it adds 8 more instructions plus some more depending of trailing
size.  This patch fixes it by adding pre-calculate indexes to remove the
address update on loops and tailing sizes.

For large sizes it shows a considerable gain, with double performance
pairing with BE.
  • Loading branch information
Adhemerval Zanella committed Jan 13, 2015
1 parent d3b00f4 commit ce6615c
Show file tree
Hide file tree
Showing 2 changed files with 285 additions and 588 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2015-01-13 Adhemerval Zanella <azanella@linux.vnet.ibm.com>

* sysdeps/powerpc/powerpc64/power7/memcmp.S (memcmp): Fix performance
regression on LE.

* sysdeps/powerpc/powerpc64/multiarch/strncmp-power8.S: New file.
* sysdeps/powerpc/powerpc64/power8/strncmp.S: New file.
* sysdeps/powerpc/powerpc64/multiarch/Makefile [sysdep_routines]: Add
Expand Down
Loading

0 comments on commit ce6615c

Please sign in to comment.