From 56adecf405963c4b283d0b8297236525ab5f374a Mon Sep 17 00:00:00 2001 From: Daniel Gutson Date: Tue, 23 Feb 2010 18:04:14 +0000 Subject: [PATCH] gas/ * config/tc-arm.c (do_rd_rm_rn): Added warning. gas/testsuite/ * gas/arm/depr-swp.d: New test case. * gas/arm/depr-swp.s: New file. * gas/arm/depr-swp.l: New file. --- gas/ChangeLog | 5 +++++ gas/config/tc-arm.c | 12 ++++++++++-- gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/arm/depr-swp.d | 3 +++ gas/testsuite/gas/arm/depr-swp.l | 3 +++ gas/testsuite/gas/arm/depr-swp.s | 7 +++++++ 6 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 gas/testsuite/gas/arm/depr-swp.d create mode 100644 gas/testsuite/gas/arm/depr-swp.l create mode 100644 gas/testsuite/gas/arm/depr-swp.s diff --git a/gas/ChangeLog b/gas/ChangeLog index a2807f6d1e2..f35eb3abc8a 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2010-02-23 Daniel Gutson + + * config/tc-arm.c (do_rd_rm_rn): Added warning + for obsolete insns. + 2010-02-23 Andrew Zabolotny PR binutils/11297 diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index b3096c5d73f..7ef0f44bc98 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -6970,8 +6970,16 @@ do_rd_rm_rn (void) unsigned Rn = inst.operands[2].reg; /* Enforce restrictions on SWP instruction. */ if ((inst.instruction & 0x0fbfffff) == 0x01000090) - constraint (Rn == inst.operands[0].reg || Rn == inst.operands[1].reg, - _("Rn must not overlap other operands")); + { + 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")); + + } inst.instruction |= inst.operands[0].reg << 12; inst.instruction |= inst.operands[1].reg; inst.instruction |= Rn << 16; diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 301eea3fef5..7a9b5386b25 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2010-02-23 Daniel Gutson + + * gas/arm/depr-swp.d: New test case. + * gas/arm/depr-swp.s: New file. + * gas/arm/depr-swp.l: New file. + 2010-02-23 Nick Clifton * gas/arm/thumb2_bcond.d: Allow for varying number of nops at the diff --git a/gas/testsuite/gas/arm/depr-swp.d b/gas/testsuite/gas/arm/depr-swp.d new file mode 100644 index 00000000000..40add70a841 --- /dev/null +++ b/gas/testsuite/gas/arm/depr-swp.d @@ -0,0 +1,3 @@ +#name: Deprecated swp{b} instructions +#source: depr-swp.s +#error-output: depr-swp.l diff --git a/gas/testsuite/gas/arm/depr-swp.l b/gas/testsuite/gas/arm/depr-swp.l new file mode 100644 index 00000000000..e5052a7f10c --- /dev/null +++ b/gas/testsuite/gas/arm/depr-swp.l @@ -0,0 +1,3 @@ +[^:]*: Assembler messages: +[^:]*:5: Warning: swp{b} use is deprecated for this architecture +[^:]*:7: Warning: swp{b} use is deprecated for this architecture diff --git a/gas/testsuite/gas/arm/depr-swp.s b/gas/testsuite/gas/arm/depr-swp.s new file mode 100644 index 00000000000..e5c1df32271 --- /dev/null +++ b/gas/testsuite/gas/arm/depr-swp.s @@ -0,0 +1,7 @@ +.syntax unified +.arch armv4 +swp r0, r1, [r2] +.arch armv6 +swp r0, r1, [r2] +.arch armv7-a +swp r0, r1, [r2] -- 2.30.2