diff options
author | Jeff Law <law@redhat.com> | 1997-07-11 16:40:14 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1997-07-11 16:40:14 +0000 |
commit | 931a1858a690e7e0be7a71c0cfb701aac5a5866b (patch) | |
tree | 84e9414b5025abfe870c6f6152990d8f01de5340 /gas | |
parent | 4bb0ae107d0763ad94e089d17a9cfe3eccc77189 (diff) | |
download | gdb-931a1858a690e7e0be7a71c0cfb701aac5a5866b.zip gdb-931a1858a690e7e0be7a71c0cfb701aac5a5866b.tar.gz gdb-931a1858a690e7e0be7a71c0cfb701aac5a5866b.tar.bz2 |
* 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
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-mips.c | 96 |
2 files changed, 65 insertions, 37 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 8d59d29..2060e9c 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 <ian@cygnus.com> * 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 5e92c73..5a71412 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) |