From b3e4d9326faf88d83745379f254d56b8a8324b63 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 16 Dec 2021 09:32:00 +0000 Subject: [PATCH] arm: Add support for Armv8.7-A and Armv8.8-A This patch adds AArch32 support for -march=armv8.[78]-a. The behaviour of the new options can be expressed using a combination of existing feature flags and tables. The cpu_arch_ver entries are technically redundant but it seemed less surprising to include them anyway. include/ * opcode/arm.h (ARM_ARCH_V8_7A, ARM_ARCH_V8_8A): New macros. gas/ * doc/c-arm.texi: Add armv8.7-a and armv8.8-a. * config/tc-arm.c (armv87a_ext_table, armv88a_ext_table): New macros. (arm_archs): Add armv8.7-a and armv8.8-a. (cpu_arch_ver): Add ARM_ARCH_V8_7A and ARM_ARCH_V8_8A. * NEWS: Mention the above. * testsuite/gas/arm/attr-march-armv8_7-a.d: New test. * testsuite/gas/arm/attr-march-armv8_8-a.d: Likewise. * testsuite/gas/arm/bfloat16-armv8.7-a.d: Likewise. * testsuite/gas/arm/bfloat16-armv8.8-a.d: Likewise. * testsuite/gas/arm/i8mm-armv8.7-a.d: Likewise. * testsuite/gas/arm/i8mm-armv8.8-a.d: Likewise. --- gas/NEWS | 3 ++- gas/config/tc-arm.c | 7 +++++++ gas/doc/c-arm.texi | 2 ++ gas/testsuite/gas/arm/attr-march-armv8_7-a.d | 17 +++++++++++++++++ gas/testsuite/gas/arm/attr-march-armv8_8-a.d | 17 +++++++++++++++++ gas/testsuite/gas/arm/bfloat16-armv8.7-a.d | 5 +++++ gas/testsuite/gas/arm/bfloat16-armv8.8-a.d | 5 +++++ gas/testsuite/gas/arm/i8mm-armv8.7-a.d | 5 +++++ gas/testsuite/gas/arm/i8mm-armv8.8-a.d | 5 +++++ include/opcode/arm.h | 2 ++ 10 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 gas/testsuite/gas/arm/attr-march-armv8_7-a.d create mode 100644 gas/testsuite/gas/arm/attr-march-armv8_8-a.d create mode 100644 gas/testsuite/gas/arm/bfloat16-armv8.7-a.d create mode 100644 gas/testsuite/gas/arm/bfloat16-armv8.8-a.d create mode 100644 gas/testsuite/gas/arm/i8mm-armv8.7-a.d create mode 100644 gas/testsuite/gas/arm/i8mm-armv8.8-a.d diff --git a/gas/NEWS b/gas/NEWS index d0dca5bb035..82d5aa54260 100644 --- a/gas/NEWS +++ b/gas/NEWS @@ -31,7 +31,8 @@ * Add support for 'armv8.8-a', 'armv9-a', 'armv9.1-a', 'armv9.2-a' and 'armv9.3-a' for -march in AArch64 GAS. -* Add support for 'armv9-a' for -march in Arm GAS. +* Add support for 'armv8.7-a', 'armv8.8-a', and 'armv9-a' for -march + in Arm GAS. * Add support for Intel AVX512_FP16 instructions. diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index fad1775bcea..50320fe31a2 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -31954,6 +31954,9 @@ static const struct arm_ext_table armv86a_ext_table[] = { NULL, 0, ARM_ARCH_NONE, ARM_ARCH_NONE } }; +#define armv87a_ext_table armv86a_ext_table +#define armv88a_ext_table armv87a_ext_table + static const struct arm_ext_table armv9a_ext_table[] = { ARM_ADD ("simd", FPU_ARCH_DOTPROD_NEON_VFP_ARMV8), @@ -32091,6 +32094,8 @@ static const struct arm_arch_option_table arm_archs[] = ARM_ARCH_OPT2 ("armv8.4-a", ARM_ARCH_V8_4A, FPU_ARCH_VFP, armv84a), ARM_ARCH_OPT2 ("armv8.5-a", ARM_ARCH_V8_5A, FPU_ARCH_VFP, armv85a), 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 ("armv9-a", ARM_ARCH_V9A, FPU_ARCH_VFP, armv9a), ARM_ARCH_OPT ("xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP), ARM_ARCH_OPT ("iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP), @@ -32875,6 +32880,8 @@ static const cpu_arch_ver_table cpu_arch_ver[] = {TAG_CPU_ARCH_V8, ARM_ARCH_V8_5A}, {TAG_CPU_ARCH_V8_1M_MAIN, ARM_ARCH_V8_1M_MAIN}, {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_V9, ARM_ARCH_V9A}, {-1, ARM_ARCH_NONE} }; diff --git a/gas/doc/c-arm.texi b/gas/doc/c-arm.texi index 4b5656ee06e..49a91276029 100644 --- a/gas/doc/c-arm.texi +++ b/gas/doc/c-arm.texi @@ -265,6 +265,8 @@ names are recognized: @code{armv8-m.main}, @code{armv8.1-m.main}, @code{armv8.6-a}, +@code{armv8.7-a}, +@code{armv8.8-a}, @code{armv9-a}, @code{iwmmxt}, @code{iwmmxt2} diff --git a/gas/testsuite/gas/arm/attr-march-armv8_7-a.d b/gas/testsuite/gas/arm/attr-march-armv8_7-a.d new file mode 100644 index 00000000000..38f04297c2f --- /dev/null +++ b/gas/testsuite/gas/arm/attr-march-armv8_7-a.d @@ -0,0 +1,17 @@ +# name: attributes for -march=armv8.7-a +# source: blank.s +# as: -march=armv8.7-a +# readelf: -A +# This test is only valid on EABI based ports. +# target: *-*-*eabi* *-*-nacl* + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "8.7-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-armv8_8-a.d b/gas/testsuite/gas/arm/attr-march-armv8_8-a.d new file mode 100644 index 00000000000..64db0009290 --- /dev/null +++ b/gas/testsuite/gas/arm/attr-march-armv8_8-a.d @@ -0,0 +1,17 @@ +# name: attributes for -march=armv8.8-a +# source: blank.s +# as: -march=armv8.8-a +# readelf: -A +# This test is only valid on EABI based ports. +# target: *-*-*eabi* *-*-nacl* + +Attribute Section: aeabi +File Attributes + Tag_CPU_name: "8.8-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/bfloat16-armv8.7-a.d b/gas/testsuite/gas/arm/bfloat16-armv8.7-a.d new file mode 100644 index 00000000000..c898958a27a --- /dev/null +++ b/gas/testsuite/gas/arm/bfloat16-armv8.7-a.d @@ -0,0 +1,5 @@ +#name: Bfloat 16 extension (Armv8.7-A) +#source: bfloat16.s +#as: -mno-warn-deprecated -march=armv8.7-a+simd -I$srcdir/$subdir +#objdump: -dr --show-raw-insn +#... diff --git a/gas/testsuite/gas/arm/bfloat16-armv8.8-a.d b/gas/testsuite/gas/arm/bfloat16-armv8.8-a.d new file mode 100644 index 00000000000..074162421a7 --- /dev/null +++ b/gas/testsuite/gas/arm/bfloat16-armv8.8-a.d @@ -0,0 +1,5 @@ +#name: Bfloat 16 extension (Armv8.8-A) +#source: bfloat16.s +#as: -mno-warn-deprecated -march=armv8.8-a+simd -I$srcdir/$subdir +#objdump: -dr --show-raw-insn +#... diff --git a/gas/testsuite/gas/arm/i8mm-armv8.7-a.d b/gas/testsuite/gas/arm/i8mm-armv8.7-a.d new file mode 100644 index 00000000000..881060bbe7a --- /dev/null +++ b/gas/testsuite/gas/arm/i8mm-armv8.7-a.d @@ -0,0 +1,5 @@ +#name: Int8 Matrix Multiply extension (Armv8.7-A) +#source: i8mm.s +#as: -mno-warn-deprecated -march=armv8.7-a+i8mm+simd -I$srcdir/$subdir +#objdump: -dr --show-raw-insn +#... diff --git a/gas/testsuite/gas/arm/i8mm-armv8.8-a.d b/gas/testsuite/gas/arm/i8mm-armv8.8-a.d new file mode 100644 index 00000000000..ab15b31f9f2 --- /dev/null +++ b/gas/testsuite/gas/arm/i8mm-armv8.8-a.d @@ -0,0 +1,5 @@ +#name: Int8 Matrix Multiply extension (Armv8.8-A) +#source: i8mm.s +#as: -mno-warn-deprecated -march=armv8.8-a+i8mm+simd -I$srcdir/$subdir +#objdump: -dr --show-raw-insn +#... diff --git a/include/opcode/arm.h b/include/opcode/arm.h index cf72b90bd55..8cf4856b0d6 100644 --- a/include/opcode/arm.h +++ b/include/opcode/arm.h @@ -377,6 +377,8 @@ #define ARM_ARCH_V8_6A ARM_FEATURE (ARM_AEXT_V8A, ARM_AEXT2_V8_6A \ | ARM_EXT2_CRC, FPU_NEON_EXT_RDMA \ | 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_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, \ -- 2.30.2