Skip to content

Commit

Permalink
powerpc: Align hot loops of some string functions
Browse files Browse the repository at this point in the history
Align the hot loops in our assembly implementation of strncpy(),
strncmp() and memchr().

Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Anton Blanchard authored and Michael Ellerman committed Jun 14, 2016
1 parent 3ece166 commit 87a156f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/powerpc/lib/string.S
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ _GLOBAL(strncpy)
mtctr r5
addi r6,r3,-1
addi r4,r4,-1
.balign 16
1: lbzu r0,1(r4)
cmpwi 0,r0,0
stbu r0,1(r6)
Expand All @@ -42,6 +43,7 @@ _GLOBAL(strncmp)
mtctr r5
addi r5,r3,-1
addi r4,r4,-1
.balign 16
1: lbzu r3,1(r5)
cmpwi 1,r3,0
lbzu r0,1(r4)
Expand Down Expand Up @@ -73,6 +75,7 @@ _GLOBAL(memchr)
beq- 2f
mtctr r5
addi r3,r3,-1
.balign 16
1: lbzu r0,1(r3)
cmpw 0,r0,r4
bdnzf 2,1b
Expand Down

0 comments on commit 87a156f

Please sign in to comment.