compiler-builtins
compiler-builtins copied to clipboard
Optimized implementations for supported architectures
This is a feature request for optimized implementations for common architectures (x64, ARM32/64). My understanding is that most of the <string.h> functions are usually implemented in assembler in libc.
See https://git.linaro.org/toolchain/cortex-strings.git/tree for implementations for ARM32/64.
@Amanieu Can some of these be included in this crate, or does licensing not allow this?
The code seems to be under a BSD license, so it should be fine to include it.
Since they use a lot of preprocessor macros, I think the best way would be to just include the asm files are they are and compile them with the cc crate in build.rs.
I don't think this even requires target-specific changes, just not doing things like writing a byte at a time in memset would already help targets which have no specific LLVM optimisations.
Note, this has since moved to https://github.com/ARM-software/optimized-routines, and the license marks it as MIT.
Given that the licensing here is currently in a sorry state, this must be clearly marked of we want to include this.