Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
openrisc-opc.c File Reference
#include "sysdep.h"
#include "ansidecl.h"
#include "bfd.h"
#include "symcat.h"
#include "openrisc-desc.h"
#include "openrisc-opc.h"
#include "libiberty.h"

Go to the source code of this file.

Defines

#define F(f)   & openrisc_cgen_ifld_table[OPENRISC_f]
#define A(a)   (1 << CGEN_INSN_a)
#define OPERAND(op)   OPENRISC_OPERAND_op
#define MNEM   CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
#define OP(field)   CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
#define F(f)   & openrisc_cgen_ifld_table[OPENRISC_f]
#define A(a)   (1 << CGEN_INSN_a)
#define OPERAND(op)   OPENRISC_OPERAND_op
#define MNEM   CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
#define OP(field)   CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
#define CGEN_ASM_HASH_P(insn)   1
#define CGEN_DIS_HASH_P(insn)   1
#define CGEN_ASM_HASH_SIZE   127
#define CGEN_ASM_HASH(mnem)   (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)

Functions

static int asm_hash_insn_p (const CGEN_INSN *)
static unsigned int asm_hash_insn (const char *)
static int dis_hash_insn_p (const CGEN_INSN *)
static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT)
static int asm_hash_insn_p (insn) const
static int dis_hash_insn_p (CGEN_INSN *insn) const
static unsigned int asm_hash_insn (char *mnem) const
static unsigned int dis_hash_insn (buf, value) const
static void set_fields_bitsize (CGEN_FIELDS *fields, int size)
void openrisc_cgen_init_opcode_table (CGEN_CPU_DESC cd)

Variables

static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED
static const CGEN_OPCODE openrisc_cgen_insn_opcode_table [MAX_INSNS]
static const CGEN_IBASE openrisc_cgen_macro_insn_table []
static const CGEN_OPCODE openrisc_cgen_macro_insn_opcode_table []

Define Documentation

#define A (   a)    (1 << CGEN_INSN_a)

Definition at line 546 of file openrisc-opc.c.

#define A (   a)    (1 << CGEN_INSN_a)

Definition at line 546 of file openrisc-opc.c.

#define CGEN_ASM_HASH (   mnem)    (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)

Definition at line 616 of file openrisc-opc.c.

#define CGEN_ASM_HASH_P (   insn)    1

Definition at line 585 of file openrisc-opc.c.

#define CGEN_ASM_HASH_SIZE   127

Definition at line 614 of file openrisc-opc.c.

#define CGEN_DIS_HASH_P (   insn)    1

Definition at line 589 of file openrisc-opc.c.

#define F (   f)    & openrisc_cgen_ifld_table[OPENRISC_f]

Definition at line 533 of file openrisc-opc.c.

#define F (   f)    & openrisc_cgen_ifld_table[OPENRISC_f]

Definition at line 533 of file openrisc-opc.c.

#define MNEM   CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */

Definition at line 553 of file openrisc-opc.c.

#define MNEM   CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */

Definition at line 553 of file openrisc-opc.c.

#define OP (   field)    CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))

Definition at line 554 of file openrisc-opc.c.

#define OP (   field)    CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))

Definition at line 554 of file openrisc-opc.c.

#define OPERAND (   op)    OPENRISC_OPERAND_op

Definition at line 551 of file openrisc-opc.c.

#define OPERAND (   op)    OPENRISC_OPERAND_op

Definition at line 551 of file openrisc-opc.c.


Function Documentation

static unsigned int asm_hash_insn ( const char *  ) [static]
static unsigned int asm_hash_insn ( char *  mnem) const [static]

Definition at line 636 of file openrisc-opc.c.

{
  return CGEN_ASM_HASH (mnem);
}
static int asm_hash_insn_p ( const CGEN_INSN *  ) [static]
static int asm_hash_insn_p ( insn  ) const [static]

Definition at line 596 of file openrisc-opc.c.

{
  return CGEN_ASM_HASH_P (insn);
}
static unsigned int dis_hash_insn ( const char *  ,
CGEN_INSN_INT   
) [static]
static unsigned int dis_hash_insn ( buf  ,
value   
) const [static]

Definition at line 646 of file openrisc-opc.c.

{
  return CGEN_DIS_HASH (buf, value);
}
static int dis_hash_insn_p ( const CGEN_INSN *  ) [static]
static int dis_hash_insn_p ( CGEN_INSN *  insn) const [static]

Definition at line 603 of file openrisc-opc.c.

{
  /* If building the hash table and the NO-DIS attribute is present,
     ignore.  */
  if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
    return 0;
  return CGEN_DIS_HASH_P (insn);
}

Definition at line 665 of file openrisc-opc.c.

{
  int i;
  int num_macros = (sizeof (openrisc_cgen_macro_insn_table) /
                  sizeof (openrisc_cgen_macro_insn_table[0]));
  const CGEN_IBASE *ib = & openrisc_cgen_macro_insn_table[0];
  const CGEN_OPCODE *oc = & openrisc_cgen_macro_insn_opcode_table[0];
  CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN));

  memset (insns, 0, num_macros * sizeof (CGEN_INSN));
  for (i = 0; i < num_macros; ++i)
    {
      insns[i].base = &ib[i];
      insns[i].opcode = &oc[i];
      openrisc_cgen_build_insn_regex (& insns[i]);
    }
  cd->macro_insn_table.init_entries = insns;
  cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
  cd->macro_insn_table.num_init_entries = num_macros;

  oc = & openrisc_cgen_insn_opcode_table[0];
  insns = (CGEN_INSN *) cd->insn_table.init_entries;
  for (i = 0; i < MAX_INSNS; ++i)
    {
      insns[i].opcode = &oc[i];
      openrisc_cgen_build_insn_regex (& insns[i]);
    }

  cd->sizeof_fields = sizeof (CGEN_FIELDS);
  cd->set_fields_bitsize = set_fields_bitsize;

  cd->asm_hash_p = asm_hash_insn_p;
  cd->asm_hash = asm_hash_insn;
  cd->asm_hash_size = CGEN_ASM_HASH_SIZE;

  cd->dis_hash_p = dis_hash_insn_p;
  cd->dis_hash = dis_hash_insn;
  cd->dis_hash_size = CGEN_DIS_HASH_SIZE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_fields_bitsize ( CGEN_FIELDS *  fields,
int  size 
) [static]

Definition at line 656 of file openrisc-opc.c.

{
  CGEN_FIELDS_BITSIZE (fields) = size;
}

Here is the caller graph for this function:


Variable Documentation

const CGEN_IFMT ifmt_l_ret ATTRIBUTE_UNUSED [static]
Initial value:
 {
  0, 0, 0x0, { { 0 } }
}

Definition at line 50 of file openrisc-opc.c.

Definition at line 131 of file openrisc-opc.c.

Initial value:
{

  {
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    & ifmt_l_ret, { 0x140b0000 }
  },
}

Definition at line 569 of file openrisc-opc.c.

Initial value:
{

  {
    -1, "l-ret", "l.ret", 32,
    { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
  },
}

Definition at line 558 of file openrisc-opc.c.