]> git.baikalelectronics.ru Git - kernel.git/commit
openrisc: Add optimized memcpy routine
authorStafford Horne <shorne@gmail.com>
Mon, 21 Mar 2016 07:16:46 +0000 (16:16 +0900)
committerStafford Horne <shorne@gmail.com>
Fri, 24 Feb 2017 19:14:36 +0000 (04:14 +0900)
commita7766c9c2e99132d97b3e67eb0a13b067c2b0d6d
tree1ad140d3860d795bf9e425d1aa5d34faf0514c22
parent53ee0f3906d7e757db982c1c0f2d54c24c1c3b5f
openrisc: Add optimized memcpy routine

The generic memcpy routine provided in kernel does only byte copies.
Using word copies we can lower boot time and cycles spend in memcpy
quite significantly.

Booting on my de0 nano I see boot times go from 7.2 to 5.6 seconds.
The avg cycles in memcpy during boot go from 6467 to 1887.

I tested several algorithms (see code in previous patch mails)

The implementations I tested and avg cycles:
  - Word Copies + Loop Unrolls + Non Aligned    1882
  - Word Copies + Loop Unrolls                  1887
  - Word Copies                                 2441
  - Byte Copies + Loop Unrolls                  6467
  - Byte Copies                                 7600

In the end I ended up going with Word Copies + Loop Unrolls as it
provides best tradeoff between simplicity and boot speedups.

Signed-off-by: Stafford Horne <shorne@gmail.com>
arch/openrisc/TODO.openrisc
arch/openrisc/include/asm/string.h
arch/openrisc/lib/Makefile
arch/openrisc/lib/memcpy.c [new file with mode: 0644]