[AArch64][SVE 09/32] Improve error messages for invalid floats
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 21 Sep 2016 15:49:07 +0000 (16:49 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 21 Sep 2016 15:49:07 +0000 (16:49 +0100)
commit6a9deabec4faf3160a527d11ab5d6997dec7d66a
treed70086fadec4a964f5e85dc20f174af425fd0e57
parent04a3379aceaeb8e29f2586d756d5f2ef26c85e7e
[AArch64][SVE 09/32] Improve error messages for invalid floats

Previously:

        fmov d0, #2

would give an error:

        Operand 2 should be an integer register

whereas the user probably just forgot to add the ".0" to make:

        fmov d0, #2.0

This patch reports an invalid floating point constant unless the
operand is obviously a register.

The FPIMM8 handling is only relevant for SVE.  Without it:

        fmov z0, z1

would try to parse z1 as an integer immediate zero (the res2 path),
whereas it's more likely that the user forgot the predicate.  This is
tested by the final patch.

gas/
* config/tc-aarch64.c (parse_aarch64_imm_float): Report a specific
low-severity error for registers.
(parse_operands): Report an invalid floating point constant for
if parsing an FPIMM8 fails, and if no better error has been
recorded.
* testsuite/gas/aarch64/diagnostic.s,
testsuite/gas/aarch64/diagnostic.l: Add tests for integer operands
to FMOV.
gas/ChangeLog
gas/config/tc-aarch64.c
gas/testsuite/gas/aarch64/diagnostic.l
gas/testsuite/gas/aarch64/diagnostic.s
This page took 0.036788 seconds and 4 git commands to generate.