Skip to content

Commit

Permalink
PowerPC: fix POWER7 memrchr for some large inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Adhemerval Zanella committed Sep 5, 2013
1 parent 4660856 commit 5430fc6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2013-09-05 Adhemerval Zanella <azanella@linux.vnet.ibm.com>

* sysdeps/powerpc/powerpc32/power7/memrchr.S (__memrchr): Fix invalid
memory access for final bytes in some large inputs.
* sysdeps/powerpc/powerpc64/power7/memrchr.S (__memrchr): Likewise.

2013-09-05 Adhemerval Zanella <azanella@linux.vnet.ibm.com>

* string/test-memrchr.c: New file.
Expand Down
4 changes: 2 additions & 2 deletions sysdeps/powerpc/powerpc32/power7/memrchr.S
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ L(loop):
/* We're here because the counter reached 0, and that means we
didn't have any matches for BYTE in the whole range. Just return
the original range. */
addi r9,r8,4
cmplw cr6,r9,r7
addi r8,r8,4
cmplw cr6,r8,r7
bgt cr6,L(loop_small)
b L(null)

Expand Down
4 changes: 2 additions & 2 deletions sysdeps/powerpc/powerpc64/power7/memrchr.S
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ L(loop):
/* We're here because the counter reached 0, and that means we
didn't have any matches for BYTE in the whole range. Just return
the original range. */
addi r9,r8,8
cmpld cr6,r9,r7
addi r8,r8,8
cmpld cr6,r8,r7
bgt cr6,L(loop_small)
b L(null)

Expand Down

0 comments on commit 5430fc6

Please sign in to comment.