From: Tejas Belagod Date: Wed, 17 Dec 2025 15:37:23 +0000 (+0000) Subject: aarch64: Add ACLE macro __ARM_FEATURE_SVE_PREDICATE_OPERATORS X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63c6821bf4c5ee38b2152626c202727e1e16b4cd;p=thirdparty%2Fgcc.git 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 --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index de4444bacb7..04cd7c354e5 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 17acfc32e78..e5b71eb77b8 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 00000000000..ab7b9eb1bc1 --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_9.c @@ -0,0 +1,9 @@ +#include + +#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