From b3b647dc7fb8f9854637234b47c17c0d11873577 Mon Sep 17 00:00:00 2001 From: srinath Date: Mon, 8 Jan 2024 14:13:28 +0000 Subject: [PATCH] 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. --- gas/NEWS | 2 ++ gas/config/tc-arm.c | 6 ++++++ gas/doc/c-arm.texi | 2 ++ gas/testsuite/gas/arm/attr-march-armv8_9-a.d | 17 +++++++++++++++++ gas/testsuite/gas/arm/attr-march-armv9_4-a.d | 17 +++++++++++++++++ gas/testsuite/gas/arm/bfloat16-armv8.9-a.d | 5 +++++ gas/testsuite/gas/arm/bfloat16-armv9.4-a.d | 5 +++++ gas/testsuite/gas/arm/i8mm-armv8.9-a.d | 5 +++++ gas/testsuite/gas/arm/i8mm-armv9.4-a.d | 5 +++++ include/opcode/arm.h | 2 ++ 10 files changed, 66 insertions(+) create mode 100644 gas/testsuite/gas/arm/attr-march-armv8_9-a.d create mode 100644 gas/testsuite/gas/arm/attr-march-armv9_4-a.d create mode 100644 gas/testsuite/gas/arm/bfloat16-armv8.9-a.d create mode 100644 gas/testsuite/gas/arm/bfloat16-armv9.4-a.d create mode 100644 gas/testsuite/gas/arm/i8mm-armv8.9-a.d create mode 100644 gas/testsuite/gas/arm/i8mm-armv9.4-a.d diff --git a/gas/NEWS b/gas/NEWS index 3dede06fd0e..74df7e61349 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -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 diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 228e5e07eba..9c4bf56fa7d 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -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} }; diff --git a/gas/doc/c-arm.texi b/gas/doc/c-arm.texi index 0a54073c577..ec1ed9de7df 100644 --- a/gas/doc/c-arm.texi +++ b/gas/doc/c-arm.texi @@ -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 diff --git a/gas/testsuite/gas/arm/attr-march-armv8_9-a.d b/gas/testsuite/gas/arm/attr-march-armv8_9-a.d new file mode 100644 index 00000000000..e1d8feb400a --- /dev/null +++ b/gas/testsuite/gas/arm/attr-march-armv8_9-a.d @@ -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 diff --git a/gas/testsuite/gas/arm/attr-march-armv9_4-a.d b/gas/testsuite/gas/arm/attr-march-armv9_4-a.d new file mode 100644 index 00000000000..b989114bf3e --- /dev/null +++ b/gas/testsuite/gas/arm/attr-march-armv9_4-a.d @@ -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 diff --git a/gas/testsuite/gas/arm/bfloat16-armv8.9-a.d b/gas/testsuite/gas/arm/bfloat16-armv8.9-a.d new file mode 100644 index 00000000000..8c32abd7da9 --- /dev/null +++ b/gas/testsuite/gas/arm/bfloat16-armv8.9-a.d @@ -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 +#... diff --git a/gas/testsuite/gas/arm/bfloat16-armv9.4-a.d b/gas/testsuite/gas/arm/bfloat16-armv9.4-a.d new file mode 100644 index 00000000000..d78876c0087 --- /dev/null +++ b/gas/testsuite/gas/arm/bfloat16-armv9.4-a.d @@ -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 +#... diff --git a/gas/testsuite/gas/arm/i8mm-armv8.9-a.d b/gas/testsuite/gas/arm/i8mm-armv8.9-a.d new file mode 100644 index 00000000000..a2a28ae0b46 --- /dev/null +++ b/gas/testsuite/gas/arm/i8mm-armv8.9-a.d @@ -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 +#... diff --git a/gas/testsuite/gas/arm/i8mm-armv9.4-a.d b/gas/testsuite/gas/arm/i8mm-armv9.4-a.d new file mode 100644 index 00000000000..392941099cf --- /dev/null +++ b/gas/testsuite/gas/arm/i8mm-armv9.4-a.d @@ -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 +#... diff --git a/include/opcode/arm.h b/include/opcode/arm.h index 0b5c373f280..ad1d18a7f21 100644 --- a/include/opcode/arm.h +++ b/include/opcode/arm.h @@ -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)