From 9daf7bab4f17d991098169b448e30d575c87b36d Mon Sep 17 00:00:00 2001 From: Sandra Loosemore Date: Mon, 10 Jun 2013 01:04:42 +0000 Subject: [PATCH] 2013-06-09 Sandra Loosemore opcodes/ * nios2-opc.c (nios2_builtin_opcodes): Give "trap" a type-"b" argument. gas/ * config/tc-nios2.c (nios2_parse_args): Allow trap argument to omitted. gas/testsuite/ * gas/nios2/trap.s: Add additional test cases for optional argument. * gas/nios2/trap.d: Likewise. --- gas/ChangeLog | 5 +++++ gas/config/tc-nios2.c | 6 +++++- gas/testsuite/ChangeLog | 6 ++++++ gas/testsuite/gas/nios2/trap.d | 5 ++++- gas/testsuite/gas/nios2/trap.s | 5 ++++- opcodes/ChangeLog | 5 +++++ opcodes/nios2-opc.c | 2 +- 7 files changed, 30 insertions(+), 4 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 5e7964dd204..6c2d60faf33 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2013-06-09 Sandra Loosemore + + * config/tc-nios2.c (nios2_parse_args): Allow trap argument to + omitted. + 2013-06-08 Catherine Moore * config/tc-mips.c (is_opcode_valid): Build ASE mask. diff --git a/gas/config/tc-nios2.c b/gas/config/tc-nios2.c index 9f303e76083..6c91fbe6b73 100644 --- a/gas/config/tc-nios2.c +++ b/gas/config/tc-nios2.c @@ -2078,7 +2078,11 @@ nios2_parse_args (nios2_insn_infoS *insn, char *argstr, parsed_args[i] = NULL; - if (*parsestr != '\0' && insn->insn_nios2_opcode->match != OP_MATCH_BREAK) + /* The argument to break and trap instructions is optional; complain + for other cases of missing arguments. */ + if (*parsestr != '\0' + && insn->insn_nios2_opcode->match != OP_MATCH_BREAK + && insn->insn_nios2_opcode->match != OP_MATCH_TRAP) as_bad (_("missing argument")); } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index c572d9c551d..72a20ec12f4 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2013-06-09 Sandra Loosemore + + * gas/nios2/trap.s: Add additional test cases for optional + argument. + * gas/nios2/trap.d: Likewise. + 2013-05-31 H.J. Lu * gas/i386/size-3.d: Updated for text/data/bss section alignment diff --git a/gas/testsuite/gas/nios2/trap.d b/gas/testsuite/gas/nios2/trap.d index d9d07f179f8..0712d86ea04 100644 --- a/gas/testsuite/gas/nios2/trap.d +++ b/gas/testsuite/gas/nios2/trap.d @@ -4,4 +4,7 @@ .*: +file format elf32-littlenios2 Disassembly of section .text: -0+0000 <[^>]*> 003b683a trap +0+0000 <[^>]*> 003b683a trap 0 +0+0004 <[^>]*> 003b683a trap 0 +0+0008 <[^>]*> 003b6ffa trap 31 +0+000c <[^>]*> 003b6bba trap 14 diff --git a/gas/testsuite/gas/nios2/trap.s b/gas/testsuite/gas/nios2/trap.s index 1eb3c7e890d..df260fa1231 100644 --- a/gas/testsuite/gas/nios2/trap.s +++ b/gas/testsuite/gas/nios2/trap.s @@ -1,3 +1,6 @@ -# Source file used to test the ret instructions +# Source file used to test the trap instructions foo: trap + trap 0 + trap 31 + trap 14 diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 35ce609b25d..2f053850bde 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2013-06-09 Sandra Loosemore + + * nios2-opc.c (nios2_builtin_opcodes): Give "trap" a type-"b" + argument. + 2013-06-08 Catherine Moore Richard Sandiford diff --git a/opcodes/nios2-opc.c b/opcodes/nios2-opc.c index b2734bd91ef..83cf1898aff 100644 --- a/opcodes/nios2-opc.c +++ b/opcodes/nios2-opc.c @@ -385,7 +385,7 @@ const struct nios2_opcode nios2_builtin_opcodes[] = OP_MATCH_SUB, OP_MASK_ROPX | OP_MASK_ROP, 0, no_overflow}, {"sync", "", "E", 0, OP_MATCH_SYNC, OP_MASK_SYNC, 0, no_overflow}, - {"trap", "", "E", 0, + {"trap", "b", "b,E", 1, OP_MATCH_TRAP, OP_MASK_TRAP, 0, no_overflow}, {"eret", "", "E", 0, OP_MATCH_ERET, OP_MASK, 0, no_overflow}, -- 2.30.2