arm: Add support for Armv9.1-A to Armv9.3-A
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 16 Dec 2021 09:32:00 +0000 (09:32 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 16 Dec 2021 09:32:00 +0000 (09:32 +0000)
This patch adds AArch32 support for -march=armv9.[123]-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_2A and ARM_ARCH_V9_3A
are technically redundant but it seemed less surprising to include
them anyway.

include/
* opcode/arm.h (ARM_ARCH_V9_1A, ARM_ARCH_V9_2A): New macros.
(ARM_ARCH_V9_3A): Likewise.

gas/
* doc/c-arm.texi: Add armv9.1-a, armv9.2-a and armv9.3-a.
* config/tc-arm.c (armv91a_ext_table, armv92a_ext_table): New macros.
(armv93a_ext_table): Likewise.
(arm_archs): Add armv9.1-a, armv9.2-a and armv9.3-a.
(cpu_arch_ver): Add ARM_ARCH_V9_1A, ARM_ARCH_V9_2A and ARM_ARCH_V9_3A.
* NEWS: Mention the above.
* testsuite/gas/arm/attr-march-armv9_1-a.d: New test.
* testsuite/gas/arm/attr-march-armv9_2-a.d: Likewise.
* testsuite/gas/arm/attr-march-armv9_3-a.d: Likewise.
* testsuite/gas/arm/bfloat16-armv9.1-a.d: Likewise.
* testsuite/gas/arm/bfloat16-armv9.2-a.d: Likewise.
* testsuite/gas/arm/bfloat16-armv9.3-a.d: Likewise.
* testsuite/gas/arm/i8mm-armv9.1-a.d: Likewise.
* testsuite/gas/arm/i8mm-armv9.2-a.d: Likewise.
* testsuite/gas/arm/i8mm-armv9.3-a.d: Likewise.

12 files changed:
gas/NEWS
gas/config/tc-arm.c
gas/testsuite/gas/arm/attr-march-armv9_1-a.d [new file with mode: 0644]
gas/testsuite/gas/arm/attr-march-armv9_2-a.d [new file with mode: 0644]
gas/testsuite/gas/arm/attr-march-armv9_3-a.d [new file with mode: 0644]
gas/testsuite/gas/arm/bfloat16-armv9.1-a.d [new file with mode: 0644]
gas/testsuite/gas/arm/bfloat16-armv9.2-a.d [new file with mode: 0644]
gas/testsuite/gas/arm/bfloat16-armv9.3-a.d [new file with mode: 0644]
gas/testsuite/gas/arm/i8mm-armv9.1-a.d [new file with mode: 0644]
gas/testsuite/gas/arm/i8mm-armv9.2-a.d [new file with mode: 0644]
gas/testsuite/gas/arm/i8mm-armv9.3-a.d [new file with mode: 0644]
include/opcode/arm.h

index 82d5aa54260e3f6a15de9476c8b35b4b3f1c7817..e366252207e5e245ad5211a1f4949b144d748545 100644 (file)
--- a/gas/NEWS
+++ b/gas/NEWS
@@ -31,8 +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 'armv8.7-a', 'armv8.8-a', and 'armv9-a' for -march
-  in Arm GAS.
+* Add support for 'armv8.7-a', 'armv8.8-a', 'armv9-a', 'armv9.1-a',
+  'armv9.2-a' and 'armv9.3-a' for -march in Arm GAS.
 
 * Add support for Intel AVX512_FP16 instructions.
 
index 50320fe31a229c06893e431afd3f1dcb4e28710f..f3f3f9a4d1ea40c64a78baf36f231595d0663535 100644 (file)
@@ -31972,6 +31972,10 @@ static const struct arm_ext_table armv9a_ext_table[] =
   { NULL, 0, ARM_ARCH_NONE, ARM_ARCH_NONE }
 };
 
+#define armv91a_ext_table armv86a_ext_table
+#define armv92a_ext_table armv91a_ext_table
+#define armv93a_ext_table armv92a_ext_table
+
 #define CDE_EXTENSIONS \
   ARM_ADD ("cdecp0", ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE | ARM_EXT2_CDE0)), \
   ARM_ADD ("cdecp1", ARM_FEATURE_CORE_HIGH (ARM_EXT2_CDE | ARM_EXT2_CDE1)), \
@@ -32096,7 +32100,10 @@ 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 ("armv9-a",      ARM_ARCH_V9A, FPU_ARCH_VFP, armv9a),
+  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_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),
@@ -32883,6 +32890,9 @@ static const cpu_arch_ver_table cpu_arch_ver[] =
     {TAG_CPU_ARCH_V8,      ARM_ARCH_V8_7A},
     {TAG_CPU_ARCH_V8,      ARM_ARCH_V8_8A},
     {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},
     {-1,                   ARM_ARCH_NONE}
 };
 
diff --git a/gas/testsuite/gas/arm/attr-march-armv9_1-a.d b/gas/testsuite/gas/arm/attr-march-armv9_1-a.d
new file mode 100644 (file)
index 0000000..abde8c2
--- /dev/null
@@ -0,0 +1,17 @@
+# name: check for armv9-a command line option settings
+# source: blank.s
+# as: -march=armv9.1-a
+# readelf: -A
+# This test is only valid on EABI based ports.
+# target: *-*-*eabi* *-*-nacl*
+
+Attribute Section: aeabi
+File Attributes
+  Tag_CPU_name: "9.1-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/attr-march-armv9_2-a.d b/gas/testsuite/gas/arm/attr-march-armv9_2-a.d
new file mode 100644 (file)
index 0000000..891576c
--- /dev/null
@@ -0,0 +1,17 @@
+# name: check for armv9-a command line option settings
+# source: blank.s
+# as: -march=armv9.2-a
+# readelf: -A
+# This test is only valid on EABI based ports.
+# target: *-*-*eabi* *-*-nacl*
+
+Attribute Section: aeabi
+File Attributes
+  Tag_CPU_name: "9.2-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/attr-march-armv9_3-a.d b/gas/testsuite/gas/arm/attr-march-armv9_3-a.d
new file mode 100644 (file)
index 0000000..3ed4d81
--- /dev/null
@@ -0,0 +1,17 @@
+# name: check for armv9-a command line option settings
+# source: blank.s
+# as: -march=armv9.3-a
+# readelf: -A
+# This test is only valid on EABI based ports.
+# target: *-*-*eabi* *-*-nacl*
+
+Attribute Section: aeabi
+File Attributes
+  Tag_CPU_name: "9.3-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-armv9.1-a.d b/gas/testsuite/gas/arm/bfloat16-armv9.1-a.d
new file mode 100644 (file)
index 0000000..871fe1e
--- /dev/null
@@ -0,0 +1,5 @@
+#name: Bfloat 16 extension (Armv9.1-A)
+#source: bfloat16.s
+#as: -mno-warn-deprecated -march=armv9.1-a+simd -I$srcdir/$subdir
+#objdump: -dr --show-raw-insn
+#...
diff --git a/gas/testsuite/gas/arm/bfloat16-armv9.2-a.d b/gas/testsuite/gas/arm/bfloat16-armv9.2-a.d
new file mode 100644 (file)
index 0000000..a9f4d57
--- /dev/null
@@ -0,0 +1,5 @@
+#name: Bfloat 16 extension (Armv9.2-A)
+#source: bfloat16.s
+#as: -mno-warn-deprecated -march=armv9.2-a+simd -I$srcdir/$subdir
+#objdump: -dr --show-raw-insn
+#...
diff --git a/gas/testsuite/gas/arm/bfloat16-armv9.3-a.d b/gas/testsuite/gas/arm/bfloat16-armv9.3-a.d
new file mode 100644 (file)
index 0000000..921006a
--- /dev/null
@@ -0,0 +1,5 @@
+#name: Bfloat 16 extension (Armv9.3-A)
+#source: bfloat16.s
+#as: -mno-warn-deprecated -march=armv9.3-a+simd -I$srcdir/$subdir
+#objdump: -dr --show-raw-insn
+#...
diff --git a/gas/testsuite/gas/arm/i8mm-armv9.1-a.d b/gas/testsuite/gas/arm/i8mm-armv9.1-a.d
new file mode 100644 (file)
index 0000000..1c319f6
--- /dev/null
@@ -0,0 +1,5 @@
+#name: Int8 Matrix Multiply extension (Armv9.1-A)
+#source: i8mm.s
+#as: -mno-warn-deprecated -march=armv9.1-a+i8mm+simd -I$srcdir/$subdir
+#objdump: -dr --show-raw-insn
+#...
diff --git a/gas/testsuite/gas/arm/i8mm-armv9.2-a.d b/gas/testsuite/gas/arm/i8mm-armv9.2-a.d
new file mode 100644 (file)
index 0000000..6d82e72
--- /dev/null
@@ -0,0 +1,5 @@
+#name: Int8 Matrix Multiply extension (Armv9.2-A)
+#source: i8mm.s
+#as: -mno-warn-deprecated -march=armv9.2-a+i8mm+simd -I$srcdir/$subdir
+#objdump: -dr --show-raw-insn
+#...
diff --git a/gas/testsuite/gas/arm/i8mm-armv9.3-a.d b/gas/testsuite/gas/arm/i8mm-armv9.3-a.d
new file mode 100644 (file)
index 0000000..942aa6d
--- /dev/null
@@ -0,0 +1,5 @@
+#name: Int8 Matrix Multiply extension (Armv9.3-A)
+#source: i8mm.s
+#as: -mno-warn-deprecated -march=armv9.3-a+i8mm+simd -I$srcdir/$subdir
+#objdump: -dr --show-raw-insn
+#...
index 8cf4856b0d69a9450f69bbb23043db10c8248909..7c3caa62a96e0dd64a47a2efebca4450a7338cae 100644 (file)
                                      ARM_AEXT2_V8_5A | ARM_EXT2_CRC,      \
                                      ARM_EXT3_V9A,        \
                       FPU_NEON_EXT_RDMA        | FPU_NEON_EXT_DOTPROD)
+#define ARM_ARCH_V9_1A  ARM_FEATURE_ALL (ARM_AEXT_V8A,                    \
+                                         ARM_AEXT2_V8_6A | ARM_EXT2_CRC,  \
+                                         ARM_EXT3_V9A,                    \
+                                         FPU_NEON_EXT_RDMA                \
+                                         | FPU_NEON_EXT_DOTPROD)
+#define ARM_ARCH_V9_2A   ARM_ARCH_V9_1A
+#define ARM_ARCH_V9_3A   ARM_ARCH_V9_2A
 
 /* Some useful combinations:  */
 #define ARM_ARCH_NONE  ARM_FEATURE_ALL (0, 0, 0, 0)