aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-arm.c
diff options
context:
space:
mode:
authorMatthew Gretton-Dann <matthew.gretton-dann@arm.com>2012-08-24 07:52:49 +0000
committerMatthew Gretton-Dann <matthew.gretton-dann@arm.com>2012-08-24 07:52:49 +0000
commit59d09be6f5643112208f203bcf8a613d89ae776b (patch)
tree7a9000498949d2ecfd04933d0b2c014a91bfd8c6 /gas/config/tc-arm.c
parentbca3892142429f819023a157be90c4d855cf93f8 (diff)
downloadgdb-59d09be6f5643112208f203bcf8a613d89ae776b.zip
gdb-59d09be6f5643112208f203bcf8a613d89ae776b.tar.gz
gdb-59d09be6f5643112208f203bcf8a613d89ae776b.tar.bz2
* gas/config/tc-arm.c (check_obsolete): New function.
(do_rd_rm_rn): Check swp{b} for obsoletion. * gas/testsuite/gas/arm/armv8-a-bad.d: New testcase. * gas/testsuite/gas/arm/armv8-a-bad.l: Likewise. * gas/testsuite/gas/arm/armv8-a-bad.s: Likewise. * gas/testsuite/gas/arm/depr-swp.l: Update for change in expected output. * gas/testsuite/gas/arm/depr-swp.s: Add additional test. * include/opcode/arm.h (ARM_CPU_IS_ANY): New define.
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r--gas/config/tc-arm.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 101f86b..af4a1e5 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -7373,6 +7373,23 @@ do_rn_rd (void)
inst.instruction |= inst.operands[1].reg << 12;
}
+static bfd_boolean
+check_obsolete (const arm_feature_set *feature, const char *msg)
+{
+ if (ARM_CPU_IS_ANY (cpu_variant))
+ {
+ as_warn ("%s", msg);
+ return TRUE;
+ }
+ else if (ARM_CPU_HAS_FEATURE (cpu_variant, *feature))
+ {
+ as_bad ("%s", msg);
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
do_rd_rm_rn (void)
{
@@ -7383,12 +7400,15 @@ do_rd_rm_rn (void)
constraint (Rn == inst.operands[0].reg || Rn == inst.operands[1].reg,
_("Rn must not overlap other operands"));
- /* SWP{b} is deprecated for ARMv6* and ARMv7. */
- if (warn_on_deprecated
- && ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6))
- as_warn (_("swp{b} use is deprecated for this architecture"));
-
+ /* SWP{b} is obsolete for ARMv8-A, and deprecated for ARMv6* and ARMv7.
+ */
+ if (!check_obsolete (&arm_ext_v8,
+ _("swp{b} use is obsoleted for ARMv8 and later"))
+ && warn_on_deprecated
+ && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v6))
+ as_warn (_("swp{b} use is deprecated for ARMv6 and ARMv7"));
}
+
inst.instruction |= inst.operands[0].reg << 12;
inst.instruction |= inst.operands[1].reg;
inst.instruction |= Rn << 16;