]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/lib: optimise PPC32 memcmp
authorChristophe Leroy <christophe.leroy@c-s.fr>
Wed, 30 May 2018 07:06:15 +0000 (07:06 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 14:39:21 +0000 (00:39 +1000)
commit65b37aefacd917af530765fba4afca2de7b9cc47
tree88beb79699ed2916ad1d9082613bc11ce792fbd3
parent714c3e73bff78dde5eb7bd73951d6ab05abf1fbf
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 31cfb7c74cfc9 ("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>
arch/powerpc/lib/Makefile
arch/powerpc/lib/memcmp_32.S [new file with mode: 0644]
arch/powerpc/lib/string.S