[AArch64][SVE 12/32] Remove boolean parameters from parse_address_main
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 21 Sep 2016 15:49:31 +0000 (16:49 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 21 Sep 2016 15:49:31 +0000 (16:49 +0100)
commit73866052f244927457202e4b0d1542bea529878f
tree0f505bedda2de518422b06a8abe1589746398e85
parente1b988bba630c09564248ebb78cf29c70f2d04db
[AArch64][SVE 12/32] Remove boolean parameters from parse_address_main

In the review of the original version of this series, Richard didn't
like the use of boolean parameters to parse_address_main.  I think we
can just get rid of them and leave the callers to check the addressing
modes.  As it happens, the handling of ADDR_SIMM9{,_2} already did this
for relocation operators (i.e. it used parse_address_reloc and then
rejected relocations).

The callers are already set up to reject invalid register post-indexed
addressing, so we can simply remove the accept_reg_post_index parameter
without adding any more checks.  This again creates a corner case where:

.equ x2, 1
ldr w0, [x1], x2

was previously an acceptable way of writing "ldr w0, [x1], #1" but
is now rejected.

Removing the "reloc" parameter means that two cases need to check
explicitly for relocation operators.

ADDR_SIMM9_2 appers to be unused.  I'll send a separate patch
to remove it.

This patch makes parse_address temporarily equivalent to
parse_address_main, but later patches in the series will need
to keep the distinction.

gas/
* config/tc-aarch64.c (parse_address_main): Remove reloc and
accept_reg_post_index parameters.  Parse relocations and register
post indexes unconditionally.
(parse_address): Remove accept_reg_post_index parameter.
Update call to parse_address_main.
(parse_address_reloc): Delete.
(parse_operands): Call parse_address instead of parse_address_main.
Update existing callers of parse_address and make them check
inst.reloc.type where appropriate.
* testsuite/gas/aarch64/diagnostic.s: Add tests for relocations
in ADDR_SIMPLE, SIMD_ADDR_SIMPLE, ADDR_SIMM7 and ADDR_SIMM9 addresses.
Also test for invalid uses of post-index register addressing.
* testsuite/gas/aarch64/diagnostic.l: Update accordingly.
gas/ChangeLog
gas/config/tc-aarch64.c
gas/testsuite/gas/aarch64/diagnostic.l
gas/testsuite/gas/aarch64/diagnostic.s
This page took 0.029987 seconds and 4 git commands to generate.