diff options
author | Thiemo Seufer <ths@networkno.de> | 2006-05-14 15:35:22 +0000 |
---|---|---|
committer | Thiemo Seufer <ths@networkno.de> | 2006-05-14 15:35:22 +0000 |
commit | 9b3f89ee006eb0681730769be5146edc38e6e83f (patch) | |
tree | cab41be6aa13bcfcaf8743141a2986dd400da080 /gas/config | |
parent | 369af7bd63d5dbadaabf44c1f595c6c31c244d2a (diff) | |
download | gdb-9b3f89ee006eb0681730769be5146edc38e6e83f.zip gdb-9b3f89ee006eb0681730769be5146edc38e6e83f.tar.gz gdb-9b3f89ee006eb0681730769be5146edc38e6e83f.tar.bz2 |
[ gas/ChangeLog ]
* config/tc-mips.c (macro_build): Test for currently active
mips16 option.
(mips16_ip): Reject invalid opcodes.
[ opcodes/ChangeLog ]
* mips16-opc.c (I1, I32, I64): New shortcut defines.
(mips16_opcodes): Change membership of instructions to their
lowest baseline ISA.
[ gas/testsuite/ChangeLog ]
* gas/mips/mips.exp: Run new tests.
* gas/mips/mips16e.s, gas/mips/mips16e.d, gas/mips/mips16e-64.s,
gas/mips/mips16e-64.d, gas/mips/mips16e-64.l: New tests.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-mips.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 3108d0a..75c3ae9 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -3015,7 +3015,7 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...) || mo->pinfo == INSN_MACRO || !OPCODE_IS_MEMBER (mo, (mips_opts.isa - | (file_ase_mips16 ? INSN_MIPS16 : 0) + | (mips_opts.mips16 ? INSN_MIPS16 : 0) | (mips_opts.ase_smartmips ? INSN_SMARTMIPS : 0)), mips_opts.arch) || (mips_opts.arch == CPU_R4650 && (mo->pinfo & FP_D) != 0)) @@ -8032,6 +8032,9 @@ mips_ip (char *str, struct mips_cl_insn *ip) if (OPCODE_IS_MEMBER (insn, (mips_opts.isa + /* We don't check for mips_opts.mips16 here since + we want to allow jalx if -mips16 was specified + on the command line. */ | (file_ase_mips16 ? INSN_MIPS16 : 0) | (mips_opts.ase_mdmx ? INSN_MDMX : 0) | (mips_opts.ase_dsp ? INSN_DSP : 0) @@ -9467,8 +9470,38 @@ mips16_ip (char *str, struct mips_cl_insn *ip) argsstart = s; for (;;) { + bfd_boolean ok; + assert (strcmp (insn->name, str) == 0); + if (OPCODE_IS_MEMBER (insn, mips_opts.isa, mips_opts.arch)) + ok = TRUE; + else + ok = FALSE; + + if (! ok) + { + if (insn + 1 < &mips16_opcodes[bfd_mips16_num_opcodes] + && strcmp (insn->name, insn[1].name) == 0) + { + ++insn; + continue; + } + else + { + if (!insn_error) + { + static char buf[100]; + sprintf (buf, + _("opcode not supported on this processor: %s (%s)"), + mips_cpu_info_from_arch (mips_opts.arch)->name, + mips_cpu_info_from_isa (mips_opts.isa)->name); + insn_error = buf; + } + return; + } + } + create_insn (ip, insn); imm_expr.X_op = O_absent; imm_reloc[0] = BFD_RELOC_UNUSED; |