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. --- gcc/config/aarch64/aarch64-c.cc | 1 + .../gcc.target/aarch64/pragma_cpp_predefs_3.c | 84 +++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/gcc/config/aarch64/aarch64-c.cc b/gcc/config/aarch64/aarch64-c.cc index f9b9e379375..d1ae80c0bb3 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 39128528600..f1f70ed7b5c 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 -- 2.25.1