diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2011-06-29 20:42:48 +0000 |
---|---|---|
committer | Richard Sandiford <rdsandiford@googlemail.com> | 2011-06-29 20:42:48 +0000 |
commit | ceb94aa50d68ec7393fac7e2b239aff8ec656f85 (patch) | |
tree | a7a6d2fba69b070303f5ee57ab319e87c4ff174d /gas | |
parent | 4c26037942d435934e3523a6979bff47cae4ef81 (diff) | |
download | gdb-ceb94aa50d68ec7393fac7e2b239aff8ec656f85.zip gdb-ceb94aa50d68ec7393fac7e2b239aff8ec656f85.tar.gz gdb-ceb94aa50d68ec7393fac7e2b239aff8ec656f85.tar.bz2 |
gas/
* config/tc-mips.c (find_altered_mips16_opcode): New function.
(append_insn): Use it.
opcodes/
* mips16-opc.c (jalrc, jrc): Move earlier in file.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 5 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index a2ddcda..40f5622 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,10 @@ 2011-06-29 Richard Sandiford <rdsandiford@googlemail.com> + * config/tc-mips.c (find_altered_mips16_opcode): New function. + (append_insn): Use it. + +2011-06-29 Richard Sandiford <rdsandiford@googlemail.com> + * config/tc-mips.c (insn_uses_reg): Delete. (gpr_read_mask, gpr_write_mask): New functions. (fpr_read_mask, fpr_write_mask): Likewise. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 345d6d0..d8da3d7 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -3073,6 +3073,24 @@ fix_loongson2f (struct mips_cl_insn * ip) fix_loongson2f_jump (ip); } +/* IP is a MIPS16 instruction whose opcode we have just changed. + Point IP->insn_mo to the new opcode's definition. */ + +static void +find_altered_mips16_opcode (struct mips_cl_insn *ip) +{ + const struct mips_opcode *mo, *end; + + end = &mips16_opcodes[bfd_mips16_num_opcodes]; + for (mo = ip->insn_mo; mo < end; mo++) + if ((ip->insn_opcode & mo->mask) == mo->match) + { + ip->insn_mo = mo; + return; + } + abort (); +} + /* Output an instruction. IP is the instruction information. ADDRESS_EXPR is an operand of the instruction to be used with RELOC_TYPE. */ @@ -3545,6 +3563,7 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr, { /* Convert MIPS16 jr/jalr into a "compact" jump. */ ip->insn_opcode |= 0x0080; + find_altered_mips16_opcode (ip); install_insn (ip); insert_into_history (0, 1, ip); } |