diff options
author | Michael Eager <eager@eagercon.com> | 2012-11-14 17:05:24 +0000 |
---|---|---|
committer | Michael Eager <eager@eagercon.com> | 2012-11-14 17:05:24 +0000 |
commit | d3da77419a529a0af2c3e5109bebed65752bc52f (patch) | |
tree | f243496979f4234e3783a6c5215a8cb3f0660e93 /gas | |
parent | ed8ec0ec784e7e2fd114f4a14e2751add8942c9c (diff) | |
download | gdb-d3da77419a529a0af2c3e5109bebed65752bc52f.zip gdb-d3da77419a529a0af2c3e5109bebed65752bc52f.tar.gz gdb-d3da77419a529a0af2c3e5109bebed65752bc52f.tar.bz2 |
opcodes/
* microblaze-opc.h: Define new instruction type INST_TYPE_IMM5,
update OPCODE_MASK_H13S, add OPCODE_MASK_HN, define MIN_IMM5 / MAX_IMM5,
and increase MAX_OPCODES.
(op_code_struct): add mbar and sleep
* microblaze-opcm.h (microblaze_instr): add mbar
Define IMM_MBAR and IMM5_MBAR_MASK
* microblaze-dis.c: Add get_field_imm5_mbar
(print_insn_microblaze): Add support for INST_TYPE_IMM5 and INST_TYPE_NONE
gas/
* config/tc-microblaze.c (md_assemble): Add support for INST_TYPE_IMM5
gas/testsuite/
* gas/microblaze/allinsn.s: Add mbar and sleep
* gas/microblaze/allinsn.d: Likewise
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 4 | ||||
-rw-r--r-- | gas/config/tc-microblaze.c | 18 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gas/testsuite/gas/microblaze/allinsn.d | 6 | ||||
-rw-r--r-- | gas/testsuite/gas/microblaze/allinsn.s | 8 |
5 files changed, 42 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index a3a33d8..f1e6207 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,7 @@ +2012-11-14 David Holsgrove <david.holsgrove@xilinx.com> + + * config/tc-microblaze.c (md_assemble): Add support for INST_TYPE_IMM5 + 2012-11-14 Ulrich Weigand <uweigand@de.ibm.com> * config/tc-ppc.c (md_apply_fix): Leave field zero when emitting diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c index 04dfa1e..b71383b 100644 --- a/gas/config/tc-microblaze.c +++ b/gas/config/tc-microblaze.c @@ -1605,6 +1605,24 @@ md_assemble (char * str) output = frag_more (isize); break; + case INST_TYPE_IMM5: + if (strcmp(op_end, "")) + op_end = parse_imm (op_end + 1, & exp, MIN_IMM5, MAX_IMM5); + else + as_fatal(_("Error in statement syntax")); + if (exp.X_op != O_constant) { + as_warn(_("Symbol used as immediate for mbar instruction")); + } else { + output = frag_more (isize); + immed = exp.X_add_number; + } + if (immed != (immed % 32)) { + as_warn(_("Immediate value for mbar > 32. using <value %% 32>")); + immed = immed % 32; + } + inst |= (immed << IMM_MBAR); + break; + default: as_fatal (_("unimplemented opcode \"%s\""), name); } diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index c2a66c8..51405aa 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,4 +1,9 @@ -2012-11-08 David Holsgrove <david.holsgrove@xilinx.com> +2012-11-14 David Holsgrove <david.holsgrove@xilinx.com> + + * gas/microblaze/allinsn.s: Add mbar and sleep + * gas/microblaze/allinsn.d: Likewise + +2012-11-14 David Holsgrove <david.holsgrove@xilinx.com> * gas/microblaze/allinsn.s: Add clz insn * gas/microblaze/allinsn.d: Likewise diff --git a/gas/testsuite/gas/microblaze/allinsn.d b/gas/testsuite/gas/microblaze/allinsn.d index c7854f1..ec14020 100644 --- a/gas/testsuite/gas/microblaze/allinsn.d +++ b/gas/testsuite/gas/microblaze/allinsn.d @@ -25,3 +25,9 @@ Disassembly of section .text: 00000018 <clz>: 18: 900000e0 clz r0, r0 + +0000001c <mbar>: + 1c: b8420004 mbar 2 + +00000020 <sleep>: + 20: ba020004 sleep diff --git a/gas/testsuite/gas/microblaze/allinsn.s b/gas/testsuite/gas/microblaze/allinsn.s index 0e4271d..582da17 100644 --- a/gas/testsuite/gas/microblaze/allinsn.s +++ b/gas/testsuite/gas/microblaze/allinsn.s @@ -28,4 +28,12 @@ swr: .global clz clz: clz r0,r0 + .text + .global mbar +mbar: + mbar 2 + .text + .global sleep +sleep: + sleep |