diff options
author | Christophe Leroy <christophe.leroy@c-s.fr> | 2018-05-30 10:06:15 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2018-06-03 17:39:21 +0300 |
commit | 2676b89eb82f56825d7289edf21f17a6461388b7 (patch) | |
tree | 88beb79699ed2916ad1d9082613bc11ce792fbd3 /arch/powerpc/lib/string.S | |
parent | f36bbf21e8b911b3c629fd36d4d217105b47a20e (diff) | |
download | linux-2676b89eb82f56825d7289edf21f17a6461388b7.tar.xz |
powerpc/lib: optimise PPC32 memcmp
At the time being, memcmp() compares two chunks of memory
byte per byte.
This patch optimises the comparison by comparing word by word.
On the same way as commit 15c2d45d17418 ("powerpc: Add 64bit
optimised memcmp"), this patch moves memcmp() into a dedicated
file named memcmp_32.S
A small benchmark performed on an 8xx comparing two chuncks
of 512 bytes performed 100000 times gives:
Before : 5852274 TB ticks
After: 1488638 TB ticks
This is almost 4 times faster
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/lib/string.S')
-rw-r--r-- | arch/powerpc/lib/string.S | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/arch/powerpc/lib/string.S b/arch/powerpc/lib/string.S index 5343a88e619e..4b41970e9ed8 100644 --- a/arch/powerpc/lib/string.S +++ b/arch/powerpc/lib/string.S @@ -54,23 +54,6 @@ _GLOBAL(strncmp) blr EXPORT_SYMBOL(strncmp) -#ifdef CONFIG_PPC32 -_GLOBAL(memcmp) - PPC_LCMPI 0,r5,0 - beq- 2f - mtctr r5 - addi r6,r3,-1 - addi r4,r4,-1 -1: lbzu r3,1(r6) - lbzu r0,1(r4) - subf. r3,r0,r3 - bdnzt 2,1b - blr -2: li r3,0 - blr -EXPORT_SYMBOL(memcmp) -#endif - _GLOBAL(memchr) PPC_LCMPI 0,r5,0 beq- 2f |