osprey/cygnus/opcodes/arc-opc.c File Reference

#include "sysdep.h"
#include <stdio.h>
#include "ansidecl.h"
#include "bfd.h"
#include "opcode/arc.h"

Include dependency graph for arc-opc.c:

Go to the source code of this file.

Defines

#define INSERT_FN(fn)
#define EXTRACT_FN(fn)
#define OPERANDS   3
#define LS_VALUE   0
#define LS_DEST   0
#define LS_BASE   1
#define LS_OFFSET   2
#define UNUSED   0
#define REGA   (UNUSED + 1)
#define REGB   (REGA + 1)
#define REGC   (REGB + 1)
#define SHIMMFINISH   (REGC + 1)
#define LIMMFINISH   (SHIMMFINISH + 1)
#define ST_OFFSET   (LIMMFINISH + 1)
#define LD_OFFSET   (ST_OFFSET + 1)
#define BASE   (LD_OFFSET + 1)
#define SYNTAX_ST_NE   (BASE + 1)
#define SYNTAX_LD_NE   (SYNTAX_ST_NE + 1)
#define SYNTAX_ST   (SYNTAX_LD_NE + 1)
#define SYNTAX_LD   (SYNTAX_ST + 1)
#define FLAG   (SYNTAX_LD + 1)
#define FLAGFINISH   (FLAG + 1)
#define FLAGINSN   (FLAGFINISH + 1)
#define DELAY   (FLAGINSN + 1)
#define COND   (DELAY + 1)
#define FORCELIMM   (COND + 1)
#define BRANCH   (FORCELIMM + 1)
#define JUMP   (BRANCH + 1)
#define JUMPFLAGS   (JUMP + 1)
#define SIZE1   (JUMPFLAGS + 1)
#define SIZE10   (SIZE1 + 1)
#define SIZE22   (SIZE10 + 1)
#define SIGN0   (SIZE22 + 1)
#define SIGN9   (SIGN0 + 1)
#define ADDRESS3   (SIGN9 + 1)
#define ADDRESS12   (ADDRESS3 + 1)
#define ADDRESS24   (ADDRESS12 + 1)
#define CACHEBYPASS5   (ADDRESS24 + 1)
#define CACHEBYPASS14   (CACHEBYPASS5 + 1)
#define CACHEBYPASS26   (CACHEBYPASS14 + 1)
#define UNOPMACRO   (CACHEBYPASS26 + 1)
#define MODDOT   (UNOPMACRO + 1)
#define REG   (MODDOT + 1)
#define AUXREG   (REG + 1)
#define ST_SYNTAX(V, B, O)
#define LD_SYNTAX(D, B, O)

Enumerations

enum  operand { OP_NONE, OP_REG, OP_SHIMM, OP_LIMM }

Functions/Subroutines

 INSERT_FN (insert_reg)
 INSERT_FN (insert_shimmfinish)
 INSERT_FN (insert_limmfinish)
 INSERT_FN (insert_offset)
 INSERT_FN (insert_base)
 INSERT_FN (insert_st_syntax)
 INSERT_FN (insert_ld_syntax)
 INSERT_FN (insert_addr_wb)
 INSERT_FN (insert_flag)
 INSERT_FN (insert_nullify)
 INSERT_FN (insert_flagfinish)
 INSERT_FN (insert_cond)
 INSERT_FN (insert_forcelimm)
 INSERT_FN (insert_reladdr)
 INSERT_FN (insert_absaddr)
 INSERT_FN (insert_jumpflags)
 INSERT_FN (insert_unopmacro)
 EXTRACT_FN (extract_reg)
 EXTRACT_FN (extract_ld_offset)
 EXTRACT_FN (extract_ld_syntax)
 EXTRACT_FN (extract_st_offset)
 EXTRACT_FN (extract_st_syntax)
 EXTRACT_FN (extract_flag)
 EXTRACT_FN (extract_cond)
 EXTRACT_FN (extract_reladdr)
 EXTRACT_FN (extract_jumpflags)
 EXTRACT_FN (extract_unopmacro)
int arc_get_opcode_mach (int bfd_mach, int big_p)
void arc_opcode_init_tables (int flags)
int arc_opcode_supported (struct arc_opcode *opcode) const
struct arc_opcodearc_opcode_lookup_asm (char *insn) const
struct arc_opcodearc_opcode_lookup_dis (unsigned int insn)
void arc_opcode_init_insert ()
int arc_opcode_limm_p (long *limmp)
static arc_insn insert_reg (arc_insn insn, const struct arc_operand *operand, int mods, const struct arc_operand_value *reg, long value, const char **errmsg)
static arc_insn insert_flag (arc_insn insn, operand, mods, reg, value, errmsg)
static arc_insn insert_nullify (arc_insn insn, const struct arc_operand *operand, mods, reg, long value, errmsg)
static arc_insn insert_flagfinish (arc_insn insn, const struct arc_operand *operand, mods, reg, value, errmsg)
static arc_insn insert_cond (arc_insn insn, const struct arc_operand *operand, mods, reg, long value, errmsg)
static arc_insn insert_forcelimm (arc_insn insn, operand, mods, reg, value, errmsg)
static arc_insn insert_addr_wb (arc_insn insn, const struct arc_operand *operand, mods, reg, value, errmsg)
static arc_insn insert_base (arc_insn insn, const struct arc_operand *operand, int mods, const struct arc_operand_value *reg, long value, const char **errmsg)
static arc_insn insert_offset (arc_insn insn, const struct arc_operand *operand, int mods, const struct arc_operand_value *reg, long value, const char **errmsg)
static long extract_st_syntax (arc_insn *insn, operand, mods, opval, int *invalid)
int arc_limm_fixup_adjust (arc_insn insn)
static arc_insn insert_st_syntax (arc_insn insn, operand, mods, reg, value, const char **errmsg)
static arc_insn insert_ld_syntax (arc_insn insn, operand, mods, reg, value, const char **errmsg)
static long extract_ld_syntax (arc_insn *insn, operand, mods, opval, int *invalid)
static arc_insn insert_shimmfinish (arc_insn insn, const struct arc_operand *operand, mods, reg, value, errmsg)
static arc_insn insert_limmfinish (arc_insn insn, operand, mods, reg, value, errmsg)
static arc_insn insert_jumpflags (arc_insn insn, const struct arc_operand *operand, mods, reg, long value, const char **errmsg)
static arc_insn insert_unopmacro (arc_insn insn, const struct arc_operand *operand, mods, reg, value, errmsg)
static arc_insn insert_reladdr (arc_insn insn, const struct arc_operand *operand, mods, reg, long value, const char **errmsg)
static arc_insn insert_absaddr (arc_insn insn, operand, mods, reg, value, const char **errmsg)
static struct arc_operand_valuelookup_register (int type, long regno)
void arc_opcode_init_extract ()
static long extract_reg (arc_insn *insn, const struct arc_operand *operand, int mods, const struct arc_operand_value **opval, invalid)
static long extract_flag (arc_insn *insn, const struct arc_operand *operand, mods, const struct arc_operand_value **opval, invalid)
static long extract_cond (arc_insn *insn, const struct arc_operand *operand, mods, const struct arc_operand_value **opval, invalid)
static long extract_reladdr (arc_insn *insn, const struct arc_operand *operand, mods, opval, invalid)
static long extract_jumpflags (arc_insn *insn, const struct arc_operand *operand, mods, opval, int *invalid)
static long extract_st_offset (arc_insn *insn, const struct arc_operand *operand, mods, opval, int *invalid)
static long extract_ld_offset (arc_insn *insn, const struct arc_operand *operand, int mods, const struct arc_operand_value **opval, int *invalid)
static long extract_unopmacro (arc_insn *insn, operand, mods, opval, int *invalid)
struct arc_operand_valuearc_opcode_lookup_suffix (struct arc_operand *type, int value) const
int arc_insn_is_j (arc_insn insn)
int arc_insn_not_jl (arc_insn insn)
int arc_operand_type (int opertype)
struct arc_operand_valueget_ext_suffix (char *s)
int arc_get_noshortcut_flag ()

Variables

enum operand ls_operand [OPERANDS]
struct arc_opcodearc_ext_opcodes
struct arc_ext_operand_valuearc_ext_operands
struct arc_operand arc_operands []
unsigned char arc_operand_map [256]
struct arc_opcode arc_opcodes []
const int arc_opcodes_count = sizeof (arc_opcodes) / sizeof (arc_opcodes[0])
struct arc_operand_value arc_reg_names []
const int arc_reg_names_count
struct arc_operand_value arc_suffixes []
const int arc_suffixes_count
static struct arc_opcodeopcode_map [26+1]
static struct arc_opcodeicode_map [32]
static int cpu_type
static int flag_p
static int flagshimm_handled_p
static int addrwb_p
static int cond_p
static int nullify_p
static int nullify
static int jumpflags_p
static int shimm_p
static int shimm
static int limm_p
static long limm


Define Documentation

#define ADDRESS12   (ADDRESS3 + 1)

#define ADDRESS24   (ADDRESS12 + 1)

#define ADDRESS3   (SIGN9 + 1)

#define AUXREG   (REG + 1)

#define BASE   (LD_OFFSET + 1)

#define BRANCH   (FORCELIMM + 1)

#define CACHEBYPASS14   (CACHEBYPASS5 + 1)

#define CACHEBYPASS26   (CACHEBYPASS14 + 1)

#define CACHEBYPASS5   (ADDRESS24 + 1)

#define COND   (DELAY + 1)

#define DELAY   (FLAGINSN + 1)

#define EXTRACT_FN ( fn   ) 

Value:

static long fn PARAMS ((arc_insn *, const struct arc_operand *, \
      int, const struct arc_operand_value **, int *))

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

#define FLAG   (SYNTAX_LD + 1)

#define FLAGFINISH   (FLAG + 1)

#define FLAGINSN   (FLAGFINISH + 1)

#define FORCELIMM   (COND + 1)

#define INSERT_FN ( fn   ) 

Value:

static arc_insn fn PARAMS ((arc_insn, const struct arc_operand *, \
          int, const struct arc_operand_value *, long, \
          const char **))

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

#define JUMP   (BRANCH + 1)

Referenced by print_insn_pdp11(), and print_operand().

#define JUMPFLAGS   (JUMP + 1)

#define LD_OFFSET   (ST_OFFSET + 1)

#define LD_SYNTAX ( D,
B,
 ) 

Value:

((ls_operand[LS_DEST]  == (D) && \
  ls_operand[LS_BASE]   == (B) && \
  ls_operand[LS_OFFSET] == (O)))

Referenced by extract_ld_syntax(), and insert_ld_syntax().

#define LIMMFINISH   (SHIMMFINISH + 1)

#define LS_BASE   1

#define LS_DEST   0

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

Referenced by extract_ld_syntax(), extract_reg(), insert_ld_syntax(), and insert_reg().

#define LS_OFFSET   2

#define LS_VALUE   0

#define MODDOT   (UNOPMACRO + 1)

#define OPERANDS   3

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

Referenced by arc_opcode_init_insert().

#define REG   (MODDOT + 1)

#define REGA   (UNUSED + 1)

#define REGB   (REGA + 1)

#define REGC   (REGB + 1)

#define SHIMMFINISH   (REGC + 1)

#define SIGN0   (SIZE22 + 1)

#define SIGN9   (SIGN0 + 1)

#define SIZE1   (JUMPFLAGS + 1)

#define SIZE10   (SIZE1 + 1)

#define SIZE22   (SIZE10 + 1)

#define ST_OFFSET   (LIMMFINISH + 1)

#define ST_SYNTAX ( V,
B,
 ) 

Value:

((ls_operand[LS_VALUE]  == (V) && \
  ls_operand[LS_BASE]   == (B) && \
  ls_operand[LS_OFFSET] == (O)))

Referenced by extract_st_syntax(), and insert_st_syntax().

#define SYNTAX_LD   (SYNTAX_ST + 1)

#define SYNTAX_LD_NE   (SYNTAX_ST_NE + 1)

#define SYNTAX_ST   (SYNTAX_LD_NE + 1)

#define SYNTAX_ST_NE   (BASE + 1)

#define UNOPMACRO   (CACHEBYPASS26 + 1)

#define UNUSED   0


Enumeration Type Documentation

enum operand

Enumerator:
OP_NONE 
OP_REG 
OP_SHIMM 
OP_LIMM 

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


Function Documentation

int arc_get_noshortcut_flag ( void   ) 

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

References ARC_REGISTER_NOSHORT_CUT.

int arc_get_opcode_mach ( int  bfd_mach,
int  big_p 
)

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

References ARC_MACH_5, ARC_MACH_6, ARC_MACH_7, ARC_MACH_8, ARC_MACH_BIG, and bfd_mach_arc_5.

int arc_insn_is_j ( arc_insn  insn  ) 

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

References I.

int arc_insn_not_jl ( arc_insn  insn  ) 

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

References A, C, I, and R.

int arc_limm_fixup_adjust ( arc_insn  insn  ) 

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

References ARC_REG_LIMM, ARC_REG_SHIMM, B, C, and I.

Referenced by insert_st_syntax().

void arc_opcode_init_extract ( void   ) 

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

References arc_opcode_init_insert().

void arc_opcode_init_insert ( void   ) 

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

References i, ls_operand, OP_NONE, and OPERANDS.

Referenced by arc_opcode_init_extract().

void arc_opcode_init_tables ( int  flags  ) 

int arc_opcode_limm_p ( long limmp  ) 

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

struct arc_opcode* arc_opcode_lookup_asm ( char *  insn  )  const [read]

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

References ARC_HASH_OPCODE.

struct arc_opcode* arc_opcode_lookup_dis ( unsigned int  insn  )  [read]

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

References ARC_HASH_ICODE.

struct arc_operand_value* arc_opcode_lookup_suffix ( struct arc_operand type,
int  value 
) const [read]

int arc_opcode_supported ( struct arc_opcode opcode  )  const

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

References ARC_OPCODE_CPU.

int arc_operand_type ( int  opertype  ) 

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

References AUXREG, COND, and REG.

static long extract_cond ( arc_insn insn,
const struct arc_operand operand,
mods  ,
const struct arc_operand_value **  opval,
invalid   
) [static]

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

References arc_opcode_lookup_suffix(), arc_operand::bits, cond, NULL, arc_operand::shift, and val.

static long extract_flag ( arc_insn insn,
const struct arc_operand operand,
mods  ,
const struct arc_operand_value **  opval,
invalid   
) [static]

EXTRACT_FN ( extract_unopmacro   ) 

EXTRACT_FN ( extract_jumpflags   ) 

EXTRACT_FN ( extract_reladdr   ) 

EXTRACT_FN ( extract_cond   ) 

EXTRACT_FN ( extract_flag   ) 

EXTRACT_FN ( extract_st_syntax   ) 

EXTRACT_FN ( extract_st_offset   ) 

EXTRACT_FN ( extract_ld_syntax   ) 

EXTRACT_FN ( extract_ld_offset   ) 

EXTRACT_FN ( extract_reg   ) 

static long extract_jumpflags ( arc_insn insn,
const struct arc_operand operand,
mods  ,
opval  ,
int *  invalid 
) [static]

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

References arc_operand::bits, and arc_operand::shift.

static long extract_ld_offset ( arc_insn insn,
const struct arc_operand operand,
int  mods,
const struct arc_operand_value **  opval,
int *  invalid 
) [static]

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

References ARC_OPERAND_SIGNED, extract_reg(), arc_operand::flags, I, LS_OFFSET, ls_operand, and OP_SHIMM.

static long extract_ld_syntax ( arc_insn insn,
operand  ,
mods  ,
opval  ,
int *  invalid 
) [static]

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

References I, LD_SYNTAX, LS_BASE, LS_DEST, LS_OFFSET, ls_operand, OP_LIMM, OP_NONE, OP_REG, and OP_SHIMM.

static long extract_reg ( arc_insn insn,
const struct arc_operand operand,
int  mods,
const struct arc_operand_value **  opval,
invalid   
) [static]

static long extract_reladdr ( arc_insn insn,
const struct arc_operand operand,
mods  ,
opval  ,
invalid   
) [static]

static long extract_st_offset ( arc_insn insn,
const struct arc_operand operand,
mods  ,
opval  ,
int *  invalid 
) [static]

static long extract_st_syntax ( arc_insn insn,
operand  ,
mods  ,
opval  ,
int *  invalid 
) [static]

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

References OP_LIMM, OP_NONE, OP_REG, OP_SHIMM, and ST_SYNTAX.

static long extract_unopmacro ( arc_insn insn,
operand  ,
mods  ,
opval  ,
int *  invalid 
) [static]

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

References ARC_MASK_REG, ARC_SHIFT_REGB, ARC_SHIFT_REGC, and NULL.

struct arc_operand_value* get_ext_suffix ( char *  s  )  [read]

static arc_insn insert_absaddr ( arc_insn  insn,
operand  ,
mods  ,
reg  ,
value  ,
const char **  errmsg 
) [static]

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

References R.

static arc_insn insert_addr_wb ( arc_insn  insn,
const struct arc_operand operand,
mods  ,
reg  ,
value  ,
errmsg   
) [static]

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

References arc_operand::shift.

static arc_insn insert_base ( arc_insn  insn,
const struct arc_operand operand,
int  mods,
const struct arc_operand_value reg,
long  value,
const char **  errmsg 
) [static]

static arc_insn insert_cond ( arc_insn  insn,
const struct arc_operand operand,
mods  ,
reg  ,
long  value,
errmsg   
) [static]

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

References arc_operand::bits, and arc_operand::shift.

static arc_insn insert_flag ( arc_insn  insn,
operand  ,
mods  ,
reg  ,
value  ,
errmsg   
) [static]

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

static arc_insn insert_flagfinish ( arc_insn  insn,
const struct arc_operand operand,
mods  ,
reg  ,
value  ,
errmsg   
) [static]

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

References abort, and arc_operand::shift.

INSERT_FN ( insert_unopmacro   ) 

INSERT_FN ( insert_jumpflags   ) 

INSERT_FN ( insert_absaddr   ) 

INSERT_FN ( insert_reladdr   ) 

INSERT_FN ( insert_forcelimm   ) 

INSERT_FN ( insert_cond   ) 

INSERT_FN ( insert_flagfinish   ) 

INSERT_FN ( insert_nullify   ) 

INSERT_FN ( insert_flag   ) 

INSERT_FN ( insert_addr_wb   ) 

INSERT_FN ( insert_ld_syntax   ) 

INSERT_FN ( insert_st_syntax   ) 

INSERT_FN ( insert_base   ) 

INSERT_FN ( insert_offset   ) 

INSERT_FN ( insert_limmfinish   ) 

INSERT_FN ( insert_shimmfinish   ) 

INSERT_FN ( insert_reg   ) 

static arc_insn insert_forcelimm ( arc_insn  insn,
operand  ,
mods  ,
reg  ,
value  ,
errmsg   
) [static]

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

static arc_insn insert_jumpflags ( arc_insn  insn,
const struct arc_operand operand,
mods  ,
reg  ,
long  value,
const char **  errmsg 
) [static]

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

References arc_operand::bits, and arc_operand::shift.

static arc_insn insert_ld_syntax ( arc_insn  insn,
operand  ,
mods  ,
reg  ,
value  ,
const char **  errmsg 
) [static]

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

References I, LD_SYNTAX, LS_BASE, LS_DEST, LS_OFFSET, ls_operand, OP_LIMM, OP_NONE, OP_REG, and OP_SHIMM.

static arc_insn insert_limmfinish ( arc_insn  insn,
operand  ,
mods  ,
reg  ,
value  ,
errmsg   
) [static]

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

static arc_insn insert_nullify ( arc_insn  insn,
const struct arc_operand operand,
mods  ,
reg  ,
long  value,
errmsg   
) [static]

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

References arc_operand::bits, and arc_operand::shift.

static arc_insn insert_offset ( arc_insn  insn,
const struct arc_operand operand,
int  mods,
const struct arc_operand_value reg,
long  value,
const char **  errmsg 
) [static]

static arc_insn insert_reg ( arc_insn  insn,
const struct arc_operand operand,
int  mods,
const struct arc_operand_value reg,
long  value,
const char **  errmsg 
) [static]

static arc_insn insert_reladdr ( arc_insn  insn,
const struct arc_operand operand,
mods  ,
reg  ,
long  value,
const char **  errmsg 
) [static]

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

References arc_operand::bits, and arc_operand::shift.

static arc_insn insert_shimmfinish ( arc_insn  insn,
const struct arc_operand operand,
mods  ,
reg  ,
value  ,
errmsg   
) [static]

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

References arc_operand::bits, and arc_operand::shift.

static arc_insn insert_st_syntax ( arc_insn  insn,
operand  ,
mods  ,
reg  ,
value  ,
const char **  errmsg 
) [static]

static arc_insn insert_unopmacro ( arc_insn  insn,
const struct arc_operand operand,
mods  ,
reg  ,
value  ,
errmsg   
) [static]

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

References ARC_MASK_REG, ARC_SHIFT_REGB, and arc_operand::shift.

static struct arc_operand_value * lookup_register ( int  type,
long  regno 
) [static, read]


Variable Documentation

int addrwb_p [static]

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

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

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

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

const int arc_opcodes_count = sizeof (arc_opcodes) / sizeof (arc_opcodes[0])

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

unsigned char arc_operand_map[256]

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

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

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

Initial value:

  sizeof (arc_reg_names) / sizeof (arc_reg_names[0])

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

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

const int arc_suffixes_count

Initial value:

  sizeof (arc_suffixes) / sizeof (arc_suffixes[0])

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

int cond_p [static]

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

int cpu_type [static]

int flag_p [static]

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

int flagshimm_handled_p [static]

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

struct arc_opcode* icode_map[32] [static]

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

int jumpflags_p [static]

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

long limm [static]

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

int limm_p [static]

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

enum operand ls_operand[OPERANDS]

int nullify [static]

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

Referenced by output_bb(), output_bvb(), output_cbranch(), output_dbra(), and output_movb().

int nullify_p [static]

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

struct arc_opcode* opcode_map[26+1] [static]

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

int shimm [static]

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

int shimm_p [static]

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


Generated on Wed Apr 8 15:04:28 2009 for Open64 by  doxygen 1.5.6