diff options
author | Noah Goldstein <goldstein.w.n@gmail.com> | 2022-07-03 21:28:07 -0700 |
---|---|---|
committer | Noah Goldstein <goldstein.w.n@gmail.com> | 2022-07-05 16:42:42 -0700 |
commit | c69f960b017b2cdf39335739009526a72fb20379 (patch) | |
tree | 7ddf954fb2901d7c934b07d5dd5990501315a732 /sysdeps/x86_64/multiarch/strspn-generic.c | |
parent | baeae86fb8ccd85b6bf9b5091884fa9b66d84a99 (diff) | |
download | glibc-c69f960b017b2cdf39335739009526a72fb20379.tar.gz glibc-c69f960b017b2cdf39335739009526a72fb20379.tar.xz glibc-c69f960b017b2cdf39335739009526a72fb20379.zip |
x86: Add support for building str{c|p}{brk|spn} with explicit ISA level
The changes for these functions are different than the others because the best implementation (sse4_2) requires the generic implementation as a fallback to be built as well. Changes are: 1. Add non-multiarch functions for str{c|p}{brk|spn}.c to statically select the best implementation based on the configured ISA build level. 2. Add stubs for str{c|p}{brk|spn}-generic and varshift.c to in the sysdeps/x86_64 directory so that the the sse4 implementation will have all of its dependencies for the non-multiarch / rtld build when ISA level >= 2. 3. Add new multiarch/rtld-strcspn.c that just include the non-multiarch strcspn.c which will in turn select the best implementation based on the compiled ISA level. 4. Refactor the ifunc selector and ifunc implementation list to use the ISA level aware wrapper macros that allow functions below the compiled ISA level (with a guranteed replacement) to be skipped. Tested with and without multiarch on x86_64 for ISA levels: {generic, x86-64-v2, x86-64-v3, x86-64-v4} And m32 with and without multiarch.
Diffstat (limited to 'sysdeps/x86_64/multiarch/strspn-generic.c')
-rw-r--r-- | sysdeps/x86_64/multiarch/strspn-generic.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/x86_64/multiarch/strspn-generic.c b/sysdeps/x86_64/multiarch/strspn-generic.c index 6b50c36432..0f485ab4da 100644 --- a/sysdeps/x86_64/multiarch/strspn-generic.c +++ b/sysdeps/x86_64/multiarch/strspn-generic.c @@ -16,13 +16,16 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ -#if IS_IN (libc) - +/* We always need to build this implementation as strspn-sse4 needs to + be able to fallback to it. */ +#include <isa-level.h> +#if IS_IN (libc) || MINIMUM_X86_ISA_LEVEL >= 2 # include <sysdep.h> # define STRSPN __strspn_generic # undef libc_hidden_builtin_def # define libc_hidden_builtin_def(STRSPN) + #endif #include <string/strspn.c> |