diff options
author | Matthew Gretton-Dann <matthew.gretton-dann@arm.com> | 2010-06-28 09:10:25 +0000 |
---|---|---|
committer | Matthew Gretton-Dann <matthew.gretton-dann@arm.com> | 2010-06-28 09:10:25 +0000 |
commit | 8e56076649ea3bc861ad1f5ddad9fd931293af10 (patch) | |
tree | 3c1a88726835e19814e772b93e1c910c97d8bbee /gas/config | |
parent | fc63f3ec4e4bae44c92ad1477c53453579dbc743 (diff) | |
download | gdb-8e56076649ea3bc861ad1f5ddad9fd931293af10.zip gdb-8e56076649ea3bc861ad1f5ddad9fd931293af10.tar.gz gdb-8e56076649ea3bc861ad1f5ddad9fd931293af10.tar.bz2 |
* gas/config/tc-arm.c (parse_neon_alignment): New function.
(parse_address_main): Fix Neon load/store alignment parsing.
* gas/testsuite/gas/arm/neon-ldst-align-bad.l: Update for Neon alignment syntax fix.
* gas/testsuite/gas/arm/neon-ldst-align-bad.s: Likewise.
* gas/testsuite/gas/arm/neon-ldst-es.d: Likewise.
* gas/testsuite/gas/arm/neon-ldst-es.s: Likewise.
* opcodes/arm-disc.c (parse_insn_neon): Fix Neon alignment syntax.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-arm.c | 61 |
1 files changed, 45 insertions, 16 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 2e4880a..0a713d4 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -4948,6 +4948,33 @@ parse_shifter_operand_group_reloc (char **str, int i) /* Never reached. */ } +/* Parse a Neon alignment expression. Information is written to + inst.operands[i]. We assume the initial ':' has been skipped. + + align .imm = align << 8, .immisalign=1, .preind=0 */ +static parse_operand_result +parse_neon_alignment (char **str, int i) +{ + char *p = *str; + expressionS exp; + + my_get_expression (&exp, &p, GE_NO_PREFIX); + + if (exp.X_op != O_constant) + { + inst.error = _("alignment must be constant"); + return PARSE_OPERAND_FAIL; + } + + inst.operands[i].imm = exp.X_add_number << 8; + inst.operands[i].immisalign = 1; + /* Alignments are not pre-indexes. */ + inst.operands[i].preind = 0; + + *str = p; + return PARSE_OPERAND_SUCCESS; +} + /* Parse all forms of an ARM address expression. Information is written to inst.operands[i] and/or inst.reloc. @@ -5031,22 +5058,15 @@ parse_address_main (char **str, int i, int group_relocations, return PARSE_OPERAND_FAIL; } else if (skip_past_char (&p, ':') == SUCCESS) - { - /* FIXME: '@' should be used here, but it's filtered out by generic - code before we get to see it here. This may be subject to - change. */ - expressionS exp; - my_get_expression (&exp, &p, GE_NO_PREFIX); - if (exp.X_op != O_constant) - { - inst.error = _("alignment must be constant"); - return PARSE_OPERAND_FAIL; - } - inst.operands[i].imm = exp.X_add_number << 8; - inst.operands[i].immisalign = 1; - /* Alignments are not pre-indexes. */ - inst.operands[i].preind = 0; - } + { + /* FIXME: '@' should be used here, but it's filtered out by generic + code before we get to see it here. This may be subject to + change. */ + parse_operand_result result = parse_neon_alignment (&p, i); + + if (result != PARSE_OPERAND_SUCCESS) + return result; + } else { if (inst.operands[i].negative) @@ -5110,6 +5130,15 @@ parse_address_main (char **str, int i, int group_relocations, return PARSE_OPERAND_FAIL; } } + else if (skip_past_char (&p, ':') == SUCCESS) + { + /* FIXME: '@' should be used here, but it's filtered out by generic code + before we get to see it here. This may be subject to change. */ + parse_operand_result result = parse_neon_alignment (&p, i); + + if (result != PARSE_OPERAND_SUCCESS) + return result; + } if (skip_past_char (&p, ']') == FAIL) { |