* [PATCH] aarch64: Align lrcpc3 FEAT_STRING with /proc/cpuinfo 'Features' entry
@ 2024-03-25 10:58 Victor Do Nascimento
2024-03-25 11:04 ` Kyrylo Tkachov
0 siblings, 1 reply; 2+ messages in thread
From: Victor Do Nascimento @ 2024-03-25 10:58 UTC (permalink / raw)
To: gcc-patches
Cc: kyrylo.tkachov, richard.sandiford, Richard.Earnshaw,
Victor Do Nascimento
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.
Regtested on aarch64-linux-gnu.
gcc/ChangeLog:
* config/aarch64/aarch64-option-extensions.def: Fix 'lrcpc3'
entry.
gcc/testsuite/ChangeLog:
* testsuite/gcc.target/aarch64/cpunative/info_24: New.
* testsuite/gcc.target/aarch64/cpunative/native_cpu_24.c:
Likewise.
---
gcc/config/aarch64/aarch64-option-extensions.def | 2 +-
gcc/testsuite/gcc.target/aarch64/cpunative/info_24 | 8 ++++++++
.../gcc.target/aarch64/cpunative/native_cpu_24.c | 11 +++++++++++
3 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.target/aarch64/cpunative/info_24
create mode 100644 gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_24.c
diff --git a/gcc/config/aarch64/aarch64-option-extensions.def b/gcc/config/aarch64/aarch64-option-extensions.def
index 1a3b91c68cf..975e7b84cec 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 00000000000..8d3c16a1091
--- /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 00000000000..05dc870885f
--- /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. */
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: [PATCH] aarch64: Align lrcpc3 FEAT_STRING with /proc/cpuinfo 'Features' entry
2024-03-25 10:58 [PATCH] aarch64: Align lrcpc3 FEAT_STRING with /proc/cpuinfo 'Features' entry Victor Do Nascimento
@ 2024-03-25 11:04 ` Kyrylo Tkachov
0 siblings, 0 replies; 2+ messages in thread
From: Kyrylo Tkachov @ 2024-03-25 11:04 UTC (permalink / raw)
To: Victor Do Nascimento, gcc-patches
Cc: Richard Sandiford, Richard Earnshaw, Victor Do Nascimento
Hi Victor,
> -----Original Message-----
> From: Victor Do Nascimento <victor.donascimento@arm.com>
> Sent: Monday, March 25, 2024 10:59 AM
> To: gcc-patches@gcc.gnu.org
> Cc: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; Richard Sandiford
> <Richard.Sandiford@arm.com>; Richard Earnshaw
> <Richard.Earnshaw@arm.com>; Victor Do Nascimento
> <Victor.DoNascimento@arm.com>
> Subject: [PATCH] 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.
>
> Regtested on aarch64-linux-gnu.
Ok but...
>
> gcc/ChangeLog:
>
> * config/aarch64/aarch64-option-extensions.def: Fix 'lrcpc3'
> entry.
This would usually be written as:
* config/aarch64/aarch64-option-extensions.def (rcpc3):
Fix FEATURE_STRING field to "lrcpc3".
Thanks,
Kyrill
>
> gcc/testsuite/ChangeLog:
>
> * testsuite/gcc.target/aarch64/cpunative/info_24: New.
> * testsuite/gcc.target/aarch64/cpunative/native_cpu_24.c:
> Likewise.
> ---
> gcc/config/aarch64/aarch64-option-extensions.def | 2 +-
> gcc/testsuite/gcc.target/aarch64/cpunative/info_24 | 8 ++++++++
> .../gcc.target/aarch64/cpunative/native_cpu_24.c | 11 +++++++++++
> 3 files changed, 20 insertions(+), 1 deletion(-)
> create mode 100644 gcc/testsuite/gcc.target/aarch64/cpunative/info_24
> create mode 100644
> gcc/testsuite/gcc.target/aarch64/cpunative/native_cpu_24.c
>
> diff --git a/gcc/config/aarch64/aarch64-option-extensions.def
> b/gcc/config/aarch64/aarch64-option-extensions.def
> index 1a3b91c68cf..975e7b84cec 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 00000000000..8d3c16a1091
> --- /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 00000000000..05dc870885f
> --- /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. */
> --
> 2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-25 11:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-25 10:58 [PATCH] aarch64: Align lrcpc3 FEAT_STRING with /proc/cpuinfo 'Features' entry Victor Do Nascimento
2024-03-25 11:04 ` Kyrylo Tkachov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).