Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Typedefs | Functions | Variables
arc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  arc_opcode
struct  arc_operand_value
struct  arc_ext_operand_value
struct  arc_operand

Defines

#define ARC_MACH_5   0
#define ARC_MACH_6   1
#define ARC_MACH_7   2
#define ARC_MACH_8   4
#define ARC_MACH_BIG   16
#define ARC_MACH_CPU_MASK   (ARC_MACH_BIG - 1)
#define ARC_MACH_MASK   ((ARC_MACH_BIG << 1) - 1)
#define ARC_OPCODE_CPU(bits)   ((bits) & ARC_MACH_CPU_MASK)
#define ARC_OPCODE_MACH(bits)   ((bits) & ARC_MACH_MASK)
#define ARC_OPCODE_FLAG_START   (ARC_MACH_MASK + 1)
#define ARC_OPCODE_COND_BRANCH   (ARC_OPCODE_FLAG_START)
#define SYNTAX_3OP   (ARC_OPCODE_COND_BRANCH << 1)
#define SYNTAX_LENGTH   (SYNTAX_3OP )
#define SYNTAX_2OP   (SYNTAX_3OP << 1)
#define OP1_MUST_BE_IMM   (SYNTAX_2OP << 1)
#define OP1_IMM_IMPLIED   (OP1_MUST_BE_IMM << 1)
#define SYNTAX_VALID   (OP1_IMM_IMPLIED << 1)
#define I(x)   (((x) & 31) << 27)
#define A(x)   (((x) & ARC_MASK_REG) << ARC_SHIFT_REGA)
#define B(x)   (((x) & ARC_MASK_REG) << ARC_SHIFT_REGB)
#define C(x)   (((x) & ARC_MASK_REG) << ARC_SHIFT_REGC)
#define R(x, b, m)   (((x) & (m)) << (b)) /* value X, mask M, at bit B */
#define ARC_HASH_OPCODE(string)   ((string)[0] >= 'a' && (string)[0] <= 'z' ? (string)[0] - 'a' : 26)
#define ARC_HASH_ICODE(insn)   ((unsigned int) (insn) >> 27)
#define ARC_OPCODE_NEXT_ASM(op)   ((op)->next_asm)
#define ARC_OPCODE_NEXT_DIS(op)   ((op)->next_dis)
#define ARC_OPVAL_CPU(bits)   ((bits) & ARC_MACH_CPU_MASK)
#define ARC_OPVAL_MACH(bits)   ((bits) & ARC_MACH_MASK)
#define ARC_OPERAND_SUFFIX   1
#define ARC_OPERAND_RELATIVE_BRANCH   2
#define ARC_OPERAND_ABSOLUTE_BRANCH   4
#define ARC_OPERAND_ADDRESS   8
#define ARC_OPERAND_LIMM   0x10
#define ARC_OPERAND_SIGNED   0x20
#define ARC_OPERAND_SIGNOPT   0x40
#define ARC_OPERAND_NEGATIVE   0x80
#define ARC_OPERAND_FAKE   0x100
#define ARC_OPERAND_JUMPFLAGS   0x200
#define ARC_OPERAND_WARN   0x400
#define ARC_OPERAND_ERROR   0x800
#define ARC_OPERAND_LOAD   0x8000
#define ARC_OPERAND_STORE   0x10000
#define ARC_MOD_DOT   0x1000
#define ARC_MOD_REG   0x2000
#define ARC_MOD_AUXREG   0x4000
#define ARC_MOD_BITS   0x7000
#define ARC_MOD_P(X)   ((X) & ARC_MOD_BITS)
#define ARC_REGISTER_READONLY   0x01
#define ARC_REGISTER_WRITEONLY   0x02
#define ARC_REGISTER_NOSHORT_CUT   0x04
#define ARC_HAVE_CPU(bits)   ((bits) & ARC_MACH_CPU_MASK)
#define ARC_HAVE_MACH(bits)   ((bits) & ARC_MACH_MASK)
#define ARC_REG_SHIMM_UPDATE   61
#define ARC_REG_SHIMM   63
#define ARC_REG_LIMM   62
#define ARC_REG_CONSTANT_P(REG)   ((REG) >= 61)
#define ARC_SHIFT_REGA   21
#define ARC_SHIFT_REGB   15
#define ARC_SHIFT_REGC   9
#define ARC_MASK_REG   63
#define ARC_DELAY_NONE   0 /* no delay slot */
#define ARC_DELAY_NORMAL   1 /* delay slot in both cases */
#define ARC_DELAY_JUMP   2 /* delay slot only if branch taken */
#define ARC_SHIMM_CONST_P(x)   ((long) (x) >= -256 && (long) (x) <= 255)

Typedefs

typedef unsigned int arc_insn

Functions

int arc_get_opcode_mach (int, int)
void arc_opcode_init_tables (int)
void arc_opcode_init_insert (void)
void arc_opcode_init_extract (void)
struct arc_opcodearc_opcode_lookup_asm (const char *)
struct arc_opcodearc_opcode_lookup_dis (unsigned int)
int arc_opcode_limm_p (long *)
struct arc_operand_valuearc_opcode_lookup_suffix (const struct arc_operand *type, int value)
int arc_opcode_supported (const struct arc_opcode *)
int arc_opval_supported (const struct arc_operand_value *)
int arc_limm_fixup_adjust (arc_insn)
int arc_insn_is_j (arc_insn)
int arc_insn_not_jl (arc_insn)
int arc_operand_type (int)
struct arc_operand_valueget_ext_suffix (char *)
int arc_get_noshortcut_flag (void)

Variables

struct arc_opcodearc_ext_opcodes
struct arc_ext_operand_valuearc_ext_operands
const int arc_operand_count
const int arc_opcodes_count
const int arc_suffixes_count
const int arc_reg_names_count
unsigned char arc_operand_map []

Class Documentation

struct arc_opcode

Definition at line 51 of file arc.h.

Collaboration diagram for arc_opcode:
Class Members
int flags
unsigned long mask
struct arc_opcode * next_asm
struct arc_opcode * next_dis
char * syntax
unsigned long value
struct arc_operand_value

Definition at line 105 of file arc.h.

Class Members
unsigned char flags
char * name
unsigned char type
short value
struct arc_ext_operand_value

Definition at line 119 of file arc.h.

Collaboration diagram for arc_ext_operand_value:
Class Members
struct arc_ext_operand_value * next

Define Documentation

#define A (   x)    (((x) & ARC_MASK_REG) << ARC_SHIFT_REGA)

Definition at line 77 of file arc.h.

#define ARC_DELAY_JUMP   2 /* delay slot only if branch taken */

Definition at line 289 of file arc.h.

#define ARC_DELAY_NONE   0 /* no delay slot */

Definition at line 287 of file arc.h.

#define ARC_DELAY_NORMAL   1 /* delay slot in both cases */

Definition at line 288 of file arc.h.

#define ARC_HASH_ICODE (   insn)    ((unsigned int) (insn) >> 27)

Definition at line 92 of file arc.h.

#define ARC_HASH_OPCODE (   string)    ((string)[0] >= 'a' && (string)[0] <= 'z' ? (string)[0] - 'a' : 26)

Definition at line 90 of file arc.h.

#define ARC_HAVE_CPU (   bits)    ((bits) & ARC_MACH_CPU_MASK)

Definition at line 268 of file arc.h.

#define ARC_HAVE_MACH (   bits)    ((bits) & ARC_MACH_MASK)

Definition at line 270 of file arc.h.

#define ARC_MACH_5   0

Definition at line 33 of file arc.h.

#define ARC_MACH_6   1

Definition at line 34 of file arc.h.

#define ARC_MACH_7   2

Definition at line 35 of file arc.h.

#define ARC_MACH_8   4

Definition at line 36 of file arc.h.

#define ARC_MACH_BIG   16

Definition at line 39 of file arc.h.

#define ARC_MACH_CPU_MASK   (ARC_MACH_BIG - 1)

Definition at line 42 of file arc.h.

#define ARC_MACH_MASK   ((ARC_MACH_BIG << 1) - 1)

Definition at line 45 of file arc.h.

#define ARC_MASK_REG   63

Definition at line 284 of file arc.h.

#define ARC_MOD_AUXREG   0x4000

Definition at line 200 of file arc.h.

#define ARC_MOD_BITS   0x7000

Definition at line 203 of file arc.h.

#define ARC_MOD_DOT   0x1000

Definition at line 194 of file arc.h.

#define ARC_MOD_P (   X)    ((X) & ARC_MOD_BITS)

Definition at line 206 of file arc.h.

#define ARC_MOD_REG   0x2000

Definition at line 197 of file arc.h.

Definition at line 68 of file arc.h.

#define ARC_OPCODE_CPU (   bits)    ((bits) & ARC_MACH_CPU_MASK)

Definition at line 59 of file arc.h.

Definition at line 65 of file arc.h.

#define ARC_OPCODE_MACH (   bits)    ((bits) & ARC_MACH_MASK)

Definition at line 62 of file arc.h.

#define ARC_OPCODE_NEXT_ASM (   op)    ((op)->next_asm)

Definition at line 97 of file arc.h.

#define ARC_OPCODE_NEXT_DIS (   op)    ((op)->next_dis)

Definition at line 98 of file arc.h.

Definition at line 151 of file arc.h.

#define ARC_OPERAND_ADDRESS   8

Definition at line 155 of file arc.h.

#define ARC_OPERAND_ERROR   0x800

Definition at line 184 of file arc.h.

#define ARC_OPERAND_FAKE   0x100

Definition at line 177 of file arc.h.

#define ARC_OPERAND_JUMPFLAGS   0x200

Definition at line 180 of file arc.h.

#define ARC_OPERAND_LIMM   0x10

Definition at line 158 of file arc.h.

#define ARC_OPERAND_LOAD   0x8000

Definition at line 187 of file arc.h.

#define ARC_OPERAND_NEGATIVE   0x80

Definition at line 173 of file arc.h.

Definition at line 147 of file arc.h.

#define ARC_OPERAND_SIGNED   0x20

Definition at line 161 of file arc.h.

#define ARC_OPERAND_SIGNOPT   0x40

Definition at line 166 of file arc.h.

#define ARC_OPERAND_STORE   0x10000

Definition at line 190 of file arc.h.

#define ARC_OPERAND_SUFFIX   1

Definition at line 143 of file arc.h.

#define ARC_OPERAND_WARN   0x400

Definition at line 183 of file arc.h.

#define ARC_OPVAL_CPU (   bits)    ((bits) & ARC_MACH_CPU_MASK)

Definition at line 114 of file arc.h.

#define ARC_OPVAL_MACH (   bits)    ((bits) & ARC_MACH_MASK)

Definition at line 116 of file arc.h.

#define ARC_REG_CONSTANT_P (   REG)    ((REG) >= 61)

Definition at line 278 of file arc.h.

#define ARC_REG_LIMM   62

Definition at line 275 of file arc.h.

#define ARC_REG_SHIMM   63

Definition at line 274 of file arc.h.

#define ARC_REG_SHIMM_UPDATE   61

Definition at line 273 of file arc.h.

#define ARC_REGISTER_NOSHORT_CUT   0x04

Definition at line 211 of file arc.h.

#define ARC_REGISTER_READONLY   0x01

Definition at line 209 of file arc.h.

#define ARC_REGISTER_WRITEONLY   0x02

Definition at line 210 of file arc.h.

#define ARC_SHIFT_REGA   21

Definition at line 281 of file arc.h.

#define ARC_SHIFT_REGB   15

Definition at line 282 of file arc.h.

#define ARC_SHIFT_REGC   9

Definition at line 283 of file arc.h.

#define ARC_SHIMM_CONST_P (   x)    ((long) (x) >= -256 && (long) (x) <= 255)

Definition at line 292 of file arc.h.

#define B (   x)    (((x) & ARC_MASK_REG) << ARC_SHIFT_REGB)

Definition at line 78 of file arc.h.

#define C (   x)    (((x) & ARC_MASK_REG) << ARC_SHIFT_REGC)

Definition at line 79 of file arc.h.

#define I (   x)    (((x) & 31) << 27)

Definition at line 76 of file arc.h.

#define OP1_IMM_IMPLIED   (OP1_MUST_BE_IMM << 1)

Definition at line 73 of file arc.h.

#define OP1_MUST_BE_IMM   (SYNTAX_2OP << 1)

Definition at line 72 of file arc.h.

#define R (   x,
  b,
 
)    (((x) & (m)) << (b)) /* value X, mask M, at bit B */

Definition at line 80 of file arc.h.

#define SYNTAX_2OP   (SYNTAX_3OP << 1)

Definition at line 71 of file arc.h.

#define SYNTAX_3OP   (ARC_OPCODE_COND_BRANCH << 1)

Definition at line 69 of file arc.h.

#define SYNTAX_LENGTH   (SYNTAX_3OP )

Definition at line 70 of file arc.h.

#define SYNTAX_VALID   (OP1_IMM_IMPLIED << 1)

Definition at line 74 of file arc.h.


Typedef Documentation

Definition at line 49 of file arc.h.


Function Documentation

Definition at line 1758 of file arc-opc.c.

Here is the caller graph for this function:

Definition at line 1571 of file arc-opc.c.

{
  static int mach_type_map[] =
  {
    ARC_MACH_5,
    ARC_MACH_6,
    ARC_MACH_7,
    ARC_MACH_8
  };
  return mach_type_map[bfd_mach - bfd_mach_arc_5] | (big_p ? ARC_MACH_BIG : 0);
}

Here is the caller graph for this function:

Definition at line 1712 of file arc-opc.c.

{
  return (insn & (I(-1))) == I(0x7);
}

Definition at line 1718 of file arc-opc.c.

{
  return ((insn & (I(-1)|A(-1)|C(-1)|R(-1,7,1)|R(-1,9,1)))
         != (I(0x7) | R(-1,9,1)));
}

Here is the caller graph for this function:

Definition at line 734 of file arc-opc.c.

{
  int retval = 0;

  /* Check for st shimm,[limm].  */
  if ((insn & (I(-1) | C(-1) | B(-1))) ==
      (I(2) | C(ARC_REG_SHIMM) | B(ARC_REG_LIMM)))
    {
      retval = insn & 0x1ff;
      if (retval & 0x100) /* Sign extend 9 bit offset.  */
       retval |= ~0x1ff;
    }
  return -retval; /* Negate offset for return.  */
}

Here is the caller graph for this function:

void arc_opcode_init_extract ( void  )

Definition at line 1038 of file arc-opc.c.

Here is the call graph for this function:

void arc_opcode_init_insert ( void  )

Definition at line 1657 of file arc-opc.c.

{
  int i;

  for(i = 0; i < OPERANDS; i++)
    ls_operand[i] = OP_NONE;

  flag_p = 0;
  flagshimm_handled_p = 0;
  cond_p = 0;
  addrwb_p = 0;
  shimm_p = 0;
  limm_p = 0;
  jumpflags_p = 0;
  nullify_p = 0;
  nullify = 0; /* The default is important.  */
}

Here is the caller graph for this function:

Definition at line 1590 of file arc-opc.c.

{
  static int init_p = 0;

  cpu_type = flags;

  /* We may be intentionally called more than once (for example gdb will call
     us each time the user switches cpu).  These tables only need to be init'd
     once though.  */
  if (!init_p)
    {
      int i,n;

      memset (arc_operand_map, 0, sizeof (arc_operand_map));
      n = sizeof (arc_operands) / sizeof (arc_operands[0]);
      for (i = 0; i < n; ++i)
       arc_operand_map[arc_operands[i].fmt] = i;

      memset (opcode_map, 0, sizeof (opcode_map));
      memset (icode_map, 0, sizeof (icode_map));
      /* Scan the table backwards so macros appear at the front.  */
      for (i = arc_opcodes_count - 1; i >= 0; --i)
       {
         int opcode_hash = ARC_HASH_OPCODE (arc_opcodes[i].syntax);
         int icode_hash = ARC_HASH_ICODE (arc_opcodes[i].value);

         arc_opcodes[i].next_asm = opcode_map[opcode_hash];
         opcode_map[opcode_hash] = &arc_opcodes[i];

         arc_opcodes[i].next_dis = icode_map[icode_hash];
         icode_map[icode_hash] = &arc_opcodes[i];
       }

      init_p = 1;
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1679 of file arc-opc.c.

{
  if (limmp)
    *limmp = limm;
  return limm_p;
}

Here is the caller graph for this function:

Definition at line 1641 of file arc-opc.c.

Here is the caller graph for this function:

Definition at line 1649 of file arc-opc.c.

{
  return icode_map[ARC_HASH_ICODE (insn)];
}

Definition at line 1690 of file arc-opc.c.

{
  const struct arc_operand_value *v,*end;
  struct arc_ext_operand_value *ext_oper = arc_ext_operands;

  while (ext_oper)
    {
      if (type == &arc_operands[ext_oper->operand.type]
         && value == ext_oper->operand.value)
       return (&ext_oper->operand);
      ext_oper = ext_oper->next;
    }

  /* ??? This is a little slow and can be speeded up.  */
  for (v = arc_suffixes, end = arc_suffixes + arc_suffixes_count; v < end; ++v)
    if (type == &arc_operands[v->type]
       && value == v->value)
      return v;
  return 0;
}

Here is the caller graph for this function:

Definition at line 1631 of file arc-opc.c.

{
  if (ARC_OPCODE_CPU (opcode->flags) <= cpu_type)
    return 1;
  return 0;
}

Here is the caller graph for this function:

Definition at line 1725 of file arc-opc.c.

{
  switch (opertype)
    {
    case 0:
      return COND;
      break;
    case 1:
      return REG;
      break;
    case 2:
      return AUXREG;
      break;
    }
  return -1;
}

Here is the caller graph for this function:

struct arc_operand_value* get_ext_suffix ( char *  ) [read]

Definition at line 1743 of file arc-opc.c.

{
  struct arc_ext_operand_value *suffix = arc_ext_operands;

  while (suffix)
    {
      if ((COND == suffix->operand.type)
         && !strcmp(s,suffix->operand.name))
       return(&suffix->operand);
      suffix = suffix->next;
    }
  return NULL;
}

Here is the call graph for this function:


Variable Documentation

Definition at line 33 of file arc-opc.c.

Definition at line 34 of file arc-opc.c.

Definition at line 1414 of file arc-opc.c.

Definition at line 43 of file arc-opc.c.

Definition at line 1488 of file arc-opc.c.

Definition at line 1553 of file arc-opc.c.