aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-aarch64.c
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2018-05-10 16:24:58 +0100
committerTamar Christina <tamar.christina@arm.com>2018-05-10 16:43:28 +0100
commit6688183925d82d4049931e95bc4e963ab66e770d (patch)
tree21c93647ee8709a0fe97dea475307e6cd5891bb2 /gas/config/tc-aarch64.c
parent58ed5c38f52511e73c9748b86c319320177fb0ca (diff)
downloadgdb-6688183925d82d4049931e95bc4e963ab66e770d.zip
gdb-6688183925d82d4049931e95bc4e963ab66e770d.tar.gz
gdb-6688183925d82d4049931e95bc4e963ab66e770d.tar.bz2
Allow integer immediates for AArch64 fmov instructions.
This patch makes it possible to use an integer immediate with the fmov instructions allowing you to simply write fmov d0, #2 instead of needing fmov d0, #2.0. The parse double function already know to deal with this so we just need to list the restriction put in place in parser. The is considered a QoL improvement for hand assembly writers and allows more code portability between assembler. gas/ * config/tc-aarch64.c (parse_aarch64_imm_float): Remove restrictions. * testsuite/gas/aarch64/diagnostic.s: Move fmov int test to.. * testsuite/gas/aarch64/fpmov.s: Here. * testsuite/gas/aarch64/fpmov.d: Update results with fmov. * testsuite/gas/aarch64/diagnostic.l: Remove fmov values. * testsuite/gas/aarch64/sve-invalid.s: Update test files. * testsuite/gas/aarch64/sve-invalid.l: Likewise
Diffstat (limited to 'gas/config/tc-aarch64.c')
-rw-r--r--gas/config/tc-aarch64.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c
index 02c92e3..e673e12 100644
--- a/gas/config/tc-aarch64.c
+++ b/gas/config/tc-aarch64.c
@@ -2279,7 +2279,6 @@ parse_aarch64_imm_float (char **ccp, int *immed, bfd_boolean dp_p,
char *str = *ccp;
char *fpnum;
LITTLENUM_TYPE words[MAX_LITTLENUMS];
- int found_fpchar = 0;
int64_t val = 0;
unsigned fpword = 0;
bfd_boolean hex_p = FALSE;
@@ -2309,26 +2308,10 @@ parse_aarch64_imm_float (char **ccp, int *immed, bfd_boolean dp_p,
hex_p = TRUE;
}
- else
- {
- if (reg_name_p (str, reg_type))
- {
- set_recoverable_error (_("immediate operand required"));
- return FALSE;
- }
-
- /* We must not accidentally parse an integer as a floating-point number.
- Make sure that the value we parse is not an integer by checking for
- special characters '.' or 'e'. */
- for (; *fpnum != '\0' && *fpnum != ' ' && *fpnum != '\n'; fpnum++)
- if (*fpnum == '.' || *fpnum == 'e' || *fpnum == 'E')
- {
- found_fpchar = 1;
- break;
- }
-
- if (!found_fpchar)
- return FALSE;
+ else if (reg_name_p (str, reg_type))
+ {
+ set_recoverable_error (_("immediate operand required"));
+ return FALSE;
}
if (! hex_p)