]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[AArch64][SVE 09/32] Improve error messages for invalid floats
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 11 Aug 2016 14:38:07 +0000 (15:38 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Tue, 23 Aug 2016 08:41:02 +0000 (09:41 +0100)
commit2167a76c677996c912bacef24d17fdb905856a3f
tree417cdb0c617f0fdc556cfff81654978155a0c729
parenta32fde0f901df61bfa478eea21471788380c8091
[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.

Change-Id: Iac44324b848a7a12d35c4fa4ec26931951b05e66
gas/config/tc-aarch64.c
gas/testsuite/gas/aarch64/diagnostic.l
gas/testsuite/gas/aarch64/diagnostic.s