/* ia64-asmtab.h -- Header for compacted IA-64 opcode tables.
|
/* ia64-asmtab.h -- Header for compacted IA-64 opcode tables.
|
Copyright 1999, 2000, 2005, 2007 Free Software Foundation, Inc.
|
Copyright 1999, 2000, 2005, 2007 Free Software Foundation, Inc.
|
Contributed by Bob Manson of Cygnus Support <manson@cygnus.com>
|
Contributed by Bob Manson of Cygnus Support <manson@cygnus.com>
|
|
|
This file is part of the GNU opcodes library.
|
This file is part of the GNU opcodes library.
|
|
|
This library is free software; you can redistribute it and/or modify
|
This library is free software; you can redistribute it and/or modify
|
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
the Free Software Foundation; either version 3, or (at your option)
|
the Free Software Foundation; either version 3, or (at your option)
|
any later version.
|
any later version.
|
|
|
It is distributed in the hope that it will be useful, but WITHOUT
|
It is distributed in the hope that it will be useful, but WITHOUT
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
License for more details.
|
License for more details.
|
|
|
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
along with this file; see the file COPYING. If not, write to the
|
along with this file; see the file COPYING. If not, write to the
|
Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
|
Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
|
MA 02110-1301, USA. */
|
MA 02110-1301, USA. */
|
|
|
#ifndef IA64_ASMTAB_H
|
#ifndef IA64_ASMTAB_H
|
#define IA64_ASMTAB_H
|
#define IA64_ASMTAB_H
|
|
|
#include "opcode/ia64.h"
|
#include "opcode/ia64.h"
|
|
|
/* The primary opcode table is made up of the following: */
|
/* The primary opcode table is made up of the following: */
|
struct ia64_main_table
|
struct ia64_main_table
|
{
|
{
|
/* The entry in the string table that corresponds to the name of this
|
/* The entry in the string table that corresponds to the name of this
|
opcode. */
|
opcode. */
|
unsigned short name_index;
|
unsigned short name_index;
|
|
|
/* The type of opcode; corresponds to the TYPE field in
|
/* The type of opcode; corresponds to the TYPE field in
|
struct ia64_opcode. */
|
struct ia64_opcode. */
|
unsigned char opcode_type;
|
unsigned char opcode_type;
|
|
|
/* The number of outputs for this opcode. */
|
/* The number of outputs for this opcode. */
|
unsigned char num_outputs;
|
unsigned char num_outputs;
|
|
|
/* The base insn value for this opcode. It may be modified by completers. */
|
/* The base insn value for this opcode. It may be modified by completers. */
|
ia64_insn opcode;
|
ia64_insn opcode;
|
|
|
/* The mask of valid bits in OPCODE. Zeros indicate operand fields. */
|
/* The mask of valid bits in OPCODE. Zeros indicate operand fields. */
|
ia64_insn mask;
|
ia64_insn mask;
|
|
|
/* The operands of this instruction. Corresponds to the OPERANDS field
|
/* The operands of this instruction. Corresponds to the OPERANDS field
|
in struct ia64_opcode. */
|
in struct ia64_opcode. */
|
unsigned char operands[5];
|
unsigned char operands[5];
|
|
|
/* The flags for this instruction. Corresponds to the FLAGS field in
|
/* The flags for this instruction. Corresponds to the FLAGS field in
|
struct ia64_opcode. */
|
struct ia64_opcode. */
|
short flags;
|
short flags;
|
|
|
/* The tree of completers for this instruction; this is an offset into
|
/* The tree of completers for this instruction; this is an offset into
|
completer_table. */
|
completer_table. */
|
short completers;
|
short completers;
|
};
|
};
|
|
|
/* Each instruction has a set of possible "completers", or additional
|
/* Each instruction has a set of possible "completers", or additional
|
suffixes that can alter the instruction's behavior, and which has
|
suffixes that can alter the instruction's behavior, and which has
|
potentially different dependencies.
|
potentially different dependencies.
|
|
|
The completer entries modify certain bits in the instruction opcode.
|
The completer entries modify certain bits in the instruction opcode.
|
Which bits are to be modified are marked by the BITS, MASK and
|
Which bits are to be modified are marked by the BITS, MASK and
|
OFFSET fields. The completer entry may also note dependencies for the
|
OFFSET fields. The completer entry may also note dependencies for the
|
opcode.
|
opcode.
|
|
|
These completers are arranged in a DAG; the pointers are indexes
|
These completers are arranged in a DAG; the pointers are indexes
|
into the completer_table array. The completer DAG is searched by
|
into the completer_table array. The completer DAG is searched by
|
find_completer () and ia64_find_matching_opcode ().
|
find_completer () and ia64_find_matching_opcode ().
|
|
|
Note that each completer needs to be applied in turn, so that if we
|
Note that each completer needs to be applied in turn, so that if we
|
have the instruction
|
have the instruction
|
cmp.lt.unc
|
cmp.lt.unc
|
the completer entries for both "lt" and "unc" would need to be applied
|
the completer entries for both "lt" and "unc" would need to be applied
|
to the opcode's value.
|
to the opcode's value.
|
|
|
Some instructions do not require any completers; these contain an
|
Some instructions do not require any completers; these contain an
|
empty completer entry. Instructions that require a completer do
|
empty completer entry. Instructions that require a completer do
|
not contain an empty entry.
|
not contain an empty entry.
|
|
|
Terminal completers (those completers that validly complete an
|
Terminal completers (those completers that validly complete an
|
instruction) are marked by having the TERMINAL_COMPLETER flag set.
|
instruction) are marked by having the TERMINAL_COMPLETER flag set.
|
|
|
Only dependencies listed in the terminal completer for an opcode are
|
Only dependencies listed in the terminal completer for an opcode are
|
considered to apply to that opcode instance. */
|
considered to apply to that opcode instance. */
|
|
|
struct ia64_completer_table
|
struct ia64_completer_table
|
{
|
{
|
/* The bit value that this completer sets. */
|
/* The bit value that this completer sets. */
|
unsigned int bits;
|
unsigned int bits;
|
|
|
/* And its mask. 1s are bits that are to be modified in the
|
/* And its mask. 1s are bits that are to be modified in the
|
instruction. */
|
instruction. */
|
unsigned int mask;
|
unsigned int mask;
|
|
|
/* The entry in the string table that corresponds to the name of this
|
/* The entry in the string table that corresponds to the name of this
|
completer. */
|
completer. */
|
unsigned short name_index;
|
unsigned short name_index;
|
|
|
/* An alternative completer, or -1 if this is the end of the chain. */
|
/* An alternative completer, or -1 if this is the end of the chain. */
|
short alternative;
|
short alternative;
|
|
|
/* A pointer to the DAG of completers that can potentially follow
|
/* A pointer to the DAG of completers that can potentially follow
|
this one, or -1. */
|
this one, or -1. */
|
short subentries;
|
short subentries;
|
|
|
/* The bit offset in the instruction where BITS and MASK should be
|
/* The bit offset in the instruction where BITS and MASK should be
|
applied. */
|
applied. */
|
unsigned char offset : 7;
|
unsigned char offset : 7;
|
|
|
unsigned char terminal_completer : 1;
|
unsigned char terminal_completer : 1;
|
|
|
/* Index into the dependency list table */
|
/* Index into the dependency list table */
|
short dependencies;
|
short dependencies;
|
};
|
};
|
|
|
/* This contains sufficient information for the disassembler to resolve
|
/* This contains sufficient information for the disassembler to resolve
|
the complete name of the original instruction. */
|
the complete name of the original instruction. */
|
struct ia64_dis_names
|
struct ia64_dis_names
|
{
|
{
|
/* COMPLETER_INDEX represents the tree of completers that make up
|
/* COMPLETER_INDEX represents the tree of completers that make up
|
the instruction. The LSB represents the top of the tree for the
|
the instruction. The LSB represents the top of the tree for the
|
specified instruction.
|
specified instruction.
|
|
|
A 0 bit indicates to go to the next alternate completer via the
|
A 0 bit indicates to go to the next alternate completer via the
|
alternative field; a 1 bit indicates that the current completer
|
alternative field; a 1 bit indicates that the current completer
|
is part of the instruction, and to go down the subentries index.
|
is part of the instruction, and to go down the subentries index.
|
We know we've reached the final completer when we run out of 1
|
We know we've reached the final completer when we run out of 1
|
bits.
|
bits.
|
|
|
There is always at least one 1 bit. */
|
There is always at least one 1 bit. */
|
unsigned int completer_index : 20;
|
unsigned int completer_index : 20;
|
|
|
/* The index in the main_table[] array for the instruction. */
|
/* The index in the main_table[] array for the instruction. */
|
unsigned short insn_index : 11;
|
unsigned short insn_index : 11;
|
|
|
/* If set, the next entry in this table is an alternate possibility
|
/* If set, the next entry in this table is an alternate possibility
|
for this instruction encoding. Which one to use is determined by
|
for this instruction encoding. Which one to use is determined by
|
the instruction type and other factors (see opcode_verify ()). */
|
the instruction type and other factors (see opcode_verify ()). */
|
unsigned int next_flag : 1;
|
unsigned int next_flag : 1;
|
|
|
/* The disassembly priority of this entry among instructions. */
|
/* The disassembly priority of this entry among instructions. */
|
unsigned short priority;
|
unsigned short priority;
|
};
|
};
|
|
|
#endif
|
#endif
|
|
|