diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-02-20 13:46:36 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2023-02-20 16:43:42 -0300 |
commit | 97830304bb477f18b67b7bc11989fb3357da443e (patch) | |
tree | a76eda4861d3f716ff522b89c25e9fa7e49ac155 /sysdeps/arm | |
parent | 3f98a5c027de375ffe34cf036f80bacb9a40a9be (diff) | |
download | glibc-97830304bb477f18b67b7bc11989fb3357da443e.zip glibc-97830304bb477f18b67b7bc11989fb3357da443e.tar.gz glibc-97830304bb477f18b67b7bc11989fb3357da443e.tar.bz2 |
arm: Support gcc older than 10 for find_zero_all
__builtin_arm_uqsub8 is only available on gcc newer or equal than 10.
Checked on arm-linux-gnueabihf built with gcc 9.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'sysdeps/arm')
-rw-r--r-- | sysdeps/arm/armv6t2/string-fza.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/arm/armv6t2/string-fza.h b/sysdeps/arm/armv6t2/string-fza.h index 76274cc..d85ce86 100644 --- a/sysdeps/arm/armv6t2/string-fza.h +++ b/sysdeps/arm/armv6t2/string-fza.h @@ -33,7 +33,13 @@ find_zero_all (op_t x) /* Use unsigned saturated subtraction from 1 in each byte. That leaves 1 for every byte that was zero. */ op_t ones = repeat_bytes (0x01); +#if __GNUC_PREREQ (10, 0) return __builtin_arm_uqsub8 (ones, x); +#else + op_t ret; + asm ("uqsub8 %0,%1,%2" : "=r"(ret) : "r"(ones), "r"(x)); + return ret; +#endif } /* Identify bytes that are equal between X1 and X2. */ |