Port amd64 SIMD libc optimizations to riscv64
Student: StrahinjaStanisic (strajabot@FreeBSD.com)
Mentor: RobertClausecker (fuz@FreeBSD.com), EdMaste (emaste@FreeBSD.com)
Project description
The goal of the project is to port the SIMD optimized routines written for amd64 to riscv64. This will be accomplished using SWAR techniques. Because the code will only depend on the base integer ISA, the optimizations will result in a performance increase on all riscv64 systems.
Deliverables
Implemented functions:
memset - Done - memset.S
memcpy - Done - memcpy.S
memchr - Done - memchr.S
memrchr - Bugged? - memrchr.S
strlen - Done - strlen.S
strnlen - Done - strnlen.S
strchrnul - Done - strchrnul.S
strrchr - Done - strrchr.S
By finishing these functions, the following functions also received performance improvements:
bcmp -> from memset
bzero -> from memset
strcpy -> from stpcpy
strlcat -> from memchr
strncat -> from strlen
Also as part of the project two unit tests were improved:
The following functions remain to be implemented:
memmove
memcmp
memccpy
stpcpy
stpncpy
strcat
strcmp
strcspn
strlcpy
strncmp
strspn
After all of the functions are implemented, and after an exp-run, the functions will be merged into -CURRENT.
A repository containing performance improvement results can be found here.
Milestones
- May 27th: Start of coding
- June 3rd: Second week
- July 8th - July 12th: Mid-term Evaluations
- August 19th - August 26th: Final week
Test Plan
Code will be tested using the available FreeBSD tests on a RISC-V development board (HF105-000). Additional tests will be written if needed. Performance will be measured using strperf (https://github.com/clausecker/strperf).
The Code
https://github.com/strajabot/freebsd-src
Notes
I will posting updates on my blog while I work on the project (https://strajabot.com)
(Lorem ipsum dolor sit amet)