aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-arm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-09-09 09:09:43 +0000
committerNick Clifton <nickc@redhat.com>2010-09-09 09:09:43 +0000
commit40f246e36c27a521661a926536e1cfceb18cd957 (patch)
tree581f4529d737f6663f0555f25416db98717e513d /gas/config/tc-arm.c
parent95b75c0115a8dfef2afcefd3db9f191383b7376f (diff)
downloadgdb-40f246e36c27a521661a926536e1cfceb18cd957.zip
gdb-40f246e36c27a521661a926536e1cfceb18cd957.tar.gz
gdb-40f246e36c27a521661a926536e1cfceb18cd957.tar.bz2
* config/tc-arm.c (md_apply_fix): Check if widened add, sub are
flag-setting and handle accordingly. * gas/arm/addsw-bad.s: New file. * gas/arm/addsw-bad.l: New file. * gas/arm/addsw-bad.d: New file.
Diffstat (limited to 'gas/config/tc-arm.c')
-rw-r--r--gas/config/tc-arm.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index ce32aef..50df78a 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -20252,17 +20252,20 @@ md_apply_fix (fixS * fixP,
/* Turn add/sum into addw/subw. */
if (fixP->fx_r_type == BFD_RELOC_ARM_T32_ADD_IMM)
newval = (newval & 0xfeffffff) | 0x02000000;
-
- /* 12 bit immediate for addw/subw. */
- if (value < 0)
+ /* No flat 12-bit imm encoding for addsw/subsw. */
+ if ((newval & 0x00100000) == 0)
{
- value = -value;
- newval ^= 0x00a00000;
+ /* 12 bit immediate for addw/subw. */
+ if (value < 0)
+ {
+ value = -value;
+ newval ^= 0x00a00000;
+ }
+ if (value > 0xfff)
+ newimm = (unsigned int) FAIL;
+ else
+ newimm = value;
}
- if (value > 0xfff)
- newimm = (unsigned int) FAIL;
- else
- newimm = value;
}
if (newimm == (unsigned int)FAIL)