diff options
author | Mark Mitchell <mark@codesourcery.com> | 2009-02-24 04:30:30 +0000 |
---|---|---|
committer | Mark Mitchell <mark@codesourcery.com> | 2009-02-24 04:30:30 +0000 |
commit | 9420679091f2b8ff96f05f4c00ccb30008fb131a (patch) | |
tree | babda51cb60f112b00fbf7a065f33176216c5d35 /gas/config/tc-arm.c | |
parent | 44cf688354f13b101e4cf5d03a1ee0eb1c5e8c58 (diff) | |
download | gdb-9420679091f2b8ff96f05f4c00ccb30008fb131a.zip gdb-9420679091f2b8ff96f05f4c00ccb30008fb131a.tar.gz gdb-9420679091f2b8ff96f05f4c00ccb30008fb131a.tar.bz2 |
* config/tc-arm.c (warn_deprecated_sp): New macro.
(do_t_mov_cmp): Permit R13 as the second
argument to "cmp.n".
* gas/arm/thumb2_bad_reg.s: Update to allow R13 as second argument
for CMP.
* gas/arm/thumb2_bad_reg.l: Adjust accordingly.
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r-- | gas/config/tc-arm.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 782d10b..a1e5d12 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -6140,6 +6140,14 @@ parse_operands (char *str, const unsigned char *pattern) } \ while (0) +/* If REG is R13 (the stack pointer), warn that its use is + deprecated. */ +#define warn_deprecated_sp(reg) \ + do \ + if (warn_on_deprecated && reg == REG_SP) \ + as_warn (_("use of r13 is deprecated")); \ + while (0) + /* Functions for operand encoding. ARM, then Thumb. */ #define rotate_left(v, n) (v << n | v >> (32 - n)) @@ -9690,7 +9698,18 @@ do_t_mov_cmp (void) if (opcode == T_MNEM_cmp) { constraint (Rn == REG_PC, BAD_PC); - reject_bad_reg (Rm); + if (narrow) + { + /* In the Thumb-2 ISA, use of R13 as Rm is deprecated, + but valid. */ + warn_deprecated_sp (Rm); + /* R15 was documented as a valid choice for Rm in ARMv6, + but as UNPREDICTABLE in ARMv7. ARM's proprietary + tools reject R15, so we do too. */ + constraint (Rm == REG_PC, BAD_PC); + } + else + reject_bad_reg (Rm); } else if (opcode == T_MNEM_mov || opcode == T_MNEM_movs) |