]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[PATCH 2/15] arm: Add Armv8.1-M Mainline target feature +pacbti
authorAndrea Corallo <andrea.corallo@arm.com>
Mon, 6 Dec 2021 10:38:32 +0000 (11:38 +0100)
committerAndrea Corallo <andrea.corallo@arm.com>
Mon, 23 Jan 2023 10:20:09 +0000 (11:20 +0100)
This patch adds the -march feature +pacbti to Armv8.1-M Mainline.
This feature enables pointer signing and authentication instructions
on M-class architectures.

Pre-approved here
<https://gcc.gnu.org/pipermail/gcc-patches/2021-December/586144.html>.

gcc/Changelog:

* config/arm/arm.h (TARGET_HAVE_PACBTI): New macro.
* config/arm/arm-cpus.in (pacbti): New feature.
* doc/invoke.texi (Arm Options): Document it.

Co-Authored-By: Tejas Belagod <tbelagod@arm.com>
gcc/config/arm/arm-cpus.in
gcc/config/arm/arm.h
gcc/doc/invoke.texi

index 579cf35636632869947f37753bbf0ba79277808c..4685599a42603a144a0202573760d17690094193 100644 (file)
@@ -229,6 +229,10 @@ define feature cdecp5
 define feature cdecp6
 define feature cdecp7
 
+# M-profile control flow integrity extensions (PAC/AUT/BTI).
+# Optional from Armv8.1-M Mainline.
+define feature pacbti
+
 # Feature groups.  Conventionally all (or mostly) upper case.
 # ALL_FPU lists all the feature bits associated with the floating-point
 # unit; these will all be removed if the floating-point unit is disabled
@@ -743,6 +747,7 @@ begin arch armv8.1-m.main
  isa ARMv8_1m_main
 # fp => FPv5-sp-d16; fp.dp => FPv5-d16
  option dsp add armv7em
+ option pacbti add pacbti
  option fp add FPv5 fp16
  option fp.dp add FPv5 FP_DBL fp16
  option nofp remove ALL_FP
index 6f7ecf9128047647fc41677e634cd9612a13242b..79b9f44e5c9ebd2304ab80feb31af40a3a228c7f 100644 (file)
@@ -331,6 +331,12 @@ emission of floating point pcs attributes.  */
                                                isa_bit_mve_float) \
                               && !TARGET_GENERAL_REGS_ONLY)
 
+/* Non-zero if this target supports Armv8.1-M Mainline pointer-signing
+   extension.  */
+#define TARGET_HAVE_PACBTI (arm_arch8_1m_main \
+                           && bitmap_bit_p (arm_active_target.isa, \
+                                            isa_bit_pacbti))
+
 /* MVE have few common instructions as VFP, like VLDM alias VPOP, VLDR, VSTM
    alia VPUSH, VSTR and VMOV, VMSR and VMRS.  In the same manner it updates few
    registers such as FPCAR, FPCCR, FPDSCR, FPSCR, MVFR0, MVFR1 and MVFR2.  All
index 631c00582bf85a438060dbad74aeca9aabddab5e..e37e92fe241d25b011117f2ab595615b4c5e1013 100644 (file)
@@ -22020,6 +22020,9 @@ Disable the floating-point extension.
 @item +cdecp0, +cdecp1, ... , +cdecp7
 Enable the Custom Datapath Extension (CDE) on selected coprocessors according
 to the numbers given in the options in the range 0 to 7.
+
+@item +pacbti
+Enable the Pointer Authentication and Branch Target Identification Extension.
 @end table
 
 @item  armv8-m.main