diff options
author | Alex Coplan <alex.coplan@arm.com> | 2020-04-30 15:47:30 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-04-30 15:47:30 +0100 |
commit | 09c1e68a162f9a2c2cadee916387a147a8af44b7 (patch) | |
tree | a0c677f1aa242b8e99f55a6c9856e24043e8de23 /gas | |
parent | 8a8a1171237d45e20b2ebb18ee2d3f8686e01b82 (diff) | |
download | fsf-binutils-gdb-09c1e68a162f9a2c2cadee916387a147a8af44b7.zip fsf-binutils-gdb-09c1e68a162f9a2c2cadee916387a147a8af44b7.tar.gz fsf-binutils-gdb-09c1e68a162f9a2c2cadee916387a147a8af44b7.tar.bz2 |
AArch64: add GAS support for UDF instruction
binutils * testsuite/binutils-all/aarch64/in-order-all.d: Update to use new
disassembly.
* testsuite/binutils-all/aarch64/out-of-order-all.d: Likewise.
ld/ * testsuite/ld-aarch64/erratum843419_tls_ie.d: Use udf in disassembly.
* testsuite/ld-aarch64/farcall-b-section.d: Likewise.
* testsuite/ld-aarch64/farcall-back.d: Likewise.
* testsuite/ld-aarch64/farcall-bl-section.d: Likewise.
gas/ * config/tc-aarch64.c (fix_insn): Implement for AARCH64_OPND_UNDEFINED.
(parse_operands): Implement for AARCH64_OPND_UNDEFINED.
* testsuite/gas/aarch64/udf.s: New.
* testsuite/gas/aarch64/udf.d: New.
* testsuite/gas/aarch64/udf-invalid.s: New.
* testsuite/gas/aarch64/udf-invalid.l: New.
* testsuite/gas/aarch64/udf-invalid.d: New.
include * opcode/aarch64.h (enum aarch64_opnd): Add AARCH64_OPND_UNDEFINED.
opcodes * aarch64-opc.h (enum aarch64_field_kind): Add FLD_imm16_2.
* aarch64-opc.c (fields): Add entry for FLD_imm16_2.
(operand_general_constraint_met_p): validate AARCH64_OPND_UNDEFINED.
* aarch64-tbl.h (aarch64_opcode_table): Add udf instruction, entry for
FLD_imm16_2.
* aarch64-asm-2.c: Regenerated.
* aarch64-dis-2.c: Regenerated.
* aarch64-opc-2.c: Regenerated.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 11 | ||||
-rw-r--r-- | gas/config/tc-aarch64.c | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/udf-invalid.d | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/udf-invalid.l | 4 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/udf-invalid.s | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/udf.d | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/aarch64/udf.s | 5 |
7 files changed, 41 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 70c93c3..1b973f5 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,14 @@ +2020-04-30 Alex Coplan <alex.coplan@arm.com> + + * config/tc-aarch64.c (fix_insn): Implement for + AARCH64_OPND_UNDEFINED. + (parse_operands): Implement for AARCH64_OPND_UNDEFINED. + * testsuite/gas/aarch64/udf.s: New. + * testsuite/gas/aarch64/udf.d: New. + * testsuite/gas/aarch64/udf-invalid.s: New. + * testsuite/gas/aarch64/udf-invalid.l: New. + * testsuite/gas/aarch64/udf-invalid.d: New. + 2020-04-30 Yoshinori Sato <ysato@users.sourceforge.jp> * config/tc-rx.c (elf_flags): Reset default value. diff --git a/gas/config/tc-aarch64.c b/gas/config/tc-aarch64.c index 69ccc59..da786ba 100644 --- a/gas/config/tc-aarch64.c +++ b/gas/config/tc-aarch64.c @@ -6149,6 +6149,7 @@ parse_operands (char *str, const aarch64_opcode *opcode) break; case AARCH64_OPND_EXCEPTION: + case AARCH64_OPND_UNDEFINED: po_misc_or_fail (parse_immediate_expression (&str, &inst.reloc.exp, imm_reg_type)); assign_imm_if_const_or_fixup_later (&inst.reloc, info, @@ -7745,11 +7746,12 @@ fix_insn (fixS *fixP, uint32_t flags, offsetT value) switch (opnd) { case AARCH64_OPND_EXCEPTION: + case AARCH64_OPND_UNDEFINED: if (unsigned_overflow (value, 16)) as_bad_where (fixP->fx_file, fixP->fx_line, _("immediate out of range")); insn = get_aarch64_insn (buf); - insn |= encode_svc_imm (value); + insn |= (opnd == AARCH64_OPND_EXCEPTION) ? encode_svc_imm (value) : value; put_aarch64_insn (buf, insn); break; diff --git a/gas/testsuite/gas/aarch64/udf-invalid.d b/gas/testsuite/gas/aarch64/udf-invalid.d new file mode 100644 index 0000000..bdb768d --- /dev/null +++ b/gas/testsuite/gas/aarch64/udf-invalid.d @@ -0,0 +1,3 @@ +#name: invalid udf instructions +#source: udf-invalid.s +#error_output: udf-invalid.l diff --git a/gas/testsuite/gas/aarch64/udf-invalid.l b/gas/testsuite/gas/aarch64/udf-invalid.l new file mode 100644 index 0000000..71a0791 --- /dev/null +++ b/gas/testsuite/gas/aarch64/udf-invalid.l @@ -0,0 +1,4 @@ +[^:]*: Assembler messages: +.*: Error: immediate value out of range 0 to 65535 at operand 1 -- `udf #65536' +.*: Error: immediate value out of range 0 to 65535 at operand 1 -- `udf 0xeffff' +.*: Error: immediate value out of range 0 to 65535 at operand 1 -- `udf -1' diff --git a/gas/testsuite/gas/aarch64/udf-invalid.s b/gas/testsuite/gas/aarch64/udf-invalid.s new file mode 100644 index 0000000..937126f --- /dev/null +++ b/gas/testsuite/gas/aarch64/udf-invalid.s @@ -0,0 +1,6 @@ +// Instructions in this file are invalid. +// See udf.s for valid instructions. +.text +udf #65536 +udf 0xeffff +udf -1 diff --git a/gas/testsuite/gas/aarch64/udf.d b/gas/testsuite/gas/aarch64/udf.d new file mode 100644 index 0000000..ae6432b --- /dev/null +++ b/gas/testsuite/gas/aarch64/udf.d @@ -0,0 +1,9 @@ +#objdump: -dr + +.*: file format .* + +Disassembly of section \.text: + +0+ <.*>: +.*: 0000002a udf #42 +.*: 0000ffff udf #65535 diff --git a/gas/testsuite/gas/aarch64/udf.s b/gas/testsuite/gas/aarch64/udf.s new file mode 100644 index 0000000..fec30a3 --- /dev/null +++ b/gas/testsuite/gas/aarch64/udf.s @@ -0,0 +1,5 @@ +// Test file for AArch64 udf. + +.text +udf #42 +udf #65535 |