Back to index

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

Go to the source code of this file.

Defines

#define F(f)   & m32r_cgen_ifld_table[M32R_f]
#define A(a)   (1 << CGEN_INSN_a)
#define OPERAND(op)   M32R_OPERAND_op
#define MNEM   CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
#define OP(field)   CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
#define F(f)   & m32r_cgen_ifld_table[M32R_f]
#define A(a)   (1 << CGEN_INSN_a)
#define OPERAND(op)   M32R_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

unsigned int m32r_cgen_dis_hash (const char *buf ATTRIBUTE_UNUSED, CGEN_INSN_INT value)
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 m32r_cgen_init_opcode_table (CGEN_CPU_DESC cd)

Variables

static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED
static const CGEN_OPCODE m32r_cgen_insn_opcode_table [MAX_INSNS]
static const CGEN_IBASE m32r_cgen_macro_insn_table []
static const CGEN_OPCODE m32r_cgen_macro_insn_opcode_table []

Define Documentation

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

Definition at line 1287 of file m32r-opc.c.

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

Definition at line 1287 of file m32r-opc.c.

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

Definition at line 1742 of file m32r-opc.c.

#define CGEN_ASM_HASH_P (   insn)    1

Definition at line 1711 of file m32r-opc.c.

#define CGEN_ASM_HASH_SIZE   127

Definition at line 1740 of file m32r-opc.c.

#define CGEN_DIS_HASH_P (   insn)    1

Definition at line 1715 of file m32r-opc.c.

#define F (   f)    & m32r_cgen_ifld_table[M32R_f]

Definition at line 1134 of file m32r-opc.c.

#define F (   f)    & m32r_cgen_ifld_table[M32R_f]

Definition at line 1134 of file m32r-opc.c.

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

Definition at line 1294 of file m32r-opc.c.

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

Definition at line 1294 of file m32r-opc.c.

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

Definition at line 1295 of file m32r-opc.c.

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

Definition at line 1295 of file m32r-opc.c.

#define OPERAND (   op)    M32R_OPERAND_op

Definition at line 1292 of file m32r-opc.c.

#define OPERAND (   op)    M32R_OPERAND_op

Definition at line 1292 of file m32r-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 1762 of file m32r-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 1722 of file m32r-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 1772 of file m32r-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 1729 of file m32r-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);
}
unsigned int m32r_cgen_dis_hash ( const char *buf  ATTRIBUTE_UNUSED,
CGEN_INSN_INT  value 
)

Definition at line 35 of file m32r-opc.c.

{
  unsigned int x;

  if (value & 0xffff0000) /* 32bit instructions.  */
    value = (value >> 16) & 0xffff;

  x = (value >> 8) & 0xf0;
  if (x == 0x40 || x == 0xe0 || x == 0x60 || x == 0x50)
    return x;

  if (x == 0x70 || x == 0xf0)
    return x | ((value >> 8) & 0x0f);

  if (x == 0x30)
    return x | ((value & 0x70) >> 4);
  else
    return x | ((value & 0xf0) >> 4);
}

Definition at line 1791 of file m32r-opc.c.

{
  int i;
  int num_macros = (sizeof (m32r_cgen_macro_insn_table) /
                  sizeof (m32r_cgen_macro_insn_table[0]));
  const CGEN_IBASE *ib = & m32r_cgen_macro_insn_table[0];
  const CGEN_OPCODE *oc = & m32r_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];
      m32r_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 = & m32r_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];
      m32r_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 1782 of file m32r-opc.c.

{
  CGEN_FIELDS_BITSIZE (fields) = size;
}

Here is the caller graph for this function:


Variable Documentation

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

Definition at line 71 of file m32r-opc.c.

Definition at line 228 of file m32r-opc.c.

Definition at line 1485 of file m32r-opc.c.

Definition at line 1299 of file m32r-opc.c.