aarch64: Remove version dependencies from features
authorAndrew Carlotti <andrew.carlotti@arm.com>
Wed, 28 Jun 2023 17:05:28 +0000 (18:05 +0100)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Wed, 28 Jun 2023 17:11:58 +0000 (18:11 +0100)
Many instructions were enabled only when both a feature flag and a minimum
architecture version are specified.  This behaviour differs from GCC, which (in
most cases) allows features to be enabled at any architecture version.

There is no need for the toolchain to restrict combinations of unrelated
features in this way, so this patch removes the unnecessary dependencies.

13 files changed:
gas/testsuite/gas/aarch64/armv8_2-a-crypto-fp16-illegal.d
gas/testsuite/gas/aarch64/armv8_2-a-crypto-fp16.d
gas/testsuite/gas/aarch64/armv8_5-a-memtag.d
gas/testsuite/gas/aarch64/dotproduct.d
gas/testsuite/gas/aarch64/f32mm.d
gas/testsuite/gas/aarch64/f64mm.d
gas/testsuite/gas/aarch64/i8mm.d
gas/testsuite/gas/aarch64/illegal-dotproduct.d
gas/testsuite/gas/aarch64/illegal-memtag.d
gas/testsuite/gas/aarch64/ls64-invalid.s
gas/testsuite/gas/aarch64/ls64.s
gas/testsuite/gas/aarch64/sve-movprfx-mm.d
opcodes/aarch64-tbl.h

index d1cd7536bb9a6a8c5f7d5e00bb1aaff2bb0d1922..f76d06dca2449e31eee14642575dabaffe1632b5 100644 (file)
@@ -1,3 +1,3 @@
-#as: -march=armv8.2-a+crypto+sm4+sha3
+#as: -march=armv8.2-a
 #source: armv8_2-a-illegal.s
 #error_output: armv8_2-a-illegal.l
index 244ba1424c53a3926ad7c5a15ff2f3802c7ad93e..3916ac74d160f270f78ed6ebc99eae5b936cd765 100644 (file)
@@ -1,4 +1,4 @@
-#as: -march=armv8.2-a+crypto+sm4+sha3+fp16fml
+#as: -march=armv8-a+crypto+sm4+sha3+fp16fml
 #objdump: -dr
 
 .*:     file format .*
index 37981bc14d3f567e53ee38bf547649afdb205928..e6b5d699cc0d8050686650f025175bda76147dfb 100644 (file)
@@ -1,4 +1,4 @@
-#as: -march=armv8.5-a+memtag
+#as: -march=armv8-a+memtag
 # objdump: -d
 
 .*: .*
index fd2f0ebf4c66de3e9bd3e831c8cb9828cae932aa..fed6a5ec864f5657ff7bd5b314c838ad6d047f3a 100644 (file)
@@ -1,4 +1,4 @@
-#as: -march=armv8.2-a+dotprod
+#as: -march=armv8-a+dotprod
 #as: -march=armv8.4-a
 #objdump: -dr
 
index 0481852def66244ebd4164e39f47c392a813eb58..a8c40c9dcaadf4150ef5db31362b0330d58bf049 100644 (file)
@@ -1,4 +1,4 @@
-#as: -march=armv8.6-a+sve+f32mm
+#as: -march=armv8-a+sve+f32mm
 #objdump: -dr
 
 .*:     file format .*
index 35c0853b72cc85757cf92afb0fbba40bc54dbcd6..395e597397f3cae67eb8841142cabf78e875af95 100644 (file)
@@ -1,4 +1,4 @@
-#as: -march=armv8.6-a+sve+f64mm
+#as: -march=armv8-a+sve+f64mm
 #objdump: -dr
 
 .*:     file format .*
index 04cd1376ab51b00e4772c6fecabddcd5d6f4b676..806e3c6602261fef5041a0c28d68350dd13e783f 100644 (file)
@@ -1,4 +1,5 @@
 #as: -march=armv8.6-a+sve
+#as: -march=armv8-a+sve+i8mm
 #objdump: -dr
 
 .*:     file format .*
index 0e15b9fbed4f90dd9d68c1923f73239e73dcde20..e19babfef7d3e2d22fccd9e0afcacc4357545a1c 100644 (file)
@@ -1,4 +1,4 @@
-#as: -march=armv8.2-a+dotprod
+#as: -march=armv8-a+dotprod
 #as: -march=armv8.4-a
 #name: Invalid dotproduct instructions.
 #source: illegal-dotproduct.s
index 913661ab53f4318817df87104d7f2be33697b650..782712db95a2b22823ae01f2130ac04486c2b1e6 100644 (file)
@@ -1,3 +1,3 @@
-#as: -march=armv8.5-a+memtag
+#as: -march=armv8-a+memtag
 #source: illegal-memtag.s
 #error_output: illegal-memtag.l
index 151fe41c149220c3b7b19cfe24831d8a6838c26c..bbbbdd6ac274de89091c42abe00cf57b4a7b36e6 100644 (file)
@@ -1,6 +1,6 @@
 /* Atomic 64-byte load/store instructions limit register number Rt to below
    condition: the <Xt> register number should be even and <= 22.  */
-.arch armv8.7-a+ls64
+.arch armv8-a+ls64
 
 /* Single-copy Atomic 64-byte Load.  */
        ld64b x0, [x1]
index 61164182d16d62f5ce436eb57de002e935a735b9..ad60f1c8dedc4249d02a09f84abae9d968d61725 100644 (file)
@@ -1,5 +1,5 @@
 /* Atomic 64-byte load/store instructions.  */
-.arch armv8.6-a+ls64
+.arch armv8-a+ls64
 
 /* Single-copy Atomic 64-byte Load.  */
        ld64b x0, [x1]
index f2b480dfe48e41bbaa411d2d974b3788da5c7add..0357a5a79add4cc7a872b0ae40b39e6f0ce7cbae 100644 (file)
@@ -1,4 +1,4 @@
-#as: -march=armv8.6-a+f32mm+f64mm+sve
+#as: -march=armv8-a+i8mm+f32mm+f64mm+sve
 #objdump: -dr
 
 .* file format .*
index 2f8b19f2c7a332a1ab0cb8244bef22921c38f564..b7204e3fac49d28116bd6e32efb059a7761e8283 100644 (file)
   QLF3(V_4S, V_8H, S_H),       \
 }
 \f
-/* Opcode table.  */
+/* Opcode table.
+
+  Any SVE or SVE2 feature must include AARCH64_FEATURE_{SVE|SVE2} in its
+  bitmask, even if this is implied by other selected feature bits.  This
+  allows verify_constraints to identify SVE instructions when selecting an
+  error message for MOVPRFX constraint violations.  */
 
 static const aarch64_feature_set aarch64_feature_v8 =
   AARCH64_FEATURE (AARCH64_FEATURE_V8, 0);
@@ -2488,7 +2493,7 @@ static const aarch64_feature_set aarch64_feature_compnum =
 static const aarch64_feature_set aarch64_feature_rcpc =
   AARCH64_FEATURE (AARCH64_FEATURE_RCPC, 0);
 static const aarch64_feature_set aarch64_feature_dotprod =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_2 | AARCH64_FEATURE_DOTPROD, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_DOTPROD, 0);
 static const aarch64_feature_set aarch64_feature_sha2 =
   AARCH64_FEATURE (AARCH64_FEATURE_V8 | AARCH64_FEATURE_SHA2, 0);
 static const aarch64_feature_set aarch64_feature_aes =
@@ -2496,14 +2501,14 @@ static const aarch64_feature_set aarch64_feature_aes =
 static const aarch64_feature_set aarch64_feature_v8_4 =
   AARCH64_FEATURE (AARCH64_FEATURE_V8_4, 0);
 static const aarch64_feature_set aarch64_feature_sm4 =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_2 | AARCH64_FEATURE_SM4
-                  | AARCH64_FEATURE_SIMD | AARCH64_FEATURE_FP, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_SM4 | AARCH64_FEATURE_SIMD
+                  | AARCH64_FEATURE_FP, 0);
 static const aarch64_feature_set aarch64_feature_sha3 =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_2 | AARCH64_FEATURE_SHA2
-                  | AARCH64_FEATURE_SHA3 | AARCH64_FEATURE_SIMD | AARCH64_FEATURE_FP, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_SHA2 | AARCH64_FEATURE_SHA3
+                  | AARCH64_FEATURE_SIMD | AARCH64_FEATURE_FP, 0);
 static const aarch64_feature_set aarch64_feature_fp_16_v8_2 =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_2 | AARCH64_FEATURE_F16_FML
-                  | AARCH64_FEATURE_F16 | AARCH64_FEATURE_FP, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_F16_FML | AARCH64_FEATURE_F16
+                  | AARCH64_FEATURE_FP, 0);
 static const aarch64_feature_set aarch64_feature_v8_5 =
   AARCH64_FEATURE (AARCH64_FEATURE_V8_5, 0);
 static const aarch64_feature_set aarch64_feature_flagmanip =
@@ -2515,7 +2520,7 @@ static const aarch64_feature_set aarch64_feature_sb =
 static const aarch64_feature_set aarch64_feature_predres =
   AARCH64_FEATURE (AARCH64_FEATURE_PREDRES, 0);
 static const aarch64_feature_set aarch64_feature_memtag =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_5 | AARCH64_FEATURE_MEMTAG, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_MEMTAG, 0);
 static const aarch64_feature_set aarch64_feature_bfloat16 =
   AARCH64_FEATURE (AARCH64_FEATURE_BFLOAT16, 0);
 static const aarch64_feature_set aarch64_feature_bfloat16_sve =
@@ -2552,20 +2557,17 @@ static const aarch64_feature_set aarch64_feature_v8_6 =
 static const aarch64_feature_set aarch64_feature_v8_7 =
   AARCH64_FEATURE (AARCH64_FEATURE_V8_7, 0);
 static const aarch64_feature_set aarch64_feature_i8mm =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_2 | AARCH64_FEATURE_I8MM, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_I8MM, 0);
 static const aarch64_feature_set aarch64_feature_i8mm_sve =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_2 | AARCH64_FEATURE_I8MM
-       | AARCH64_FEATURE_SVE, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_I8MM | AARCH64_FEATURE_SVE, 0);
 static const aarch64_feature_set aarch64_feature_f32mm_sve =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_2 | AARCH64_FEATURE_F32MM
-       | AARCH64_FEATURE_SVE, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_F32MM | AARCH64_FEATURE_SVE, 0);
 static const aarch64_feature_set aarch64_feature_f64mm_sve =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_2 | AARCH64_FEATURE_F64MM
-       | AARCH64_FEATURE_SVE, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_F64MM | AARCH64_FEATURE_SVE, 0);
 static const aarch64_feature_set aarch64_feature_v8_r =
   AARCH64_FEATURE (AARCH64_FEATURE_V8_R, 0);
 static const aarch64_feature_set aarch64_feature_ls64 =
-  AARCH64_FEATURE (AARCH64_FEATURE_V8_6 | AARCH64_FEATURE_LS64, 0);
+  AARCH64_FEATURE (AARCH64_FEATURE_LS64, 0);
 static const aarch64_feature_set aarch64_feature_flagm =
   AARCH64_FEATURE (AARCH64_FEATURE_FLAGM, 0);
 static const aarch64_feature_set aarch64_feature_mops =