riscv: Add and use alignment-ignorant memcpy
commit587a1290a1af7bee6dbb40ebadb7a4d71e698baf
authorEvan Green <evan@rivosinc.com>
Tue, 27 Feb 2024 22:56:43 +0000 (27 14:56 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 1 Mar 2024 15:15:01 +0000 (1 07:15 -0800)
tree1e01dbbb28f39cc0c24653f56d9482038fa25339
parenta2b47f7d4679a01d56827e1aff2a40de173fab23
riscv: Add and use alignment-ignorant memcpy

For CPU implementations that can perform unaligned accesses with little
or no performance penalty, create a memcpy implementation that does not
bother aligning buffers. It will use a block of integer registers, a
single integer register, and fall back to bytewise copy for the
remainder.

Signed-off-by: Evan Green <evan@rivosinc.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
sysdeps/riscv/memcopy.h [new file with mode: 0644]
sysdeps/riscv/memcpy.c [new file with mode: 0644]
sysdeps/riscv/memcpy_noalignment.S [new file with mode: 0644]
sysdeps/unix/sysv/linux/riscv/Makefile
sysdeps/unix/sysv/linux/riscv/memcpy-generic.c [new file with mode: 0644]