Yury Khrustalev <[email protected]> writes:
> Note that compared to __builtin_aarch64_chkfeat (x) the ACLE __chkfeat(x)
> flips the bits to be more intuitive (xor the input to output).
>
> gcc/ChangeLog:
> * config/aarch64/arm_acle.h (__chkfeat): New.
> ---
> gcc/config/aarch64/arm_acle.h | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/gcc/config/aarch64/arm_acle.h b/gcc/config/aarch64/arm_acle.h
> index ab4e7e60e04..e363587701c 100644
> --- a/gcc/config/aarch64/arm_acle.h
> +++ b/gcc/config/aarch64/arm_acle.h
> @@ -190,8 +190,21 @@ __rint64x (double __a)
>
> #pragma GCC pop_options
>
> +
> #pragma GCC push_options
> +#pragma GCC target ("arch=armv8.9-a")
> +
> +__extension__ extern __inline uint64_t
> +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
> +__chkfeat (uint64_t __feat)
> +{
> + return __builtin_aarch64_chkfeat (__feat) ^ __feat;
> +}
Since this is a hint instruction, I think it should be available
unconditionally, e.g. using:
#pragma GCC target ("+nothing")
Thanks,
Richard
>
> +#pragma GCC pop_options
> +
> +
> +#pragma GCC push_options
> #pragma GCC target ("+nothing+crc")
>
> __extension__ extern __inline uint32_t