aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Do Nascimento <victor.donascimento@arm.com>2024-03-05 20:38:26 +0000
committerVictor Do Nascimento <victor.donascimento@arm.com>2024-03-27 10:33:46 +0000
commit258defbdee985c8f27c33e9f533c19d059941972 (patch)
tree6f3256828cea9576c63cf099b9dd0f0e65ee4e8e
parentd9ea5181800fee3c0c21c33a463d8ca90b004ff6 (diff)
downloadgcc-258defbdee985c8f27c33e9f533c19d059941972.zip
gcc-258defbdee985c8f27c33e9f533c19d059941972.tar.gz
gcc-258defbdee985c8f27c33e9f533c19d059941972.tar.bz2
aarch64: Align lrcpc3 FEAT_STRING with /proc/cpuinfo 'Features' entry
Due to the Linux kernel exposing the lrcpc3 architectural feature as "lrcpc3", this patch corrects the relevant FEATURE_STRING entry in the "rcpc3" AARCH64_OPT_FMV_EXTENSION macro, such that the feature can be correctly detected when doing native compilation on rcpc3-enabled targets. gcc/ChangeLog: * config/aarch64/aarch64-option-extensions.def (rcpc3): Fix FEATURE_STRING field to "lrcpc3". gcc/testsuite/ChangeLog: * gcc.target/aarch64/cpunative/info_24: New. * gcc.target/aarch64/cpunative/native_cpu_24.c: Likewise.
-rw-r--r--gcc/config/aarch64/aarch64-option-extensions.def2
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/info_248
-rw-r--r--gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_24.c11
3 files changed, 20 insertions, 1 deletions
diff --git a/gcc/config/aarch64/aarch64-option-extensions.def b/gcc/config/aarch64/aarch64-option-extensions.def
index ac54b89..061a145 100644
--- a/gcc/config/aarch64/aarch64-option-extensions.def
+++ b/gcc/config/aarch64/aarch64-option-extensions.def
@@ -174,7 +174,7 @@ AARCH64_OPT_FMV_EXTENSION("rcpc", RCPC, (), (), (), "lrcpc")
AARCH64_FMV_FEATURE("rcpc2", RCPC2, (RCPC))
-AARCH64_OPT_FMV_EXTENSION("rcpc3", RCPC3, (), (), (), "rcpc3")
+AARCH64_OPT_FMV_EXTENSION("rcpc3", RCPC3, (), (), (), "lrcpc3")
AARCH64_FMV_FEATURE("frintts", FRINTTS, ())
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/info_24 b/gcc/testsuite/gcc.target/aarch64/cpunative/info_24
new file mode 100644
index 0000000..8d3c16a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/info_24
@@ -0,0 +1,8 @@
+processor : 0
+BogoMIPS : 100.00
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 asimddp lrcpc3
+CPU implementer : 0xfe
+CPU architecture: 8
+CPU variant : 0x0
+CPU part : 0xd08
+CPU revision : 2 \ No newline at end of file
diff --git a/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_24.c b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_24.c
new file mode 100644
index 0000000..05dc870
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_24.c
@@ -0,0 +1,11 @@
+/* { dg-do compile { target { { aarch64*-*-linux*} && native } } } */
+/* { dg-set-compiler-env-var GCC_CPUINFO "$srcdir/gcc.target/aarch64/cpunative/info_23" } */
+/* { dg-additional-options "-mcpu=native --save-temps " } */
+
+int main()
+{
+ return 0;
+}
+
+/* { dg-final { scan-assembler {\.arch armv8-a\+dotprod\+crc\+crypto\+rcpc3} } } */
+/* Test one where rcpc3 is available and so should be emitted. */