arm: Add support for Armv8.9-A and Armv9.4-A

This patch adds AArch32 support for -march=armv8.9-a and
-march=armv9.4-a. The behaviour of the new options can be
expressed using a combination of existing feature flags
and tables.

The cpu_arch_ver entries for ARM_ARCH_V9_4A and ARM_ARCH_V8_9A
are technically redundant but it including them for macro code
consistency across architectures.
This commit is contained in:
srinath 2024-01-08 14:13:28 +00:00
parent bde5096397
commit b3b647dc7f
10 changed files with 66 additions and 0 deletions

View File

@ -1,5 +1,7 @@
-*- text -*-
* Add support for 'armv8.9-a' and 'armv9.4-a' for -march in Arm GAS.
* Initial support for Intel APX: 32 GPRs, NDD, PUSH2/POP2 and PUSHP/POPP.
* On RISC-V macro instructions expanding to AUIPC and a load, store, or branch

View File

@ -32022,6 +32022,7 @@ static const struct arm_ext_table armv86a_ext_table[] =
#define armv87a_ext_table armv86a_ext_table
#define armv88a_ext_table armv87a_ext_table
#define armv89a_ext_table armv88a_ext_table
static const struct arm_ext_table armv9a_ext_table[] =
{
@ -32041,6 +32042,7 @@ static const struct arm_ext_table armv9a_ext_table[] =
#define armv91a_ext_table armv86a_ext_table
#define armv92a_ext_table armv91a_ext_table
#define armv93a_ext_table armv92a_ext_table
#define armv94a_ext_table armv93a_ext_table
#define CDE_EXTENSIONS \
ARM_ADD ("cdecp0", ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE | ARM_EXT2_CDE0)), \
@ -32166,10 +32168,12 @@ static const struct arm_arch_option_table arm_archs[] =
ARM_ARCH_OPT2 ("armv8.6-a", ARM_ARCH_V8_6A, FPU_ARCH_VFP, armv86a),
ARM_ARCH_OPT2 ("armv8.7-a", ARM_ARCH_V8_7A, FPU_ARCH_VFP, armv87a),
ARM_ARCH_OPT2 ("armv8.8-a", ARM_ARCH_V8_8A, FPU_ARCH_VFP, armv88a),
ARM_ARCH_OPT2 ("armv8.9-a", ARM_ARCH_V8_9A, FPU_ARCH_VFP, armv89a),
ARM_ARCH_OPT2 ("armv9-a", ARM_ARCH_V9A, FPU_ARCH_VFP, armv9a),
ARM_ARCH_OPT2 ("armv9.1-a", ARM_ARCH_V9_1A, FPU_ARCH_VFP, armv91a),
ARM_ARCH_OPT2 ("armv9.2-a", ARM_ARCH_V9_2A, FPU_ARCH_VFP, armv92a),
ARM_ARCH_OPT2 ("armv9.3-a", ARM_ARCH_V9_2A, FPU_ARCH_VFP, armv93a),
ARM_ARCH_OPT2 ("armv9.4-a", ARM_ARCH_V9_4A, FPU_ARCH_VFP, armv94a),
ARM_ARCH_OPT ("xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP),
ARM_ARCH_OPT ("iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP),
ARM_ARCH_OPT ("iwmmxt2", ARM_ARCH_IWMMXT2, FPU_ARCH_VFP),
@ -32955,10 +32959,12 @@ static const cpu_arch_ver_table cpu_arch_ver[] =
{TAG_CPU_ARCH_V8, ARM_ARCH_V8_6A},
{TAG_CPU_ARCH_V8, ARM_ARCH_V8_7A},
{TAG_CPU_ARCH_V8, ARM_ARCH_V8_8A},
{TAG_CPU_ARCH_V8, ARM_ARCH_V8_9A},
{TAG_CPU_ARCH_V9, ARM_ARCH_V9A},
{TAG_CPU_ARCH_V9, ARM_ARCH_V9_1A},
{TAG_CPU_ARCH_V9, ARM_ARCH_V9_2A},
{TAG_CPU_ARCH_V9, ARM_ARCH_V9_3A},
{TAG_CPU_ARCH_V9, ARM_ARCH_V9_4A},
{-1, ARM_ARCH_NONE}
};

View File

@ -268,10 +268,12 @@ names are recognized:
@code{armv8.6-a},
@code{armv8.7-a},
@code{armv8.8-a},
@code{armv8.9-a},
@code{armv9-a},
@code{armv9.1-a},
@code{armv9.2-a},
@code{armv9.3-a},
@code{armv9.4-a},
@code{iwmmxt},
@code{iwmmxt2}
and

View File

@ -0,0 +1,17 @@
# name: attributes for -march=armv8.9-a
# source: blank.s
# as: -march=armv8.9-a
# readelf: -A
# This test is only valid on EABI based ports.
# target: *-*-*eabi* *-*-nacl*
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "8.9-A"
Tag_CPU_arch: v8
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_Advanced_SIMD_arch: NEON for ARMv8.1
Tag_MPextension_use: Allowed
Tag_Virtualization_use: TrustZone and Virtualization Extensions

View File

@ -0,0 +1,17 @@
# name: check for armv9.4-a command line option settings
# source: blank.s
# as: -march=armv9.4-a
# readelf: -A
# This test is only valid on EABI based ports.
# target: *-*-*eabi* *-*-nacl*
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "9.4-A"
Tag_CPU_arch: v9
Tag_CPU_arch_profile: Application
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-2
Tag_Advanced_SIMD_arch: NEON for ARMv8.1
Tag_MPextension_use: Allowed
Tag_Virtualization_use: TrustZone and Virtualization Extensions

View File

@ -0,0 +1,5 @@
#name: Bfloat 16 extension (Armv8.9-A)
#source: bfloat16.s
#as: -mno-warn-deprecated -march=armv8.9-a+simd -I$srcdir/$subdir
#objdump: -dr --show-raw-insn
#...

View File

@ -0,0 +1,5 @@
#name: Bfloat 16 extension (Armv9.4-A)
#source: bfloat16.s
#as: -mno-warn-deprecated -march=armv9.4-a+simd -I$srcdir/$subdir
#objdump: -dr --show-raw-insn
#...

View File

@ -0,0 +1,5 @@
#name: Int8 Matrix Multiply extension (Armv8.9-A)
#source: i8mm.s
#as: -mno-warn-deprecated -march=armv8.9-a+i8mm+simd -I$srcdir/$subdir
#objdump: -dr --show-raw-insn
#...

View File

@ -0,0 +1,5 @@
#name: Int8 Matrix Multiply extension (Armv9.4-A)
#source: i8mm.s
#as: -mno-warn-deprecated -march=armv9.4-a+i8mm+simd -I$srcdir/$subdir
#objdump: -dr --show-raw-insn
#...

View File

@ -379,6 +379,7 @@
| FPU_NEON_EXT_DOTPROD)
#define ARM_ARCH_V8_7A ARM_ARCH_V8_6A
#define ARM_ARCH_V8_8A ARM_ARCH_V8_7A
#define ARM_ARCH_V8_9A ARM_ARCH_V8_8A
#define ARM_ARCH_V8M_BASE ARM_FEATURE_CORE (ARM_AEXT_V8M_BASE, \
ARM_AEXT2_V8M_BASE)
#define ARM_ARCH_V8M_MAIN ARM_FEATURE_CORE (ARM_AEXT_V8M_MAIN, \
@ -399,6 +400,7 @@
| FPU_NEON_EXT_DOTPROD)
#define ARM_ARCH_V9_2A ARM_ARCH_V9_1A
#define ARM_ARCH_V9_3A ARM_ARCH_V9_2A
#define ARM_ARCH_V9_4A ARM_ARCH_V9_3A
/* Some useful combinations: */
#define ARM_ARCH_NONE ARM_FEATURE_ALL (0, 0, 0, 0)