public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] aarch64: Add -march support for Armv9.1-A, Armv9.2-A, Armv9.3-A
@ 2022-09-26  9:14 Kyrylo Tkachov
  0 siblings, 0 replies; only message in thread
From: Kyrylo Tkachov @ 2022-09-26  9:14 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 825 bytes --]

Hi all,

This is a straightforward patch that allows targeting the architecture revisions mentioned in the subject
through -march. These are already supported in binutils.

Bootstrapped and tested on aarch64-none-linux-gnu.
Pushing to trunk.
Thanks,
Kyrill

gcc/ChangeLog:

	* config/aarch64/aarch64-arches.def (armv9.1-a): Define.
	(armv9.2-a): Likewise.
	(armv9.3-a): Likewise.
	* config/aarch64/aarch64.h (AARCH64_FL_V9_1): Likewise.
	(AARCH64_FL_V9_2): Likewise.
	(AARCH64_FL_V9_3): Likewise.
	(AARCH64_FL_FOR_ARCH9_1): Likewise.
	(AARCH64_FL_FOR_ARCH9_2): Likewise.
	(AARCH64_FL_FOR_ARCH9_3): Likewise.
	(AARCH64_ISA_V9_1): Likewise.
	(AARCH64_ISA_V9_2): Likewise.
	(AARCH64_ISA_V9_3): Likewise.
	* doc/invoke.texi (AArch64 Options): Document armv9.1-a, armv9.2-a,
	armv9.3-a values to -march.

[-- Attachment #2: v9-x.patch --]
[-- Type: application/octet-stream, Size: 3437 bytes --]

diff --git a/gcc/config/aarch64/aarch64-arches.def b/gcc/config/aarch64/aarch64-arches.def
index 3c2b1658897fa91db89c71f35b9e08598faac050..6150448dc30efe6ec0a6ed24c81b7907da56aeeb 100644
--- a/gcc/config/aarch64/aarch64-arches.def
+++ b/gcc/config/aarch64/aarch64-arches.def
@@ -41,5 +41,8 @@ AARCH64_ARCH("armv8.7-a",     generic,       8_7A,      8,  AARCH64_FL_FOR_ARCH8
 AARCH64_ARCH("armv8.8-a",     generic,       8_8A,      8,  AARCH64_FL_FOR_ARCH8_8)
 AARCH64_ARCH("armv8-r",       generic,	     8R  ,	8,  AARCH64_FL_FOR_ARCH8_R)
 AARCH64_ARCH("armv9-a",       generic,	     9A  ,	9,  AARCH64_FL_FOR_ARCH9)
+AARCH64_ARCH("armv9.1-a",     generic,       9_1A,      9,  AARCH64_FL_FOR_ARCH9_1)
+AARCH64_ARCH("armv9.2-a",     generic,       9_2A,      9,  AARCH64_FL_FOR_ARCH9_2)
+AARCH64_ARCH("armv9.3-a",     generic,       9_3A,      9,  AARCH64_FL_FOR_ARCH9_3)
 
 #undef AARCH64_ARCH
diff --git a/gcc/config/aarch64/aarch64.h b/gcc/config/aarch64/aarch64.h
index 6f6bb70fde955f6664e7cd48236ef79d0ee330d5..f790de1cf46d68c78e2b6bae54ec7a72b4b2a020 100644
--- a/gcc/config/aarch64/aarch64.h
+++ b/gcc/config/aarch64/aarch64.h
@@ -239,6 +239,15 @@
 /* Armv8.8-a architecture extensions.  */
 #define AARCH64_FL_V8_8       (1ULL << 45)
 
+/* Armv9.1-A.  */
+#define AARCH64_FL_V9_1       (1ULL << 46)
+
+/* Armv9.2-A.  */
+#define AARCH64_FL_V9_2       (1ULL << 47)
+
+/* Armv9.3-A.  */
+#define AARCH64_FL_V9_3       (1ULL << 48)
+
 /* Has FP and SIMD.  */
 #define AARCH64_FL_FPSIMD     (AARCH64_FL_FP | AARCH64_FL_SIMD)
 
@@ -273,6 +282,12 @@
 #define AARCH64_FL_FOR_ARCH9       \
   (AARCH64_FL_FOR_ARCH8_5 | AARCH64_FL_SVE | AARCH64_FL_SVE2 | AARCH64_FL_V9 \
    | AARCH64_FL_F16)
+#define AARCH64_FL_FOR_ARCH9_1	\
+  (AARCH64_FL_FOR_ARCH9 | AARCH64_FL_FOR_ARCH8_6 | AARCH64_FL_V9_1)
+#define AARCH64_FL_FOR_ARCH9_2	\
+  (AARCH64_FL_FOR_ARCH9_1 | AARCH64_FL_FOR_ARCH8_7 | AARCH64_FL_V9_2)
+#define AARCH64_FL_FOR_ARCH9_3	\
+  (AARCH64_FL_FOR_ARCH9_2 | AARCH64_FL_FOR_ARCH8_8 | AARCH64_FL_V9_3)
 
 /* Macros to test ISA flags.  */
 
@@ -312,6 +327,9 @@
 #define AARCH64_ISA_V8_R	   (aarch64_isa_flags & AARCH64_FL_V8_R)
 #define AARCH64_ISA_PAUTH	   (aarch64_isa_flags & AARCH64_FL_PAUTH)
 #define AARCH64_ISA_V9		   (aarch64_isa_flags & AARCH64_FL_V9)
+#define AARCH64_ISA_V9_1           (aarch64_isa_flags & AARCH64_FL_V9_1)
+#define AARCH64_ISA_V9_2           (aarch64_isa_flags & AARCH64_FL_V9_2)
+#define AARCH64_ISA_V9_3           (aarch64_isa_flags & AARCH64_FL_V9_3)
 #define AARCH64_ISA_MOPS	   (aarch64_isa_flags & AARCH64_FL_MOPS)
 #define AARCH64_ISA_LS64	   (aarch64_isa_flags & AARCH64_FL_LS64)
 
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 928ab0ff02f2e7ced54bd560a215ffb74e27ab55..19275c5533613185ae717c33be491ee6a316f436 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -19681,6 +19681,9 @@ and the features that they enable by default:
 @item @samp{armv8.7-a} @tab Armv8.7-A @tab @samp{armv8.6-a}, @samp{+ls64}
 @item @samp{armv8.8-a} @tab Armv8.8-a @tab @samp{armv8.7-a}, @samp{+mops}
 @item @samp{armv9-a} @tab Armv9-A @tab @samp{armv8.5-a}, @samp{+sve}, @samp{+sve2}
+@item @samp{armv9.1-a} @tab Armv9.1-A @tab @samp{armv9-a}, @samp{+bf16}, @samp{+i8mm}
+@item @samp{armv9.2-a} @tab Armv9.2-A @tab @samp{armv9.1-a}, @samp{+ls64}
+@item @samp{armv9.3-a} @tab Armv9.3-A @tab @samp{armv9.2-a}, @samp{+mops}
 @item @samp{armv8-r} @tab Armv8-R @tab @samp{armv8-r}
 @end multitable
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-26  9:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26  9:14 [PATCH] aarch64: Add -march support for Armv9.1-A, Armv9.2-A, Armv9.3-A 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).