[gas][arm] Add -mwarn-restrict-it
authorAndre Vieira <andre.simoesdiasvieira@arm.com>
Wed, 11 Dec 2019 15:53:26 +0000 (15:53 +0000)
committerAndre Vieira <andre.simoesdiasvieira@arm.com>
Wed, 11 Dec 2019 15:53:26 +0000 (15:53 +0000)
Add a -m{no-}warn-restrict-it option to control IT related warnings in
ARMv8-A and ARMv8-R.  This is disabled by default.

Committed on behalf of Wilco Dijkstra.

gas/ChangeLog:
2019-12-11  Wilco Dijkstra  <wdijkstr@arm.com>

* config/tc-arm.c (warn_on_restrict_it): Add new variable.
(it_fsm_post_encode): Check warn_on_restrict_it.
(arm_option_table): Add -mwarn-restrict-it/-mno-warn-restrict-it.
* testsuite/gas/arm/armv8-2-fp16-scalar-bad.d: Add -mwarn-restrict-it.
* testsuite/gas/arm/armv8-2-fp16-scalar-bad-ext.d: Likewise.
* testsuite/gas/arm/armv8-a-bad.d: Likewise.
* testsuite/gas/arm/armv8-a-it-bad.d: Likewise.
* testsuite/gas/arm/armv8-r-bad.d: Likewise.
* testsuite/gas/arm/armv8-r-it-bad.d: Likewise.
* testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d: Likewise.
* testsuite/gas/arm/udf.d: Likewise.

gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad-ext.d
gas/testsuite/gas/arm/armv8-2-fp16-scalar-bad.d
gas/testsuite/gas/arm/armv8-a-bad.d
gas/testsuite/gas/arm/armv8-a-it-bad.d
gas/testsuite/gas/arm/armv8-r-bad.d
gas/testsuite/gas/arm/armv8-r-it-bad.d
gas/testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d
gas/testsuite/gas/arm/udf.d

index 4931c1a8115b5c6c384a06e1c115a16853d6a248..700014d47f133909d792d8c4481bca19c100d369 100644 (file)
@@ -1,3 +1,17 @@
+2019-12-11  Wilco Dijkstra  <wdijkstr@arm.com>
+
+       * config/tc-arm.c (warn_on_restrict_it): Add new variable.
+       (it_fsm_post_encode): Check warn_on_restrict_it.
+       (arm_option_table): Add -mwarn-restrict-it/-mno-warn-restrict-it.
+       * testsuite/gas/arm/armv8-2-fp16-scalar-bad.d: Add -mwarn-restrict-it.
+       * testsuite/gas/arm/armv8-2-fp16-scalar-bad-ext.d: Likewise.
+       * testsuite/gas/arm/armv8-a-bad.d: Likewise.
+       * testsuite/gas/arm/armv8-a-it-bad.d: Likewise.
+       * testsuite/gas/arm/armv8-r-bad.d: Likewise.
+       * testsuite/gas/arm/armv8-r-it-bad.d: Likewise.
+       * testsuite/gas/arm/sp-pc-validations-bad-t-v8a.d: Likewise.
+       * testsuite/gas/arm/udf.d: Likewise.
+
 2018-12-11  Jan Beulich  <jbeulich@suse.com>
 
        * config/tc-i386.c (md_assemble): Extend SSE check conditional.
index c4ffeeec3a4f28bfa3becc958e0ad0fd9a90b2d8..e680f93cff2d59c23f25f2475d9bf5ffefa07a80 100644 (file)
@@ -154,6 +154,7 @@ static int pic_code      = FALSE;
 static int fix_v4bx         = FALSE;
 /* Warn on using deprecated features.  */
 static int warn_on_deprecated = TRUE;
+static int warn_on_restrict_it = FALSE;
 
 /* Understand CodeComposer Studio assembly syntax.  */
 bfd_boolean codecomposer_syntax = FALSE;
@@ -22788,6 +22789,7 @@ it_fsm_post_encode (void)
     handle_pred_state ();
 
   if (now_pred.insn_cond
+      && warn_on_restrict_it
       && !now_pred.warn_deprecated
       && warn_on_deprecated
       && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v8)
@@ -30529,6 +30531,11 @@ struct arm_option_table arm_opts[] =
   {"mwarn-deprecated", NULL, &warn_on_deprecated, 1, NULL},
   {"mno-warn-deprecated", N_("do not warn on use of deprecated feature"),
    &warn_on_deprecated, 0, NULL},
+
+  {"mwarn-restrict-it", N_("warn about performance deprecated IT instructions"
+   " in ARMv8-A and ARMv8-R"), &warn_on_restrict_it, 1, NULL},
+  {"mno-warn-restrict-it", NULL, &warn_on_restrict_it, 0, NULL},
+
   {"mwarn-syms", N_("warn about symbols that match instruction names [default]"), (int *) (& flag_warn_syms), TRUE, NULL},
   {"mno-warn-syms", N_("disable warnings about symobls that match instructions"), (int *) (& flag_warn_syms), FALSE, NULL},
   {NULL, NULL, NULL, 0, NULL}
index b98e7cf7b24806b77d70cc56d5f4a6bef040394a..d9049445144ba2367da84cff68b2c31bb9ad5e3b 100644 (file)
@@ -1,4 +1,4 @@
 #name: Invalid armv8.2-a scalar fp16
 #source: armv8-2-fp16-scalar-bad.s
-#as: -march=armv8.2-a+fp16
+#as: -march=armv8.2-a+fp16 -mwarn-restrict-it
 #error_output: armv8-2-fp16-scalar-bad.l
index 13eb7c759ff35565751502d6e9ce241956f8d42f..da625db4dd07aff61b93e0f614468b1386773a19 100644 (file)
@@ -1,4 +1,4 @@
 #name: Invalid armv8.2-a scalar fp16
 #source: armv8-2-fp16-scalar-bad.s
-#as: -march=armv8.2-a+fp16 -mfpu=fp-armv8
+#as: -march=armv8.2-a+fp16 -mfpu=fp-armv8 -mwarn-restrict-it
 #error_output: armv8-2-fp16-scalar-bad.l
index 302658d7a192a24b5b4eb077e494baf0dd4ba220..45109ceeb3f067668dbaf8fd4f03681629d2a916 100644 (file)
@@ -1,4 +1,4 @@
 #name: Invalid v8-a
 #source: armv8-ar-bad.s
-#as: -march=armv8-a
+#as: -march=armv8-a -mwarn-restrict-it
 #error_output: armv8-ar-bad.l
index 43fc9f1c5b4585a36f82c6c6439987bdce71a57e..02788e0dcd2fe310dab06f0e1f2a8f66aaca7acb 100644 (file)
@@ -1,4 +1,4 @@
 #name: Deprecated IT blocks (ARM v8)
 #source: armv8-ar-it-bad.s
 #error_output: armv8-ar-it-bad.l
-#as: -march=armv8-a -mimplicit-it=always
+#as: -march=armv8-a -mimplicit-it=always -mwarn-restrict-it
index 150390b58717dc5481bb7f3bbdabc1884d0593eb..b643c81de561ffb33ed5e50e59ba7d3589c62ba6 100644 (file)
@@ -1,4 +1,4 @@
 #name: Invalid v8-r
 #source: armv8-ar-bad.s
-#as: -march=armv8-r
+#as: -march=armv8-r -mwarn-restrict-it
 #error_output: armv8-ar-bad.l
index 5260ae004fc5bac0edb4f2b9a088064f9036f629..c6f0c5bcae84edc7cb22773a38a10c95c093a9b6 100644 (file)
@@ -1,4 +1,4 @@
 #name: Deprecated IT blocks (ARM v8)
 #source: armv8-ar-it-bad.s
 #error_output: armv8-ar-it-bad.l
-#as: -march=armv8-r -mimplicit-it=always
+#as: -march=armv8-r -mimplicit-it=always -mwarn-restrict-it
index 8ca576b2b88a80acd77aa802065c58fcb4484786..41a6cdced739eb38341b6efa08f4be60ba1d0d19 100644 (file)
@@ -1,4 +1,4 @@
-# as: -march=armv8-a
+# as: -march=armv8-a -mwarn-restrict-it
 # name: Invalid SP and PC operands test - THUMB (v8a)
 # source: sp-pc-validations-bad-t.s
 # error_output: sp-pc-validations-bad-t-v8a.l
index f53a43757e41503da693bc22fd4b7ab16a9492b3..a6a021e4d0329e15c4d400c1d2499e4b70d6d34e 100644 (file)
@@ -1,6 +1,6 @@
 #objdump: -dr --prefix-addresses --show-raw-insn
 #name: UDF
-#as: -march=armv8-a
+#as: -march=armv8-a -mwarn-restrict-it
 #warning_output: udf.l
 #skip: *-*-pe *-*-wince