diff options
author | mgretton <mgretton> | 2012-08-24 07:52:48 +0000 |
---|---|---|
committer | mgretton <mgretton> | 2012-08-24 07:52:48 +0000 |
commit | f47c5414f7845c3dde42f9caebd6b1a524c15414 (patch) | |
tree | 972ecf0c30a3ccb7f4f1e2fd662a22cc9ec0af6d /gas/config | |
parent | de9b7f70041576cc9982495aacd65bd8d4a7b2eb (diff) | |
download | binutils-redhat-f47c5414f7845c3dde42f9caebd6b1a524c15414.tar.gz |
* 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')
-rw-r--r-- | gas/config/tc-arm.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 101f86b337..af4a1e58ce 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; |