Skip to content

Commit 17bd2bd

Browse files
thaoluonguwstephanosio
authored andcommitted
arm: Add support for Arm Cortex-M85 CPU.
This patch adds the -mcpu support for the Arm Cortex-M85 CPU which is an Armv8.1-M Mainline CPU supporting MVE and PACBTI by default. -mpcu=cortex-m85 switch by default matches to -march=armv8.1-m.main+pacbti+mve.fp+fp.dp. Also following options are provided to disable default features. +nomve.fp (disables MVE Floating point) +nomve (disables MVE Integer and MVE Floating point) +nodsp (disables dsp, MVE Integer and MVE Floating point) +nopacbti (disables pacbti) +nofp (disables floating point and MVE floating point) gcc/ChangeLog: 2022-08-12 Srinath Parvathaneni <srinath.parvathaneni@arm.com> * config/arm/arm-cpus.in (cortex-m85): Define new CPU. * config/arm/arm-tables.opt: Regenerate. * config/arm/arm-tune.md: Likewise. * doc/invoke.texi (Arm Options): Document -mcpu=cortex-m85. * (-mfix-cmse-cve-2021-35465): Likewise. gcc/testsuite/ChangeLog: 2022-08-12 Srinath Parvathaneni <srinath.parvathaneni@arm.com> * gcc.target/arm/multilib.exp: Add tests for cortex-m85. (cherry picked from commit gcc-mirror@ccfd1e7) Signed-off-by: Thao Luong <thao.luong.uw@renesas.com>
1 parent 47b9276 commit 17bd2bd

File tree

5 files changed

+57
-5
lines changed

5 files changed

+57
-5
lines changed

gcc/config/arm/arm-cpus.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,21 @@ begin cpu cortex-m55
16381638
vendor 41
16391639
end cpu cortex-m55
16401640

1641+
begin cpu cortex-m85
1642+
cname cortexm85
1643+
tune flags LDSCHED
1644+
architecture armv8.1-m.main+pacbti+mve.fp+fp.dp
1645+
option nopacbti remove pacbti
1646+
option nomve.fp remove mve_float
1647+
option nomve remove mve mve_float
1648+
option nofp remove ALL_FP mve_float
1649+
option nodsp remove MVE mve_float
1650+
isa quirk_no_asmcpu quirk_vlldm
1651+
costs v7m
1652+
part 0xd23
1653+
vendor 41
1654+
end cpu cortex-m85
1655+
16411656
# V8 R-profile implementations.
16421657
begin cpu cortex-r52
16431658
cname cortexr52

gcc/config/arm/arm-tables.opt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ Enum(processor_type) String(cortex-m55) Value( TARGET_CPU_cortexm55)
285285
EnumValue
286286
Enum(processor_type) String(cortex-r52) Value( TARGET_CPU_cortexr52)
287287

288+
EnumValue
289+
Enum(processor_type) String(cortex-m85) Value( TARGET_CPU_cortexm85)
290+
288291
EnumValue
289292
Enum(processor_type) String(cortex-r52plus) Value( TARGET_CPU_cortexr52plus)
290293

gcc/config/arm/arm-tune.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
cortexa710,cortexx1,neoversen1,
5050
cortexa75cortexa55,cortexa76cortexa55,neoversev1,
5151
neoversen2,cortexm23,cortexm33,
52-
cortexm35p,cortexm55,cortexr52,
52+
cortexm35p,cortexm55,cortexm85,cortexr52,
5353
cortexr52plus"
5454
(const (symbol_ref "((enum attr_tune) arm_tune)")))

gcc/doc/invoke.texi

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21180,7 +21180,7 @@ Permissible names are: @samp{arm7tdmi}, @samp{arm7tdmi-s}, @samp{arm710t},
2118021180
@samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52}, @samp{cortex-r52plus},
2118121181
@samp{cortex-m0}, @samp{cortex-m0plus}, @samp{cortex-m1}, @samp{cortex-m3},
2118221182
@samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m23}, @samp{cortex-m33},
21183-
@samp{cortex-m35p}, @samp{cortex-m55}, @samp{cortex-x1},
21183+
@samp{cortex-m35p}, @samp{cortex-m55}, @samp{cortex-m85}, @samp{cortex-x1},
2118421184
@samp{cortex-m1.small-multiply}, @samp{cortex-m0.small-multiply},
2118521185
@samp{cortex-m0plus.small-multiply}, @samp{exynos-m1}, @samp{marvell-pj4},
2118621186
@samp{neoverse-n1}, @samp{neoverse-n2}, @samp{neoverse-v1}, @samp{xscale},
@@ -21244,14 +21244,25 @@ The following extension options are common to the listed CPUs:
2124421244

2124521245
@table @samp
2124621246
@item +nodsp
21247-
Disable the DSP instructions on @samp{cortex-m33}, @samp{cortex-m35p}.
21247+
Disable the DSP instructions on @samp{cortex-m33}, @samp{cortex-m35p} and @samp{cortex-m85}. Also disable the M-Profile Vector Extension (MVE) integer and single precision floating-point instructions on @samp{cortex-m85}.
21248+
21249+
@item +nopacbti
21250+
Disable the Pointer Authentication and Branch Target Identification Extension
21251+
on @samp{cortex-m85}.
21252+
@item +nomve
21253+
Disable the M-Profile Vector Extension (MVE) integer and single precision
21254+
floating-point instructions on @samp{cortex-m85}.
21255+
21256+
@item +nomve.fp
21257+
Disable the M-Profile Vector Extension (MVE) single precision floating-point
21258+
instructions on @samp{cortex-m85}.
2124821259

2124921260
@item +nofp
2125021261
Disables the floating-point instructions on @samp{arm9e},
2125121262
@samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm10e},
2125221263
@samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
2125321264
@samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
21254-
@samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m33} and @samp{cortex-m35p}.
21265+
@samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m33} and @samp{cortex-m35p} and @samp{cortex-m85}.
2125521266
Disables the floating-point and SIMD instructions on
2125621267
@samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
2125721268
@samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
@@ -21591,7 +21602,7 @@ Development Tools Engineering Specification", which can be found on
2159121602
Mitigate against a potential security issue with the @code{VLLDM} instruction
2159221603
in some M-profile devices when using CMSE (CVE-2021-365465). This option is
2159321604
enabled by default when the option @option{-mcpu=} is used with
21594-
@code{cortex-m33}, @code{cortex-m35p} or @code{cortex-m55}. The option
21605+
@code{cortex-m33}, @code{cortex-m35p} or @code{cortex-m55}, @code{cortex-m85}. The option
2159521606
@option{-mno-fix-cmse-cve-2021-35465} can be used to disable the mitigation.
2159621607

2159721608
@item -mstack-protector-guard=@var{guard}

gcc/testsuite/gcc.target/arm/multilib.exp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,11 @@ if {[multilib_config "rmprofile"] } {
521521
{-mcpu=cortex-m23 -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v8-m.base/nofp"
522522
{-mcpu=cortex-m33 -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp"
523523
{-mcpu=cortex-m7+nofp.dp -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v7e-m/nofp"
524+
{-mcpu=cortex-m85+nopacbti -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
525+
{-mcpu=cortex-m85+nopacbti+nofp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
526+
{-mcpu=cortex-m85+nopacbti+nomve -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
527+
{-mcpu=cortex-m85+nopacbti+nodsp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
528+
{-mcpu=cortex-m85+nopacbti+nomve.fp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
524529
{-mcpu=cortex-m4 -mfpu=auto -mfloat-abi=hard} "thumb/v7e-m+fp/hard"
525530
{-mcpu=cortex-m7 -mfpu=auto -mfloat-abi=hard} "thumb/v7e-m+dp/hard"
526531
{-mcpu=cortex-m33 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard"
@@ -546,6 +551,15 @@ if {[multilib_config "rmprofile"] } {
546551
{-mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v7e-m+dp/hard"
547552
{-mcpu=cortex-m33 -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
548553
{-mcpu=cortex-m7+nofp.dp -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v7e-m+dp/hard"
554+
{-mcpu=cortex-m85+nopacbti -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
555+
{-mcpu=cortex-m85+nopacbti+nomve -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
556+
{-mcpu=cortex-m85+nopacbti+nodsp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
557+
{-mcpu=cortex-m85+nopacbti+nofp -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+mve/hard"
558+
{-mcpu=cortex-m85+nopacbti+nomve.fp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
559+
{-mcpu=cortex-m85 -mbranch-protection=standard -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/hard"
560+
{-mcpu=cortex-m85+nomve.fp -mbranch-protection=standard -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/hard"
561+
{-mcpu=cortex-m85+nomve -mbranch-protection=standard -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/hard"
562+
{-mcpu=cortex-m85+nodsp -mbranch-protection=standard -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/hard"
549563
{-mcpu=cortex-m0 -mfpu=auto -mfloat-abi=softfp} "thumb/v6-m/nofp"
550564
{-mcpu=cortex-m1 -mfpu=auto -mfloat-abi=softfp} "thumb/v6-m/nofp"
551565
{-mcpu=cortex-m3 -mfpu=auto -mfloat-abi=softfp} "thumb/v7-m/nofp"
@@ -595,6 +609,15 @@ if {[multilib_config "rmprofile"] } {
595609
{-mcpu=cortex-m23 -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.base/nofp"
596610
{-mcpu=cortex-m33 -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
597611
{-mcpu=cortex-m7+nofp.dp -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v7e-m+dp/softfp"
612+
{-mcpu=cortex-m85+nopacbti+nofp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp"
613+
{-mcpu=cortex-m85+nopacbti -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
614+
{-mcpu=cortex-m85+nopacbti+nomve -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
615+
{-mcpu=cortex-m85+nopacbti+nodsp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
616+
{-mcpu=cortex-m85+nopacbti+nomve.fp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
617+
{-mcpu=cortex-m85 -mbranch-protection=standard -mfpu=auto -mfloat-abi=softfp} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/softfp"
618+
{-mcpu=cortex-m85+nomve.fp -mbranch-protection=standard -mfpu=auto -mfloat-abi=softfp} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/softfp"
619+
{-mcpu=cortex-m85+nomve -mbranch-protection=standard -mfpu=auto -mfloat-abi=softfp} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/softfp"
620+
{-mcpu=cortex-m85+nodsp -mbranch-protection=standard -mfpu=auto -mfloat-abi=softfp} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/softfp"
598621
{-march=armv6-m -mfpu=auto -mfloat-abi=soft} "thumb/v6-m/nofp"
599622
{-march=armv7-m -mfpu=auto -mfloat-abi=soft} "thumb/v7-m/nofp"
600623
{-march=armv7e-m -mfpu=auto -mfloat-abi=soft} "thumb/v7e-m/nofp"

0 commit comments

Comments
 (0)