diff options
author | Doug Evans <dje@google.com> | 1998-02-13 02:31:10 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 1998-02-13 02:31:10 +0000 |
commit | 390bd87dbaea27ac1741719d1fd8694f123c1ec9 (patch) | |
tree | 0cd6baf14f2484e60c5a8ea3c2705a3f8f0a75e1 /opcodes/cgen-opc.in | |
parent | a7dead174d233d7f67cec6c3329636d71338dfc7 (diff) | |
download | gdb-390bd87dbaea27ac1741719d1fd8694f123c1ec9.zip gdb-390bd87dbaea27ac1741719d1fd8694f123c1ec9.tar.gz gdb-390bd87dbaea27ac1741719d1fd8694f123c1ec9.tar.bz2 |
* cgen-opc.in (@arch@_cgen_lookup_insn): New argument alias_p.
Ignore ALIAS insns if asked to.
(@arch@_cgen_get_insn_operands): Pass 0 for alias_p, NULL for insn.
* m32r-opc.c: Regenerate.
Diffstat (limited to 'opcodes/cgen-opc.in')
-rw-r--r-- | opcodes/cgen-opc.in | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/opcodes/cgen-opc.in b/opcodes/cgen-opc.in index d88df31..af51ef2 100644 --- a/opcodes/cgen-opc.in +++ b/opcodes/cgen-opc.in @@ -33,17 +33,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ If non-null INSN is the insn table entry. Otherwise INSN_VALUE is examined to compute it. LENGTH is the bit length of INSN_VALUE if known, otherwise 0. + ALIAS_P is non-zero if alias insns are to be included in the search. The result a pointer to the insn table entry, or NULL if the instruction wasn't recognized. */ const CGEN_INSN * -@arch@_cgen_lookup_insn (insn, insn_value, length, fields) +@arch@_cgen_lookup_insn (insn, insn_value, length, fields, alias_p) const CGEN_INSN *insn; cgen_insn_t insn_value; int length; CGEN_FIELDS *fields; { - char buf[4]; + char buf[16]; if (!insn) { @@ -82,14 +83,18 @@ const CGEN_INSN * { insn = insn_list->insn; - /* Basic bit mask must be correct. */ - /* ??? May wish to allow target to defer this check until the extract - handler. */ - if ((insn_value & CGEN_INSN_MASK (insn)) == CGEN_INSN_VALUE (insn)) + if (alias_p + || ! CGEN_INSN_ATTR (insn, CGEN_INSN_ALIAS)) { - length = (*CGEN_EXTRACT_FN (insn)) (insn, NULL, insn_value, fields); - if (length > 0) - return insn; + /* Basic bit mask must be correct. */ + /* ??? May wish to allow target to defer this check until the + extract handler. */ + if ((insn_value & CGEN_INSN_MASK (insn)) == CGEN_INSN_VALUE (insn)) + { + length = (*CGEN_EXTRACT_FN (insn)) (insn, NULL, insn_value, fields); + if (length > 0) + return insn; + } } insn_list = CGEN_DIS_NEXT_INSN (insn_list); @@ -97,6 +102,11 @@ const CGEN_INSN * } else { + /* Sanity check: can't pass an alias insn if ! alias_p. */ + if (! alias_p + && CGEN_INSN_ATTR (insn, CGEN_INSN_ALIAS)) + abort (); + length = (*CGEN_EXTRACT_FN (insn)) (insn, NULL, insn_value, fields); if (length > 0) return insn; @@ -124,7 +134,11 @@ const CGEN_INSN * const CGEN_OPERAND_INSTANCE *opinst; int i; - insn = @arch@_cgen_lookup_insn (insn, insn_value, length, &fields); + /* FIXME: ALIAS insns are in transition from being record in the insn table + to being recorded separately as macros. They don't have semantic code + so they can't be used here. Thus we currently always ignore the INSN + argument. */ + insn = @arch@_cgen_lookup_insn (NULL, insn_value, length, &fields, 0); if (! insn) return NULL; |