https://gcc.gnu.org/g:63c6821bf4c5ee38b2152626c202727e1e16b4cd
commit r16-6244-g63c6821bf4c5ee38b2152626c202727e1e16b4cd Author: Tejas Belagod <[email protected]> Date: Wed Dec 17 15:37:23 2025 +0000 aarch64: Add ACLE macro __ARM_FEATURE_SVE_PREDICATE_OPERATORS This patch enables ACLE macro __ARM_FEATURE_SVE_PREDICATE_OPERATORS to indicate that C/C++ language operations are available natively on SVE ACLE type svbool_t. gcc/ * config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Define __ARM_FEATURE_SVE_PREDICATE_OPERATORS. gcc/testsuite * gcc.target/aarch64/sve/acle/general/attributes_1.c: Update test for __ARM_FEATURE_SVE_PREDICATE_OPERATORS. * gcc.target/aarch64/sve/acle/general/attributes_9.c: New. Diff: --- gcc/config/aarch64/aarch64-c.cc | 3 +++ gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_1.c | 4 ++++ gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_9.c | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index de4444bacb79..04cd7c354e56 100644 --- a/gcc/config/aarch64/aarch64-c.cc +++ b/gcc/config/aarch64/aarch64-c.cc @@ -199,6 +199,7 @@ aarch64_update_cpp_builtins (cpp_reader *pfile) aarch64_def_or_undef (TARGET_SVE, "__ARM_FEATURE_SVE", pfile); cpp_undef (pfile, "__ARM_FEATURE_SVE_BITS"); cpp_undef (pfile, "__ARM_FEATURE_SVE_VECTOR_OPERATORS"); + cpp_undef (pfile, "__ARM_FEATURE_SVE_PREDICATE_OPERATORS"); if (TARGET_SVE) { int bits; @@ -210,6 +211,8 @@ aarch64_update_cpp_builtins (cpp_reader *pfile) } builtin_define_with_int_value ("__ARM_FEATURE_SVE_BITS", bits); builtin_define_with_int_value ("__ARM_FEATURE_SVE_VECTOR_OPERATORS", ops); + builtin_define_with_int_value ("__ARM_FEATURE_SVE_PREDICATE_OPERATORS", + ops); } aarch64_def_or_undef (TARGET_SVE_I8MM, "__ARM_FEATURE_SVE_MATMUL_INT8", pfile); diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_1.c index 17acfc32e786..e5b71eb77b8a 100644 --- a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_1.c +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_1.c @@ -10,6 +10,10 @@ #error "__ARM_FEATURE_SVE_VECTOR_OPERATORS should be equal to 1" #endif +#if __ARM_FEATURE_SVE_PREDICATE_OPERATORS != 1 +#error "__ARM_FEATURE_SVE_PREDICATE_OPERATORS should be equal to 1" +#endif + #ifndef __cplusplus #define alignof _Alignof #endif diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_9.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_9.c new file mode 100644 index 000000000000..ab7b9eb1bc1c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_9.c @@ -0,0 +1,9 @@ +#include <arm_sve.h> + +#if __ARM_FEATURE_SVE_VECTOR_OPERATORS != 2 +#error "__ARM_FEATURE_SVE_VECTOR_OPERATORS should be equal to 2" +#endif + +#if __ARM_FEATURE_SVE_PREDICATE_OPERATORS != 2 +#error "__ARM_FEATURE_SVE_PREDICATE_OPERATORS should be equal to 2" +#endif
