summaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorwillnewton <willnewton>2013-08-23 07:16:56 +0000
committerwillnewton <willnewton>2013-08-23 07:16:56 +0000
commit9fce57aaed76c9a7de8a66c212219f9889681da0 (patch)
tree9e867460cbd3ed8678922de02930be0c7e8a841b /gas/config
parent60f561a936433831199b7fcb23ca85dc934c0f02 (diff)
downloadbinutils-redhat-9fce57aaed76c9a7de8a66c212219f9889681da0.tar.gz
gas/config/tc-arm.c: Improve validation of NEON addressing modes.
NEON vector load and store instructions do not accept immediates or pre-indexed base plus offset addressing modes, so make sure that the assembler enforces this. gas/ChangeLog: 2013-08-23 Will Newton <will.newton@linaro.org> * config/tc-arm.c (do_neon_ldx_stx): Add extra constraints for pre-indexed addressing modes. * testsuite/gas/arm/neon-addressing-bad.l: Add test for VLDn and VSTn instructions. * testsuite/gas/arm/neon-addressing-bad.s: Likewise. gas/testsuite/ChangeLog: 2013-08-23 Will Newton <will.newton@linaro.org> * testsuite/gas/arm/neon-addressing-bad.l: Add test for VLDn and VSTn instructions. * testsuite/gas/arm/neon-addressing-bad.s: Likewise.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-arm.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 21369d7d10..50e0da742b 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -16008,12 +16008,20 @@ do_neon_ldx_stx (void)
_("bad register for post-index"));
inst.instruction |= postreg;
}
- else if (inst.operands[1].writeback)
+ else
{
- inst.instruction |= 0xd;
+ constraint (inst.operands[1].immisreg, BAD_ADDR_MODE);
+ constraint (inst.reloc.exp.X_op != O_constant
+ || inst.reloc.exp.X_add_number != 0,
+ BAD_ADDR_MODE);
+
+ if (inst.operands[1].writeback)
+ {
+ inst.instruction |= 0xd;
+ }
+ else
+ inst.instruction |= 0xf;
}
- else
- inst.instruction |= 0xf;
if (thumb_mode)
inst.instruction |= 0xf9000000;