compiler-builtins icon indicating copy to clipboard operation
compiler-builtins copied to clipboard

Optimized implementations for supported architectures

Open DemiMarie opened this issue 6 years ago • 5 comments

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.

DemiMarie avatar Dec 27 '17 22:12 DemiMarie

See https://git.linaro.org/toolchain/cortex-strings.git/tree for implementations for ARM32/64.

Amanieu avatar Dec 27 '17 23:12 Amanieu

@Amanieu Can some of these be included in this crate, or does licensing not allow this?

DemiMarie avatar Dec 27 '17 23:12 DemiMarie

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.

Amanieu avatar Dec 27 '17 23:12 Amanieu

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.

Ravenslofty avatar Nov 12 '18 23:11 Ravenslofty

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.

skade avatar Oct 29 '19 09:10 skade