[gcc/devel/ranger] Add CLI and multilib support for Armv8.1-M Mainline MVE extensions
Aldy Hernandez
aldyh@gcc.gnu.org
Wed Jun 17 18:00:46 GMT 2020
https://gcc.gnu.org/g:7b4c373beb31795ac1644e60ee34f6c0d744403d
commit 7b4c373beb31795ac1644e60ee34f6c0d744403d
Author: Mihail Ionescu <mihail.ionescu@arm.com>
Date: Wed Jan 15 13:25:30 2020 +0000
Add CLI and multilib support for Armv8.1-M Mainline MVE extensions
gcc/ChangeLog:
2020-01-16 Mihail Ionescu <mihail.ionescu@arm.com>
2020-01-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
* config/arm/arm-cpus.in (mve, mve_float): New features.
(dsp, mve, mve.fp): New options.
* config/arm/arm.h (TARGET_HAVE_MVE, TARGET_HAVE_MVE_FLOAT): Define.
* config/arm/t-rmprofile: Map v8.1-M multilibs to v8-M.
* doc/invoke.texi: Document the armv8.1-m mve and dps options.
gcc/testsuite/ChangeLog:
2020-01-16 Mihail Ionescu <mihail.ionescu@arm.com>
2020-01-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
* testsuite/gcc.target/arm/multilib.exp: Add v8.1-M entries.
Diff:
---
gcc/ChangeLog | 9 +++++++++
gcc/config/arm/arm-cpus.in | 7 +++++++
gcc/config/arm/arm.h | 6 ++++++
gcc/config/arm/t-rmprofile | 17 ++++++++++++++++-
gcc/doc/invoke.texi | 11 +++++++++++
gcc/testsuite/ChangeLog | 5 +++++
gcc/testsuite/gcc.target/arm/multilib.exp | 21 +++++++++++++++++++++
7 files changed, 75 insertions(+), 1 deletion(-)
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e056a6d6210..a60fdbd44a4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@
+2020-01-16 Mihail Ionescu <mihail.ionescu@arm.com>
+2020-01-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ * config/arm/arm-cpus.in (mve, mve_float): New features.
+ (dsp, mve, mve.fp): New options.
+ * config/arm/arm.h (TARGET_HAVE_MVE, TARGET_HAVE_MVE_FLOAT): Define.
+ * config/arm/t-rmprofile: Map v8.1-M multilibs to v8-M.
+ * doc/invoke.texi: Document the armv8.1-m mve and dps options.
+
2020-01-16 Mihail-Calin Ionescu <mihail.ionescu@arm.com>
2020-01-16 Thomas Preud'homme <thomas.preudhomme@arm.com>
diff --git a/gcc/config/arm/arm-cpus.in b/gcc/config/arm/arm-cpus.in
index f5cc5ca2c31..1805b2b1cd8 100644
--- a/gcc/config/arm/arm-cpus.in
+++ b/gcc/config/arm/arm-cpus.in
@@ -197,6 +197,10 @@ define feature sb
# v8-A architectures, added by default from v8.5-A
define feature predres
+# M-profile Vector Extension feature bits
+define feature mve
+define feature mve_float
+
# 8-bit Integer Matrix Multiply extension. Optional from v8.2-A.
define feature i8mm
@@ -690,9 +694,12 @@ begin arch armv8.1-m.main
base 8M_MAIN
isa ARMv8_1m_main
# fp => FPv5-sp-d16; fp.dp => FPv5-d16
+ option dsp add armv7em
option fp add FPv5 fp16
option fp.dp add FPv5 FP_DBL fp16
option nofp remove ALL_FP
+ option mve add mve armv7em
+ option mve.fp add mve FPv5 fp16 mve_float armv7em
end arch armv8.1-m.main
begin arch iwmmxt
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 182854f2df7..04f8dbf1c37 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -319,6 +319,12 @@ emission of floating point pcs attributes. */
instructions (most are floating-point related). */
#define TARGET_HAVE_FPCXT_CMSE (arm_arch8_1m_main)
+#define TARGET_HAVE_MVE (bitmap_bit_p (arm_active_target.isa, \
+ isa_bit_mve))
+
+#define TARGET_HAVE_MVE_FLOAT (bitmap_bit_p (arm_active_target.isa, \
+ isa_bit_mve_float))
+
/* Nonzero if integer division instructions supported. */
#define TARGET_IDIV ((TARGET_ARM && arm_arch_arm_hwdiv) \
|| (TARGET_THUMB && arm_arch_thumb_hwdiv))
diff --git a/gcc/config/arm/t-rmprofile b/gcc/config/arm/t-rmprofile
index 317ca7d0cd1..0fb3084c8b2 100644
--- a/gcc/config/arm/t-rmprofile
+++ b/gcc/config/arm/t-rmprofile
@@ -54,7 +54,7 @@ MULTILIB_REQUIRED += mthumb/march=armv8-m.main+fp.dp/mfloat-abi=softfp
# Arch Matches
MULTILIB_MATCHES += march?armv6s-m=march?armv6-m
-# Map all v8-m.main+dsp FP variants down the the variant without DSP.
+# Map all v8-m.main+dsp FP variants down to the variant without DSP.
MULTILIB_MATCHES += march?armv8-m.main=march?armv8-m.main+dsp \
$(foreach FP, +fp +fp.dp, \
march?armv8-m.main$(FP)=march?armv8-m.main+dsp$(FP))
@@ -66,3 +66,18 @@ MULTILIB_MATCHES += march?armv7e-m+fp=march?armv7e-m+fpv5
MULTILIB_REUSE += $(foreach ARCH, armv6s-m armv7-m armv7e-m armv8-m\.base armv8-m\.main, \
mthumb/march.$(ARCH)/mfloat-abi.soft=mthumb/march.$(ARCH)/mfloat-abi.softfp)
+# Map v8.1-M to v8-M.
+MULTILIB_MATCHES += march?armv8-m.main=march?armv8.1-m.main
+MULTILIB_MATCHES += march?armv8-m.main=march?armv8.1-m.main+dsp
+MULTILIB_MATCHES += march?armv8-m.main=march?armv8.1-m.main+mve
+
+v8_1m_sp_variants = +fp +dsp+fp +mve.fp
+v8_1m_dp_variants = +fp.dp +dsp+fp.dp +fp.dp+mve +fp.dp+mve.fp
+
+# Map all v8.1-m.main FP sp variants down to v8-m.
+MULTILIB_MATCHES += $(foreach FP, $(v8_1m_sp_variants), \
+ march?armv8-m.main+fp=march?armv8.1-m.main$(FP))
+
+# Map all v8.1-m.main FP dp variants down to v8-m.
+MULTILIB_MATCHES += $(foreach FP, $(v8_1m_dp_variants), \
+ march?armv8-m.main+fp.dp=march?armv8.1-m.main$(FP))
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index b0c153afb86..2bf12a669aa 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -18488,6 +18488,17 @@ Disable the floating-point extensions.
@item armv8.1-m.main
@table @samp
+
+@item +dsp
+The DSP instructions.
+
+@item +mve
+The M-Profile Vector Extension (MVE) integer instructions.
+
+@item +mve.fp
+The M-Profile Vector Extension (MVE) integer and single precision
+floating-point instructions.
+
@item +fp
The single-precision floating-point instructions.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1cfe47d2bb7..880d7634458 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-16 Mihail Ionescu <mihail.ionescu@arm.com>
+2020-01-16 Andre Vieira <andre.simoesdiasvieira@arm.com>
+
+ * testsuite/gcc.target/arm/multilib.exp: Add v8.1-M entries.
+
2020-01-16 Mihail-Calin Ionescu <mihail.ionescu@arm.com>
2020-01-16 Thomas Preud'homme <thomas.preudhomme@arm.com>
diff --git a/gcc/testsuite/gcc.target/arm/multilib.exp b/gcc/testsuite/gcc.target/arm/multilib.exp
index e83d1da261b..67d00266f6b 100644
--- a/gcc/testsuite/gcc.target/arm/multilib.exp
+++ b/gcc/testsuite/gcc.target/arm/multilib.exp
@@ -799,6 +799,27 @@ if {[multilib_config "rmprofile"] } {
{-march=armv8-r+fp.sp -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
{-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=softfp} "thumb/v7-r+fp.sp/softfp"
{-march=armv8-r+crc+fp.sp -mfpu=auto -mfloat-abi=hard} "thumb/v7-r+fp.sp/hard"
+ {-march=armv8.1-m.main -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+dsp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+dsp+fp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+dsp+fp.dp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+dsp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+dsp+fp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp"
+ {-march=armv8.1-m.main+dsp+fp.dp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
+ {-march=armv8.1-m.main+dsp+fp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard"
+ {-march=armv8.1-m.main+dsp+fp.dp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
+ {-march=armv8.1-m.main+mve -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+mve.fp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+mve -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+mve.fp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+fp/softfp"
+ {-march=armv8.1-m.main+mve.fp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard"
+ {-march=armv8.1-m.main+mve+fp.dp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+mve.fp+fp.dp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
+ {-march=armv8.1-m.main+mve+fp.dp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
+ {-march=armv8.1-m.main+mve.fp+fp.dp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
+ {-march=armv8.1-m.main+mve+fp.dp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
+ {-march=armv8.1-m.main+mve.fp+fp.dp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
} {
check_multi_dir $opts $dir
}
More information about the Gcc-cvs
mailing list