summaryrefslogtreecommitdiff
path: root/arch/powerpc/lib/copy_32.S
diff options
context:
space:
mode:
authorLEROY Christophe <christophe.leroy@c-s.fr>2015-05-19 12:07:57 +0200
committerScott Wood <scottwood@freescale.com>2015-08-07 22:59:29 -0500
commit295ffb41896f566d4bd6f93fc230f5d411d373cb (patch)
tree8022a2cf64316b4cf6e441314fc2dd7b196f2a38 /arch/powerpc/lib/copy_32.S
parent0b05e2d671c40cfb57e66e4e402320d6e056b2f8 (diff)
powerpc/32: Few optimisations in memcpy
This patch adds a few optimisations in memcpy functions by using lbzu/stbu instead of lxb/stb and by re-ordering insn inside a loop to reduce latency due to loading Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'arch/powerpc/lib/copy_32.S')
-rw-r--r--arch/powerpc/lib/copy_32.S10
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S
index 1d49c740407a..2ef50c629470 100644
--- a/arch/powerpc/lib/copy_32.S
+++ b/arch/powerpc/lib/copy_32.S
@@ -155,9 +155,9 @@ _GLOBAL(memcpy)
mtctr r8
beq+ 61f
70: lbz r9,4(r4) /* do some bytes */
- stb r9,4(r6)
addi r4,r4,1
addi r6,r6,1
+ stb r9,3(r6)
bdnz 70b
61: srwi. r0,r0,2
mtctr r0
@@ -199,10 +199,10 @@ _GLOBAL(memcpy)
64: andi. r0,r5,3
mtctr r0
beq+ 65f
-40: lbz r0,4(r4)
- stb r0,4(r6)
- addi r4,r4,1
- addi r6,r6,1
+ addi r4,r4,3
+ addi r6,r6,3
+40: lbzu r0,1(r4)
+ stbu r0,1(r6)
bdnz 40b
65: blr