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.
+2010-09-09 Tejas Belagod <tejas.belagod@arm.com>
+
+ * config/tc-arm.c (md_apply_fix): Check if widened add, sub are
+ flag-setting and handle accordingly.
+
2010-09-09 Nick Clifton <nickc@redhat.com>
PR gas/11972
/* 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)
+2010-09-09 Tejas Belagod <tejas.belagod@arm.com>
+
+ * gas/arm/addsw-bad.s: New file.
+ * gas/arm/addsw-bad.l: New file.
+ * gas/arm/addsw-bad.d: New file.
+
2010-09-03 H.J. Lu <hongjiu.lu@intel.com>
PR gas/11974
--- /dev/null
+#name: Invalid Immediate field for flag-setting add,sub
+#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd
+#error-output: addsw-bad.l
--- /dev/null
+[^:]*: Assembler messages:
+[^:]*:5: Error: invalid constant \(496\) after fixup
+[^:]*:6: Error: invalid constant \(496\) after fixup
--- /dev/null
+.text
+.thumb
+.cpu cortex-a8
+.syntax unified
+subs r4, r6, #0x496
+adds r4, r6, #0x496