]> git.feebdaed.xyz Git - 0xmirror/gcc.git/commitdiff
aarch64: Add ACLE macro __ARM_FEATURE_SVE_PREDICATE_OPERATORS
authorTejas Belagod <tejas.belagod@arm.com>
Wed, 17 Dec 2025 15:37:23 +0000 (15:37 +0000)
committerTejas Belagod <tejas.belagod@arm.com>
Thu, 18 Dec 2025 11:08:52 +0000 (11:08 +0000)
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.

gcc/config/aarch64/aarch64-c.cc
gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_1.c
gcc/testsuite/gcc.target/aarch64/sve/acle/general/attributes_9.c [new file with mode: 0644]

index de4444bacb79804eaa6b31d3fc9783574feb249a..04cd7c354e569e5c190795eee7a977ce81d95108 100644 (file)
@@ -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);
index 17acfc32e7861115d084d1a4d3c84e2efeedc1be..e5b71eb77b8af0ad4afc672389b4f3b48e85d1b1 100644 (file)
 #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 (file)
index 0000000..ab7b9eb
--- /dev/null
@@ -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