From d3da77419a529a0af2c3e5109bebed65752bc52f Mon Sep 17 00:00:00 2001 From: Michael Eager Date: Wed, 14 Nov 2012 17:05:24 +0000 Subject: 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 --- gas/config/tc-microblaze.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gas/config') 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 ")); + immed = immed % 32; + } + inst |= (immed << IMM_MBAR); + break; + default: as_fatal (_("unimplemented opcode \"%s\""), name); } -- cgit v1.1