PATCH [6/10] arm: Add -march=armv8.1-m.main+pacbti flag
authorAndrea Corallo <andrea.corallo@arm.com>
Fri, 4 Jun 2021 08:17:17 +0000 (10:17 +0200)
committerAndrea Corallo <andrea.corallo@arm.com>
Mon, 26 Jul 2021 12:18:24 +0000 (14:18 +0200)
gas/
2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

* config/tc-arm.c (pacbti_ext): Define.
(BAD_PACBTI): New macro.
(armv8_1m_main_ext_table): Add 'pacbti' extension.

include/
2021-06-11  Andrea Corallo  <andrea.corallo@arm.com>

* opcode/arm.h (ARM_EXT3_PACBTI, ARM_AEXT3_V8_1M_MAIN_PACBTI): New
macro.

gas/config/tc-arm.c
include/opcode/arm.h

index 6ef0cd97a5e76f64105a829dbf692c085ba98ac9..3ec353abf789201e9575dd898568c0d9c350d349 100644 (file)
@@ -365,6 +365,8 @@ static const arm_feature_set fpu_neon_ext_v8_1 =
   ARM_FEATURE_COPROC (FPU_NEON_EXT_RDMA);
 static const arm_feature_set fpu_neon_ext_dotprod =
   ARM_FEATURE_COPROC (FPU_NEON_EXT_DOTPROD);
+static const arm_feature_set pacbti_ext =
+  ARM_FEATURE_CORE_HIGH_HIGH (ARM_EXT3_PACBTI);
 
 static int mfloat_abi_opt = -1;
 /* Architecture feature bits selected by the last -mcpu/-march or .cpu/.arch
@@ -945,6 +947,7 @@ struct asm_opcode
                          "and source operands makes instruction UNPREDICTABLE")
 #define BAD_EL_TYPE    _("bad element type for instruction")
 #define MVE_BAD_QREG   _("MVE vector register Q[0..7] expected")
+#define BAD_PACBTI     _("selected processor does not support PACBTI extention")
 
 static htab_t  arm_ops_hsh;
 static htab_t  arm_cond_hsh;
@@ -31934,6 +31937,7 @@ static const struct arm_ext_table armv8_1m_main_ext_table[] =
                        ARM_EXT2_FP16_INST | ARM_EXT2_MVE | ARM_EXT2_MVE_FP,
                        FPU_VFP_V5_SP_D16 | FPU_VFP_EXT_FP16 | FPU_VFP_EXT_FMA)),
   CDE_EXTENSIONS,
+  ARM_ADD ("pacbti", ARM_FEATURE_CORE_HIGH_HIGH (ARM_AEXT3_V8_1M_MAIN_PACBTI)),
   { NULL, 0, ARM_ARCH_NONE, ARM_ARCH_NONE }
 };
 
index 1152e78122251c86be5d04f27f9168e8590e4736..4a6044f6f68ddb317d870f8a4ffb700641ee1d24 100644 (file)
 #define ARM_EXT2_CDE7       0x40000000 /* Using CDE coproc 7.     */
 #define ARM_EXT2_V8R        0x80000000 /* Arm V8R.                    */
 
+#define ARM_EXT3_PACBTI             0x00000001 /* Arm v8-M Mainline Pointer
+                                          Authentication and Branch
+                                          Target Identification
+                                          Extension.  */
+
 /* Co-processor space extensions.  */
 #define ARM_CEXT_XSCALE             0x00000001 /* Allow MIA etc.                  */
 #define ARM_CEXT_MAVERICK    0x00000002        /* Use Cirrus/DSP coprocessor.     */
 #define ARM_AEXT2_V8_1M_MAIN   (ARM_AEXT2_V8M_MAIN | ARM_EXT2_V8_1M_MAIN     \
                                                    | ARM_EXT2_FP16_INST)
 
+#define ARM_AEXT3_V8_1M_MAIN_PACBTI    (ARM_AEXT2_V8M_MAIN | ARM_EXT3_PACBTI)
+
 /* Processors with specific extensions in the co-processor space.  */
 #define ARM_ARCH_XSCALE        ARM_FEATURE_LOW (ARM_AEXT_V5TE, ARM_CEXT_XSCALE)
 #define ARM_ARCH_IWMMXT        \