arm-trusted-firmware/lib/libc
Andre Przywara 75fab6496e libc: memset: improve performance by avoiding single byte writes
Currently our memset() implementation is safe, but slow. The main reason
for that seems to be the single byte writes that it issues, which can
show horrible performance, depending on the implementation of the
load/store subsystem.

Improve the algorithm by trying to issue 64-bit writes. As this only
works with aligned pointers, have a head and a tail section which
covers unaligned pointers, and leave the bulk of the work to the middle
section that does use 64-bit writes.

Put through some unit tests, which exercise all combinations of nasty
input parameters (pointers with various alignments, various odd and even
sizes, corner cases of content to write (-1, 256)).

Change-Id: I28ddd3d388cc4989030f1a70447581985368d5bb
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2020-09-03 23:00:24 +01:00
..
aarch64 Revert "libc/memset: Implement function in assembler" 2020-08-21 19:33:46 +00:00
abort.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
assert.c libc: fix sparse warning for __assert() 2019-09-11 11:28:46 +09:00
exit.c libc: Fix some MISRA defects 2018-08-30 16:21:59 +01:00
libc.mk Revert "libc/memset: Implement function in assembler" 2020-08-21 19:33:46 +00:00
memchr.c libc: fix memchr implementation 2019-06-20 09:59:24 +01:00
memcmp.c Remove several warnings reported with W=1 2019-04-01 10:43:42 +01:00
memcpy.c Remove several warnings reported with W=1 2019-04-01 10:43:42 +01:00
memmove.c libc: Cleanup remaining files 2018-08-22 10:26:04 +01:00
memrchr.c libc: add memrchr 2019-12-11 08:51:26 +01:00
memset.c libc: memset: improve performance by avoiding single byte writes 2020-09-03 23:00:24 +01:00
printf.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
putchar.c Sanitise includes across codebase 2019-01-04 10:43:17 +00:00
puts.c libc: Fix some MISRA defects 2018-08-30 16:21:59 +01:00
snprintf.c Add support for hexadecimal and pointer format specifiers to snprintf() 2020-08-26 10:27:47 +01:00
strchr.c libc: Cleanup FreeBSD files 2018-08-22 10:26:05 +01:00
strcmp.c libc: Cleanup FreeBSD files 2018-08-22 10:26:05 +01:00
strlcpy.c libc: Adapt strlcpy to this codebase 2018-11-02 13:41:33 +00:00
strlen.c libc: Introduce cdefs.h, assert.h and strlen.c 2018-08-22 10:26:04 +01:00
strncmp.c libc: Cleanup FreeBSD files 2018-08-22 10:26:05 +01:00
strnlen.c libc: Cleanup FreeBSD files 2018-08-22 10:26:05 +01:00
strrchr.c libc: Integrate strrchr in libc 2018-10-23 18:27:45 +01:00