public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5046] arm: add armv9-a architecture to -march
@ 2021-11-09 11:35 Przemyslaw Wirkus
  0 siblings, 0 replies; only message in thread
From: Przemyslaw Wirkus @ 2021-11-09 11:35 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:32ba7860ccaddd5219e6dae94a3d0653e124c9dd

commit r12-5046-g32ba7860ccaddd5219e6dae94a3d0653e124c9dd
Author: Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
Date:   Tue Nov 9 09:40:05 2021 +0000

    arm: add armv9-a architecture to -march
    
    In this patch:
            + Add `armv9-a` to -march.
            + Update multilib with armv9-a and armv9-a+simd.
    
    gcc/ChangeLog:
    
            * config/arm/arm-cpus.in (armv9): New define.
            (ARMv9a): New group.
            (armv9-a): New arch definition.
            * config/arm/arm-tables.opt: Regenerate.
            * config/arm/arm.h (BASE_ARCH_9A): New arch enum value.
            * config/arm/t-aprofile: Added armv9-a and armv9+simd.
            * config/arm/t-arm-elf: Added arm9-a, v9_fps and all_v9_archs
            to MULTILIB_MATCHES.
            * config/arm/t-multilib: Added v9_a_nosimd_variants and
            v9_a_simd_variants to MULTILIB_MATCHES.
            * doc/invoke.texi: Update docs.
    
    gcc/testsuite/ChangeLog:
    
            * gcc.target/arm/multilib.exp: Update test with armv9-a entries.
            * lib/target-supports.exp (v9a): Add new armflag.
            (__ARM_ARCH_9A__): Add new armdef.

Diff:
---
 gcc/config/arm/arm-cpus.in                | 19 +++++++++++++++++++
 gcc/config/arm/arm-tables.opt             |  7 +++++--
 gcc/config/arm/arm.h                      |  3 ++-
 gcc/config/arm/t-aprofile                 | 25 +++++++++++++++++++++----
 gcc/config/arm/t-arm-elf                  |  9 +++++++++
 gcc/config/arm/t-multilib                 | 12 ++++++++++++
 gcc/doc/invoke.texi                       |  1 +
 gcc/testsuite/gcc.target/arm/multilib.exp |  8 ++++++++
 gcc/testsuite/lib/target-supports.exp     |  3 ++-
 9 files changed, 79 insertions(+), 8 deletions(-)

diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
index d0d0d0f1c7e..3756ba56c6e 100644
--- a/gcc/config/arm/arm-cpus.in
+++ b/gcc/config/arm/arm-cpus.in
@@ -132,6 +132,9 @@ define feature cmse
 # Architecture rel 8.1-M.
 define feature armv8_1m_main
 
+# Architecture rel 9.0.
+define feature armv9
+
 # Floating point and Neon extensions.
 # VFPv1 is not supported in GCC.
 
@@ -293,6 +296,7 @@ define fgroup ARMv8m_base ARMv6m armv8 cmse tdiv
 define fgroup ARMv8m_main ARMv7m armv8 cmse
 define fgroup ARMv8r      ARMv8a
 define fgroup ARMv8_1m_main ARMv8m_main armv8_1m_main
+define fgroup ARMv9a      ARMv8_5a armv9
 
 # Useful combinations.
 define fgroup VFPv2	vfpv2
@@ -751,6 +755,21 @@ begin arch armv8.1-m.main
  option cdecp7 add cdecp7
 end arch armv8.1-m.main
 
+begin arch armv9-a
+ tune for cortex-a53
+ tune flags CO_PROC
+ base 9A
+ profile A
+ isa ARMv9a
+ option simd add FP_ARMv8 DOTPROD
+ option fp16 add fp16 fp16fml FP_ARMv8 DOTPROD
+ option crypto add FP_ARMv8 CRYPTO DOTPROD
+ option nocrypto remove ALL_CRYPTO
+ option nofp remove ALL_FP
+ option i8mm add i8mm FP_ARMv8 DOTPROD
+ option bf16 add bf16 FP_ARMv8 DOTPROD
+end arch armv9-a
+
 begin arch iwmmxt
  tune for iwmmxt
  tune flags LDSCHED STRONG XSCALE
diff --git a/gcc/config/arm/arm-tables.opt b/gcc/config/arm/arm-tables.opt
index 8bb0c9f6a7b..c00e252ec5a 100644
--- a/gcc/config/arm/arm-tables.opt
+++ b/gcc/config/arm/arm-tables.opt
@@ -383,10 +383,13 @@ EnumValue
 Enum(arm_arch) String(armv8.1-m.main) Value(30)
 
 EnumValue
-Enum(arm_arch) String(iwmmxt) Value(31)
+Enum(arm_arch) String(armv9-a) Value(31)
 
 EnumValue
-Enum(arm_arch) String(iwmmxt2) Value(32)
+Enum(arm_arch) String(iwmmxt) Value(32)
+
+EnumValue
+Enum(arm_arch) String(iwmmxt2) Value(33)
 
 Enum
 Name(arm_fpu) Type(enum fpu_type)
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 015299c1534..3a8d223ee62 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -452,7 +452,8 @@ enum base_architecture
   BASE_ARCH_8A = 8,
   BASE_ARCH_8M_BASE = 8,
   BASE_ARCH_8M_MAIN = 8,
-  BASE_ARCH_8R = 8
+  BASE_ARCH_8R = 8,
+  BASE_ARCH_9A = 9
 };
 
 /* The major revision number of the ARM Architecture implemented by the target.  */
diff --git a/gcc/config/arm/t-aprofile b/gcc/config/arm/t-aprofile
index 8574ac3e24d..68e2251c726 100644
--- a/gcc/config/arm/t-aprofile
+++ b/gcc/config/arm/t-aprofile
@@ -26,8 +26,8 @@
 
 # Arch and FPU variants to build libraries with
 
-MULTI_ARCH_OPTS_A       = march=armv7-a/march=armv7-a+fp/march=armv7-a+simd/march=armv7ve+simd/march=armv8-a/march=armv8-a+simd
-MULTI_ARCH_DIRS_A       = v7-a v7-a+fp v7-a+simd v7ve+simd v8-a v8-a+simd
+MULTI_ARCH_OPTS_A       = march=armv7-a/march=armv7-a+fp/march=armv7-a+simd/march=armv7ve+simd/march=armv8-a/march=armv8-a+simd/march=armv9-a/march=armv9-a+simd
+MULTI_ARCH_DIRS_A       = v7-a v7-a+fp v7-a+simd v7ve+simd v8-a v8-a+simd v9-a v9-a+simd
 
 # ARMv7-A - build nofp, fp-d16 and SIMD variants
 
@@ -46,6 +46,11 @@ MULTILIB_REQUIRED	+= mthumb/march=armv8-a/mfloat-abi=soft
 MULTILIB_REQUIRED	+= mthumb/march=armv8-a+simd/mfloat-abi=hard
 MULTILIB_REQUIRED	+= mthumb/march=armv8-a+simd/mfloat-abi=softfp
 
+# Armv9-A - build nofp and SIMD variants.
+MULTILIB_REQUIRED	+= mthumb/march=armv9-a/mfloat-abi=soft
+MULTILIB_REQUIRED	+= mthumb/march=armv9-a+simd/mfloat-abi=hard
+MULTILIB_REQUIRED	+= mthumb/march=armv9-a+simd/mfloat-abi=softfp
+
 # Matches
 
 # Arch Matches
@@ -129,17 +134,29 @@ MULTILIB_MATCHES	+= march?armv8-a=march?armv8.6-a
 MULTILIB_MATCHES	+= $(foreach ARCH, $(v8_6_a_simd_variants), \
 			     march?armv8-a+simd=march?armv8.6-a$(ARCH))
 
+# Armv9 without SIMD: map down to base architecture
+MULTILIB_MATCHES	+= $(foreach ARCH, $(v9_a_nosimd_variants), \
+			     march?armv9-a=march?armv9-a$(ARCH))
+
+# Armv9 with SIMD: map down to base arch + simd
+MULTILIB_MATCHES	+= march?armv9-a+simd=march?armv9-a+crc+simd \
+			   $(foreach ARCH, $(filter-out +simd, $(v9_a_simd_variants)), \
+			     march?armv9-a+simd=march?armv9-a$(ARCH) \
+			     march?armv9-a+simd=march?armv9-a+crc$(ARCH))
+
 # Use Thumb libraries for everything.
 
 MULTILIB_REUSE		+= mthumb/march.armv7-a/mfloat-abi.soft=marm/march.armv7-a/mfloat-abi.soft
 
 MULTILIB_REUSE		+= mthumb/march.armv8-a/mfloat-abi.soft=marm/march.armv8-a/mfloat-abi.soft
 
+MULTILIB_REUSE		+= mthumb/march.armv9-a/mfloat-abi.soft=marm/march.armv9-a/mfloat-abi.soft
+
 MULTILIB_REUSE		+= $(foreach ABI, hard softfp, \
-			     $(foreach ARCH, armv7-a+fp armv7-a+simd armv7ve+simd armv8-a+simd, \
+			     $(foreach ARCH, armv7-a+fp armv7-a+simd armv7ve+simd armv8-a+simd armv9-a+simd, \
 			       mthumb/march.$(ARCH)/mfloat-abi.$(ABI)=marm/march.$(ARCH)/mfloat-abi.$(ABI)))
 
 # Softfp but no FP, use the soft-float libraries.
 MULTILIB_REUSE		+= $(foreach MODE, arm thumb, \
-			     $(foreach ARCH, armv7-a armv8-a, \
+			     $(foreach ARCH, armv7-a armv8-a armv9-a, \
 			       mthumb/march.$(ARCH)/mfloat-abi.soft=m$(MODE)/march.$(ARCH)/mfloat-abi.softfp))
diff --git a/gcc/config/arm/t-arm-elf b/gcc/config/arm/t-arm-elf
index d68def30867..b3a900e8cb3 100644
--- a/gcc/config/arm/t-arm-elf
+++ b/gcc/config/arm/t-arm-elf
@@ -38,6 +38,8 @@ v7ve_fps	:= vfpv3-d16 vfpv3 vfpv3-d16-fp16 vfpv3-fp16 vfpv4 neon \
 # it seems to work ok.
 v8_fps		:= simd fp16 crypto fp16+crypto dotprod fp16fml
 
+v9_fps		:= simd fp16 crypto fp16+crypto dotprod fp16fml
+
 # We don't do anything special with these.  Pre-v4t probably doesn't work.
 all_early_nofp	:= armv4 armv4t armv5t
 
@@ -49,6 +51,8 @@ all_v7_a_r	:= armv7-a armv7ve armv7-r
 all_v8_archs	:= armv8-a armv8-a+crc armv8.1-a armv8.2-a armv8.3-a armv8.4-a \
 		   armv8.5-a armv8.6-a
 
+all_v9_archs	:= armv9-a
+
 # No floating point variants, require thumb1 softfp
 all_nofp_t	:= armv6-m armv6s-m armv8-m.base
 
@@ -110,6 +114,11 @@ MULTILIB_MATCHES     += $(foreach ARCH, $(all_v8_archs), \
 			  $(foreach FPARCH, $(v8_fps), \
 			    march?armv7+fp=march?$(ARCH)+$(FPARCH)))
 
+MULTILIB_MATCHES     += $(foreach ARCH, $(all_v9_archs), \
+			  march?armv7+fp=march?$(ARCH) \
+			  $(foreach FPARCH, $(v9_fps), \
+			    march?armv7+fp=march?$(ARCH)+$(FPARCH)))
+
 MULTILIB_MATCHES     += $(foreach ARCH, armv7e-m armv8-m.mainline, \
 			  march?armv7+fp=march?$(ARCH)+fp.dp)
 
diff --git a/gcc/config/arm/t-multilib b/gcc/config/arm/t-multilib
index ddc5033bf2f..d789b86ee22 100644
--- a/gcc/config/arm/t-multilib
+++ b/gcc/config/arm/t-multilib
@@ -78,6 +78,8 @@ v8_4_a_simd_variants	:= $(call all_feat_combs, simd fp16 crypto i8mm bf16)
 v8_5_a_simd_variants	:= $(call all_feat_combs, simd fp16 crypto i8mm bf16)
 v8_6_a_simd_variants	:= $(call all_feat_combs, simd fp16 crypto i8mm bf16)
 v8_r_nosimd_variants	:= +crc
+v9_a_nosimd_variants	:= +crc
+v9_a_simd_variants	:= $(call all_feat_combs, simd fp16 crypto i8mm bf16)
 
 ifneq (,$(HAS_APROFILE))
 include $(srcdir)/config/arm/t-aprofile
@@ -202,6 +204,16 @@ MULTILIB_MATCHES	+= march?armv7=march?armv8.6-a
 MULTILIB_MATCHES	+= $(foreach ARCH, $(v8_6_a_simd_variants), \
 			     march?armv7+fp=march?armv8.6-a$(ARCH))
 
+# Armv9
+MULTILIB_MATCHES	+= march?armv7=march?armv9-a
+MULTILIB_MATCHES	+= $(foreach ARCH, $(v9_a_nosimd_variants), \
+			     march?armv7=march?armv9-a$(ARCH))
+
+# Armv9 with SIMD
+MULTILIB_MATCHES	+= march?armv7+fp=march?armv9-a+crc+simd \
+			   $(foreach ARCH, $(v9_a_simd_variants), \
+			     march?armv7+fp=march?armv9-a$(ARCH) \
+			     march?armv7+fp=march?armv9-a+crc$(ARCH))
 endif		# Not APROFILE.
 
 # Use Thumb libraries for everything.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index f206cff1221..95732c3fb25 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -20119,6 +20119,7 @@ Permissible names are:
 @samp{armv7-m}, @samp{armv7e-m},
 @samp{armv8-m.base}, @samp{armv8-m.main},
 @samp{armv8.1-m.main},
+@samp{armv9-a},
 @samp{iwmmxt} and @samp{iwmmxt2}.
 
 Additionally, the following architectures, which lack support for the
diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp b/gcc/testsuite/gcc.target/arm/multilib.exp
index 4b30025db8c..e3f06c31690 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -135,6 +135,14 @@ if {[multilib_config "aprofile"] } {
 	{-march=armv8.6-a+simd+fp16 -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
 	{-march=armv8.6-a+simd+fp16+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp"
 	{-march=armv8.6-a+simd+nofp+fp16 -mfloat-abi=softfp} "thumb/v8-a+simd/softfp"
+	{-march=armv9-a+crypto -mfloat-abi=soft} "thumb/v9-a/nofp"
+	{-march=armv9-a+simd+crypto -mfloat-abi=softfp} "thumb/v9-a+simd/softfp"
+	{-march=armv9-a+simd+crypto+nofp -mfloat-abi=softfp} "thumb/v9-a/nofp"
+	{-march=armv9-a+simd+nofp+crypto -mfloat-abi=softfp} "thumb/v9-a+simd/softfp"
+	{-march=armv9-a+fp16 -mfloat-abi=soft} "thumb/v9-a/nofp"
+	{-march=armv9-a+simd+fp16 -mfloat-abi=softfp} "thumb/v9-a+simd/softfp"
+	{-march=armv9-a+simd+fp16+nofp -mfloat-abi=softfp} "thumb/v9-a/nofp"
+	{-march=armv9-a+simd+nofp+fp16 -mfloat-abi=softfp} "thumb/v9-a+simd/softfp"
 	{-mcpu=cortex-a53+crypto -mfloat-abi=hard} "thumb/v8-a+simd/hard"
 	{-mcpu=cortex-a53+nofp -mfloat-abi=softfp} "thumb/v8-a/nofp"
 	{-march=armv8-a+crc -mfloat-abi=hard -mfpu=vfp} "thumb/v8-a+simd/hard"
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index e07d563f6f4..8cbda192fe0 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4848,7 +4848,8 @@ foreach { armfunc armflag armdefs } {
 	v8m_base "-march=armv8-m.base -mthumb -mfloat-abi=soft"
 		__ARM_ARCH_8M_BASE__
 	v8m_main "-march=armv8-m.main -mthumb" __ARM_ARCH_8M_MAIN__
-	v8_1m_main "-march=armv8.1-m.main -mthumb" __ARM_ARCH_8M_MAIN__ } {
+	v8_1m_main "-march=armv8.1-m.main -mthumb" __ARM_ARCH_8M_MAIN__
+	v9a "-march=armv9-a" __ARM_ARCH_9A__ } {
     eval [string map [list FUNC $armfunc FLAG $armflag DEFS $armdefs ] {
 	proc check_effective_target_arm_arch_FUNC_ok { } {
 	    return [check_no_compiler_messages arm_arch_FUNC_ok assembly {


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

only message in thread, other threads:[~2021-11-09 11:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09 11:35 [gcc r12-5046] arm: add armv9-a architecture to -march Przemyslaw Wirkus

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).