Skip to content

Commit ccfd1e7

Browse files
committed
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 <[email protected]> * 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 <[email protected]> * gcc.target/arm/multilib.exp: Add tests for cortex-m85.
1 parent ad4f8c4 commit ccfd1e7

File tree

5 files changed

+64
-16
lines changed

5 files changed

+64
-16
lines changed

gcc/config/arm/arm-cpus.in

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,21 @@ begin cpu star-mc1
16721672
costs v7m
16731673
end cpu star-mc1
16741674

1675+
begin cpu cortex-m85
1676+
cname cortexm85
1677+
tune flags LDSCHED
1678+
architecture armv8.1-m.main+pacbti+mve.fp+fp.dp
1679+
option nopacbti remove pacbti
1680+
option nomve.fp remove mve_float
1681+
option nomve remove mve mve_float
1682+
option nofp remove ALL_FP mve_float
1683+
option nodsp remove MVE mve_float
1684+
isa quirk_no_asmcpu quirk_vlldm
1685+
costs v7m
1686+
part 0xd23
1687+
vendor 41
1688+
end cpu cortex-m85
1689+
16751690
# V8 R-profile implementations.
16761691
begin cpu cortex-r52
16771692
cname cortexr52

gcc/config/arm/arm-tables.opt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ Enum(processor_type) String(cortex-m55) Value( TARGET_CPU_cortexm55)
288288
EnumValue
289289
Enum(processor_type) String(star-mc1) Value( TARGET_CPU_starmc1)
290290

291+
EnumValue
292+
Enum(processor_type) String(cortex-m85) Value( TARGET_CPU_cortexm85)
293+
291294
EnumValue
292295
Enum(processor_type) String(cortex-r52) Value( TARGET_CPU_cortexr52)
293296

gcc/config/arm/arm-tune.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@
4646
cortexa73cortexa53,cortexa55,cortexa75,
4747
cortexa76,cortexa76ae,cortexa77,
4848
cortexa78,cortexa78ae,cortexa78c,
49-
cortexa710,cortexx1,cortexx1c,neoversen1,
50-
cortexa75cortexa55,cortexa76cortexa55,neoversev1,
51-
neoversen2,cortexm23,cortexm33,
52-
cortexm35p,cortexm55,starmc1,
53-
cortexr52,cortexr52plus"
49+
cortexa710,cortexx1,cortexx1c,
50+
neoversen1,cortexa75cortexa55,cortexa76cortexa55,
51+
neoversev1,neoversen2,cortexm23,
52+
cortexm33,cortexm35p,cortexm55,
53+
starmc1,cortexm85,cortexr52,
54+
cortexr52plus"
5455
(const (symbol_ref "((enum attr_tune) arm_tune)")))

gcc/doc/invoke.texi

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22097,8 +22097,8 @@ Permissible names are: @samp{arm7tdmi}, @samp{arm7tdmi-s}, @samp{arm710t},
2209722097
@samp{cortex-r7}, @samp{cortex-r8}, @samp{cortex-r52}, @samp{cortex-r52plus},
2209822098
@samp{cortex-m0}, @samp{cortex-m0plus}, @samp{cortex-m1}, @samp{cortex-m3},
2209922099
@samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m23}, @samp{cortex-m33},
22100-
@samp{cortex-m35p}, @samp{cortex-m55}, @samp{cortex-x1}, @samp{cortex-x1c},
22101-
@samp{cortex-m1.small-multiply}, @samp{cortex-m0.small-multiply},
22100+
@samp{cortex-m35p}, @samp{cortex-m55}, @samp{cortex-m85}, @samp{cortex-x1},
22101+
@samp{cortex-x1c}, @samp{cortex-m1.small-multiply}, @samp{cortex-m0.small-multiply},
2210222102
@samp{cortex-m0plus.small-multiply}, @samp{exynos-m1}, @samp{marvell-pj4},
2210322103
@samp{neoverse-n1}, @samp{neoverse-n2}, @samp{neoverse-v1}, @samp{xscale},
2210422104
@samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}, @samp{fa526}, @samp{fa626},
@@ -22162,17 +22162,22 @@ The following extension options are common to the listed CPUs:
2216222162

2216322163
@table @samp
2216422164
@item +nodsp
22165-
Disable the DSP instructions on @samp{cortex-m33}, @samp{cortex-m35p}
22166-
and @samp{cortex-m55}. Also disable the M-Profile Vector Extension (MVE)
22167-
integer and single precision floating-point instructions on @samp{cortex-m55}.
22165+
Disable the DSP instructions on @samp{cortex-m33}, @samp{cortex-m35p},
22166+
@samp{cortex-m55} and @samp{cortex-m85}. Also disable the M-Profile Vector
22167+
Extension (MVE) integer and single precision floating-point instructions on
22168+
@samp{cortex-m55} and @samp{cortex-m85}.
22169+
22170+
@item +nopacbti
22171+
Disable the Pointer Authentication and Branch Target Identification Extension
22172+
on @samp{cortex-m85}.
2216822173

2216922174
@item +nomve
2217022175
Disable the M-Profile Vector Extension (MVE) integer and single precision
22171-
floating-point instructions on @samp{cortex-m55}.
22176+
floating-point instructions on @samp{cortex-m55} and @samp{cortex-m85}.
2217222177

2217322178
@item +nomve.fp
2217422179
Disable the M-Profile Vector Extension (MVE) single precision floating-point
22175-
instructions on @samp{cortex-m55}.
22180+
instructions on @samp{cortex-m55} and @samp{cortex-m85}.
2217622181

2217722182
@item +cdecp0, +cdecp1, ... , +cdecp7
2217822183
Enable the Custom Datapath Extension (CDE) on selected coprocessors according
@@ -22184,7 +22189,8 @@ Disables the floating-point instructions on @samp{arm9e},
2218422189
@samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
2218522190
@samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
2218622191
@samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m33}, @samp{cortex-m35p}
22187-
and @samp{cortex-m55}.
22192+
@samp{cortex-m4}, @samp{cortex-m7}, @samp{cortex-m33}, @samp{cortex-m35p},
22193+
@samp{cortex-m55} and @samp{cortex-m85}.
2218822194
Disables the floating-point and SIMD instructions on
2218922195
@samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
2219022196
@samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
@@ -22524,9 +22530,9 @@ Development Tools Engineering Specification", which can be found on
2252422530
Mitigate against a potential security issue with the @code{VLLDM} instruction
2252522531
in some M-profile devices when using CMSE (CVE-2021-365465). This option is
2252622532
enabled by default when the option @option{-mcpu=} is used with
22527-
@code{cortex-m33}, @code{cortex-m35p}, @code{cortex-m55} or @code{star-mc1}.
22528-
The option @option{-mno-fix-cmse-cve-2021-35465} can be used to disable
22529-
the mitigation.
22533+
@code{cortex-m33}, @code{cortex-m35p}, @code{cortex-m55}, @code{cortex-m85}
22534+
or @code{star-mc1}. The option @option{-mno-fix-cmse-cve-2021-35465} can be used
22535+
to disable the mitigation.
2253022536

2253122537
@item -mstack-protector-guard=@var{guard}
2253222538
@itemx -mstack-protector-guard-offset=@var{offset}

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,11 @@ if {[multilib_config "rmprofile"] } {
524524
{-mcpu=cortex-m23 -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v8-m.base/nofp"
525525
{-mcpu=cortex-m33 -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v8-m.main/nofp"
526526
{-mcpu=cortex-m7+nofp.dp -mfpu=fpv5-d16 -mfloat-abi=soft} "thumb/v7e-m/nofp"
527+
{-mcpu=cortex-m85+nopacbti -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
528+
{-mcpu=cortex-m85+nopacbti+nofp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
529+
{-mcpu=cortex-m85+nopacbti+nomve -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
530+
{-mcpu=cortex-m85+nopacbti+nodsp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
531+
{-mcpu=cortex-m85+nopacbti+nomve.fp -mfpu=auto -mfloat-abi=soft} "thumb/v8-m.main/nofp"
527532
{-mcpu=cortex-m4 -mfpu=auto -mfloat-abi=hard} "thumb/v7e-m+fp/hard"
528533
{-mcpu=cortex-m7 -mfpu=auto -mfloat-abi=hard} "thumb/v7e-m+dp/hard"
529534
{-mcpu=cortex-m33 -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+fp/hard"
@@ -549,6 +554,15 @@ if {[multilib_config "rmprofile"] } {
549554
{-mcpu=cortex-m7 -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v7e-m+dp/hard"
550555
{-mcpu=cortex-m33 -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
551556
{-mcpu=cortex-m7+nofp.dp -mfpu=fpv5-d16 -mfloat-abi=hard} "thumb/v7e-m+dp/hard"
557+
{-mcpu=cortex-m85+nopacbti -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
558+
{-mcpu=cortex-m85+nopacbti+nomve -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
559+
{-mcpu=cortex-m85+nopacbti+nodsp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
560+
{-mcpu=cortex-m85+nopacbti+nofp -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+mve/hard"
561+
{-mcpu=cortex-m85+nopacbti+nomve.fp -mfpu=auto -mfloat-abi=hard} "thumb/v8-m.main+dp/hard"
562+
{-mcpu=cortex-m85 -mbranch-protection=standard -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/hard"
563+
{-mcpu=cortex-m85+nomve.fp -mbranch-protection=standard -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/hard"
564+
{-mcpu=cortex-m85+nomve -mbranch-protection=standard -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/hard"
565+
{-mcpu=cortex-m85+nodsp -mbranch-protection=standard -mfpu=auto -mfloat-abi=hard} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/hard"
552566
{-mcpu=cortex-m0 -mfpu=auto -mfloat-abi=softfp} "thumb/v6-m/nofp"
553567
{-mcpu=cortex-m1 -mfpu=auto -mfloat-abi=softfp} "thumb/v6-m/nofp"
554568
{-mcpu=cortex-m3 -mfpu=auto -mfloat-abi=softfp} "thumb/v7-m/nofp"
@@ -598,6 +612,15 @@ if {[multilib_config "rmprofile"] } {
598612
{-mcpu=cortex-m23 -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.base/nofp"
599613
{-mcpu=cortex-m33 -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
600614
{-mcpu=cortex-m7+nofp.dp -mfpu=fpv5-d16 -mfloat-abi=softfp} "thumb/v7e-m+dp/softfp"
615+
{-mcpu=cortex-m85+nopacbti+nofp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main/nofp"
616+
{-mcpu=cortex-m85+nopacbti -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
617+
{-mcpu=cortex-m85+nopacbti+nomve -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
618+
{-mcpu=cortex-m85+nopacbti+nodsp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
619+
{-mcpu=cortex-m85+nopacbti+nomve.fp -mfpu=auto -mfloat-abi=softfp} "thumb/v8-m.main+dp/softfp"
620+
{-mcpu=cortex-m85 -mbranch-protection=standard -mfpu=auto -mfloat-abi=softfp} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/softfp"
621+
{-mcpu=cortex-m85+nomve.fp -mbranch-protection=standard -mfpu=auto -mfloat-abi=softfp} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/softfp"
622+
{-mcpu=cortex-m85+nomve -mbranch-protection=standard -mfpu=auto -mfloat-abi=softfp} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/softfp"
623+
{-mcpu=cortex-m85+nodsp -mbranch-protection=standard -mfpu=auto -mfloat-abi=softfp} "thumb/v8.1-m.main+pacbti+dp/mbranch-protection/softfp"
601624
{-march=armv6-m -mfpu=auto -mfloat-abi=soft} "thumb/v6-m/nofp"
602625
{-march=armv7-m -mfpu=auto -mfloat-abi=soft} "thumb/v7-m/nofp"
603626
{-march=armv7e-m -mfpu=auto -mfloat-abi=soft} "thumb/v7e-m/nofp"

0 commit comments

Comments
 (0)