aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2024-11-11 12:32:21 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2024-11-11 12:32:21 +0000
commite68e814d1f4360bac78d9b5f4e0feb6e41a98a27 (patch)
treecfd7b6c07732d85d75b9ed062d6da29735e3acfe /gcc
parent2cc4c2a281e983d735c4c38091d67508d3b4f892 (diff)
downloadgcc-e68e814d1f4360bac78d9b5f4e0feb6e41a98a27.zip
gcc-e68e814d1f4360bac78d9b5f4e0feb6e41a98a27.tar.gz
gcc-e68e814d1f4360bac78d9b5f4e0feb6e41a98a27.tar.bz2
aarch64: Conditionally define __ARM_FEATURE_SVE2p1
Previous patches are supposed to add full support for SVE2.1, so this patch advertises that through __ARM_FEATURE_SVE2p1. pragma_cpp_predefs_3.c had one fewer pop than push. The final test is triple-nested: - armv8-a (to start with a clean slate, untainted by command-line flags) - the maximal SVE set - general-regs-only gcc/ * config/aarch64/aarch64-c.cc (aarch64_update_cpp_builtins): Handle __ARM_FEATURE_SVE2p1. gcc/testsuite/ * gcc.target/aarch64/pragma_cpp_predefs_3.c: Add SVE2p1 tests.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/aarch64/aarch64-c.cc1
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c84
2 files changed, 85 insertions, 0 deletions
diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc
index f9b9e37..d1ae80c 100644
--- a/gcc/config/aarch64/aarch64-c.cc
+++ b/gcc/config/aarch64/aarch64-c.cc
@@ -214,6 +214,7 @@ aarch64_update_cpp_builtins (cpp_reader *pfile)
"__ARM_FEATURE_SVE2_BITPERM", pfile);
aarch64_def_or_undef (TARGET_SVE2_SHA3, "__ARM_FEATURE_SVE2_SHA3", pfile);
aarch64_def_or_undef (TARGET_SVE2_SM4, "__ARM_FEATURE_SVE2_SM4", pfile);
+ aarch64_def_or_undef (TARGET_SVE2p1, "__ARM_FEATURE_SVE2p1", pfile);
aarch64_def_or_undef (TARGET_LSE, "__ARM_FEATURE_ATOMICS", pfile);
aarch64_def_or_undef (TARGET_AES, "__ARM_FEATURE_AES", pfile);
diff --git a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c
index 3912852..f1f70ed 100644
--- a/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c
+++ b/gcc/testsuite/gcc.target/aarch64/pragma_cpp_predefs_3.c
@@ -28,6 +28,10 @@
#error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
#endif
+#ifdef __ARM_FEATURE_SVE2p1
+#error "__ARM_FEATURE_SVE2p1 is defined but should not be!"
+#endif
+
#pragma GCC push_options
#pragma GCC target ("arch=armv8.2-a+sve")
@@ -55,6 +59,10 @@
#error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
#endif
+#ifdef __ARM_FEATURE_SVE2p1
+#error "__ARM_FEATURE_SVE2p1 is defined but should not be!"
+#endif
+
#pragma GCC pop_options
#pragma GCC push_options
@@ -84,6 +92,10 @@
#error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
#endif
+#ifdef __ARM_FEATURE_SVE2p1
+#error "__ARM_FEATURE_SVE2p1 is defined but should not be!"
+#endif
+
#pragma GCC pop_options
#pragma GCC push_options
@@ -242,6 +254,72 @@
#error "__ARM_FEATURE_SVE2_SM4 is not defined but should be!"
#endif
+#pragma GCC pop_options
+
+#pragma GCC push_options
+#pragma GCC target ("arch=armv9-a+sve2p1")
+
+#ifndef __ARM_FEATURE_SVE
+#error "__ARM_FEATURE_SVE is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2
+#error "__ARM_FEATURE_SVE2 is not defined but should be!"
+#endif
+
+#ifdef __ARM_FEATURE_SVE2_AES
+#error "__ARM_FEATURE_SVE2_AES is defined but should not be!"
+#endif
+
+#ifdef __ARM_FEATURE_SVE2_BITPERM
+#error "__ARM_FEATURE_SVE2_BITPERM is defined but should not be!"
+#endif
+
+#ifdef __ARM_FEATURE_SVE2_SHA3
+#error "__ARM_FEATURE_SVE2_SHA3 is defined but should not be!"
+#endif
+
+#ifdef __ARM_FEATURE_SVE2_SM4
+#error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2p1
+#error "__ARM_FEATURE_SVE2p1 is not defined but should be!"
+#endif
+
+#pragma GCC pop_options
+
+#pragma GCC push_options
+#pragma GCC target ("arch=armv9-a+sve2-aes+sve2-bitperm+sve2-sha3+sve2-sm4+sve2p1")
+
+#ifndef __ARM_FEATURE_SVE
+#error "__ARM_FEATURE_SVE is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2
+#error "__ARM_FEATURE_SVE2 is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2_AES
+#error "__ARM_FEATURE_SVE2_AES is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2_BITPERM
+#error "__ARM_FEATURE_SVE2_BITPERM is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2_SHA3
+#error "__ARM_FEATURE_SVE2_SHA3 is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2_SM4
+#error "__ARM_FEATURE_SVE2_SM4 is not defined but should be!"
+#endif
+
+#ifndef __ARM_FEATURE_SVE2p1
+#error "__ARM_FEATURE_SVE2p1 is not defined but should be!"
+#endif
+
#pragma GCC push_options
#pragma GCC target ("general-regs-only")
@@ -269,6 +347,12 @@
#error "__ARM_FEATURE_SVE2_SM4 is defined but should not be!"
#endif
+#ifdef __ARM_FEATURE_SVE2p1
+#error "__ARM_FEATURE_SVE2p1 is defined but should not be!"
+#endif
+
+#pragma GCC pop_options
+
#pragma GCC pop_options
#pragma GCC pop_options