From: Jeff Law Date: Fri, 11 Jul 1997 16:40:14 +0000 (+0000) Subject: * config/tc-mips.c (macro_build): Refine code to check if an X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=931a1858a690e7e0be7a71c0cfb701aac5a5866b;p=binutils-gdb.git * config/tc-mips.c (macro_build): Refine code to check if an instruction is available on a particular cpu variant. (mips_ip): Likewise. toshiba 5900 stuff --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 8d59d29a58e..2060e9c9ed7 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +Fri Jul 11 10:18:47 1997 Jeffrey A Law (law@cygnus.com) + + * config/tc-mips.c (macro_build): Refine code to check if an + instruction is available on a particular cpu variant. + (mips_ip): Likewise. + Mon Jul 7 22:53:08 1997 Ian Lance Taylor * config/tc-i386.c (tc_i386_fix_adjustable): Change ifndef diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 5e92c7334bf..5a71412c14d 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -2327,6 +2327,7 @@ macro_build (place, counter, ep, name, fmt, va_alist) struct mips_cl_insn insn; bfd_reloc_code_real_type r; va_list args; + int insn_isa; #ifdef USE_STDARG va_start (args, fmt); @@ -2357,32 +2358,50 @@ macro_build (place, counter, ep, name, fmt, va_alist) assert (insn.insn_mo); assert (strcmp (name, insn.insn_mo->name) == 0); - while (strcmp (fmt, insn.insn_mo->args) != 0 - || insn.insn_mo->pinfo == INSN_MACRO - || ((insn.insn_mo->membership & INSN_ISA) == INSN_ISA2 - && mips_opts.isa < 2) - || ((insn.insn_mo->membership & INSN_ISA) == INSN_ISA3 - && mips_opts.isa < 3) - || ((insn.insn_mo->membership & INSN_ISA) == INSN_ISA4 - && mips_opts.isa < 4) - || ((insn.insn_mo->membership & INSN_ISA) == INSN_3900 - && ! mips_3900) - || ((insn.insn_mo->membership & INSN_ISA) == INSN_4650 - && ! mips_4650) - || ((insn.insn_mo->membership & INSN_ISA) == INSN_4010 - && ! mips_4010) - || ((insn.insn_mo->membership & INSN_ISA) == INSN_4100 - && ! mips_4100) - /* start-sanitize-r5900 */ - || ((insn.insn_mo->membership & INSN_ISA) == INSN_5900 - && ! mips_5900) - /* end-sanitize-r5900 */ - ) + + /* Search until we get a match for NAME. */ + while (1) { - ++insn.insn_mo; - assert (insn.insn_mo->name); - assert (strcmp (name, insn.insn_mo->name) == 0); + if (insn.insn_mo->pinfo == INSN_MACRO) + insn_isa = insn.insn_mo->match; + else if ((insn.insn_mo->membership & INSN_ISA) == INSN_ISA1) + insn_isa = 1; + else if ((insn.insn_mo->membership & INSN_ISA) == INSN_ISA2) + insn_isa = 2; + else if ((insn.insn_mo->membership & INSN_ISA) == INSN_ISA3) + insn_isa = 3; + else if ((insn.insn_mo->membership & INSN_ISA) == INSN_ISA4) + insn_isa = 4; + else + insn_isa = 15; + + if (insn_isa > mips_opts.isa + && (insn.insn_mo->pinfo != INSN_MACRO + && ((mips_4650 + && (insn.insn_mo->membership & INSN_4650) != INSN_4650) + || (mips_4650 && (insn.insn_mo->pinfo & FP_D)) + || (mips_4010 + && (insn.insn_mo->membership & INSN_4010) != INSN_4010) + || (mips_4100 + && (insn.insn_mo->membership & INSN_4100) != INSN_4100) + /* start-sanitize-r5900 */ + || (mips_5900 + && (insn.insn_mo->membership & INSN_5900) != INSN_5900) + || (mips_5900 && (insn.insn_mo->pinfo & FP_D)) + /* end-sanitize-r5900 */ + || (mips_3900 + && (insn.insn_mo->membership & INSN_3900) != INSN_3900)))) + { + ++insn.insn_mo; + assert (insn.insn_mo->name); + assert (strcmp (name, insn.insn_mo->name) == 0); + continue; + } + + /* We got a successful match. */ + break; } + insn.insn_opcode = insn.insn_mo->match; for (;;) { @@ -6557,6 +6576,8 @@ mips_ip (str, ip) if (insn->pinfo == INSN_MACRO) insn_isa = insn->match; + else if ((insn->membership & INSN_ISA) == INSN_ISA1) + insn_isa = 1; else if ((insn->membership & INSN_ISA) == INSN_ISA2) insn_isa = 2; else if ((insn->membership & INSN_ISA) == INSN_ISA3) @@ -6564,23 +6585,24 @@ mips_ip (str, ip) else if ((insn->membership & INSN_ISA) == INSN_ISA4) insn_isa = 4; else - insn_isa = 1; + insn_isa = 15; if (insn_isa > mips_opts.isa - || (insn->pinfo != INSN_MACRO - && (((insn->membership & INSN_ISA) == INSN_4650 - && ! mips_4650) - || ((insn->membership & INSN_ISA) == INSN_4010 - && ! mips_4010) - || ((insn->membership & INSN_ISA) == INSN_4100 - && ! mips_4100) + && (insn->pinfo != INSN_MACRO + && ((mips_4650 + && (insn->membership & INSN_4650) != INSN_4650) + || (mips_4650 && (insn->pinfo & FP_D)) + || (mips_4010 + && (insn->membership & INSN_4010) != INSN_4010) + || (mips_4100 + && (insn->membership & INSN_4100) != INSN_4100) /* start-sanitize-r5900 */ - || ((insn->membership & INSN_ISA) == INSN_5900 - && ! mips_5900) + || (mips_5900 + && (insn->membership & INSN_5900) != INSN_5900) + || (mips_5900 && (insn->pinfo & FP_D)) /* end-sanitize-r5900 */ - || ((insn->membership & INSN_ISA) == INSN_3900 - && ! mips_3900) - ))) + || (mips_3900 + && (insn->membership & INSN_3900) != INSN_3900)))) { if (insn + 1 < &mips_opcodes[NUMOPCODES] && strcmp (insn->name, insn[1].name) == 0)