[PATCH v12 18/31] arm: Add string-fza.h
Szabolcs Nagy
szabolcs.nagy@arm.com
Mon Feb 20 13:24:30 GMT 2023
The 02/02/2023 15:11, Adhemerval Zanella via Libc-alpha wrote:
> From: Richard Henderson <richard.henderson@linaro.org>
>
> While arm has the more important string functions in assembly,
> there are still a few generic routines used.
>
> Use the UQSUB8 insn for testing of zeros.
>
> Checked on armv7-linux-gnueabihf
> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
> ---
> sysdeps/arm/armv6t2/string-fza.h | 68 ++++++++++++++++++++++++++++++++
...
> +static __always_inline find_t
> +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);
> + return __builtin_arm_uqsub8 (ones, x);
> +}
__builtin_arm_uqsub8 is only available >=gcc-10
so now the build fails with gcc-9
../sysdeps/arm/armv6t2/string-fza.h:36:10: error: implicit declaration of function ‘__builtin_arm_uqsub8’; did you mean ‘__builtin_arm_stc’? [-Werror=implicit-function-declaration]
36 | return __builtin_arm_uqsub8 (ones, x);
so this code should be conditional on gcc version.
More information about the Libc-alpha
mailing list