osprey/cygnus/opcodes/sparc-dis.c File Reference

#include <stdio.h>
#include "sysdep.h"
#include "opcode/sparc.h"
#include "dis-asm.h"
#include "libiberty.h"
#include "opintl.h"

Include dependency graph for sparc-dis.c:

Go to the source code of this file.

Data Types

type  opcode_hash

Defines

#define MASK_V9
#define V9_ONLY_P(insn)   (! ((insn)->architecture & ~MASK_V9))
#define V9_P(insn)   (((insn)->architecture & MASK_V9) != 0)
#define HASH_SIZE   256
#define HASH_INSN(INSN)   ((((INSN) >> 24) & 0xc0) | (((INSN) & opcode_bits[((INSN) >> 30) & 3]) >> 19))
#define SEX(value, bits)
#define freg_names   (&reg_names[4 * 8])
#define X_RD(i)   (((i) >> 25) & 0x1f)
#define X_RS1(i)   (((i) >> 14) & 0x1f)
#define X_LDST_I(i)   (((i) >> 13) & 1)
#define X_ASI(i)   (((i) >> 5) & 0xff)
#define X_RS2(i)   (((i) >> 0) & 0x1f)
#define X_IMM(i, n)   (((i) >> 0) & ((1 << (n)) - 1))
#define X_SIMM(i, n)   SEX (X_IMM ((i), (n)), (n))
#define X_DISP22(i)   (((i) >> 0) & 0x3fffff)
#define X_IMM22(i)   X_DISP22 (i)
#define X_DISP30(i)   (((i) >> 0) & 0x3fffffff)
#define X_DISP16(i)   (((((i) >> 20) & 3) << 14) | (((i) >> 0) & 0x3fff))
#define X_DISP19(i)   (((i) >> 0) & 0x7ffff)
#define X_MEMBAR(i)   ((i) & 0x7f)
#define reg(n)   (*info->fprintf_func) (stream, "%%%s", reg_names[n])
#define freg(n)   (*info->fprintf_func) (stream, "%%%s", freg_names[n])
#define fregx(n)   (*info->fprintf_func) (stream, "%%%s", freg_names[((n) & ~1) | (((n) & 1) << 5)])
#define creg(n)   (*info->fprintf_func) (stream, "%%c%u", (unsigned int) (n))

Functions/Subroutines

static void build_hash_table PARAMS ((const struct sparc_opcode **, struct opcode_hash **, int))
static int is_delayed_branch PARAMS ((unsigned long))
static int compare_opcodes PARAMS ((const PTR, const PTR))
static int is_delayed_branch (unsigned long insn)
int print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
static int compute_arch_mask (unsigned long mach)
static int compare_opcodes (PTR a, const PTR b) const
static void build_hash_table (struct sparc_opcode **opcode_table, struct opcode_hash **hash_table, int num_opcodes) const

Variables

static struct sparc_opcode ** sorted_opcodes
static int opcode_bits [4] = { 0x01c00000, 0x0, 0x01f80000, 0x01f80000 }
static struct opcode_hashopcode_hash_table [HASH_SIZE]
static char * reg_names []
static char * v9_priv_reg_names []
static char * v9a_asr_reg_names []
static unsigned int current_arch_mask


Define Documentation

#define creg ( n   )     (*info->fprintf_func) (stream, "%%c%u", (unsigned int) (n))

Referenced by main(), and print_insn_sparc().

#define freg ( n   )     (*info->fprintf_func) (stream, "%%%s", freg_names[n])

Referenced by print_insn_sparc().

#define freg_names   (&reg_names[4 * 8])

Definition at line 88 of file sparc-dis.c.

#define fregx ( n   )     (*info->fprintf_func) (stream, "%%%s", freg_names[((n) & ~1) | (((n) & 1) << 5)])

Referenced by print_insn_sparc().

#define HASH_INSN ( INSN   )     ((((INSN) >> 24) & 0xc0) | (((INSN) & opcode_bits[((INSN) >> 30) & 3]) >> 19))

Definition at line 51 of file sparc-dis.c.

Referenced by build_hash_table(), is_delayed_branch(), and print_insn_sparc().

#define HASH_SIZE   256

Definition at line 46 of file sparc-dis.c.

#define MASK_V9

Value:

Definition at line 32 of file sparc-dis.c.

Referenced by sparc_override_options().

#define reg ( n   )     (*info->fprintf_func) (stream, "%%%s", reg_names[n])

#define SEX ( value,
bits   ) 

Value:

((((int)(value)) << ((8 * sizeof (int)) - bits))  \
       >> ((8 * sizeof (int)) - bits) )

Definition at line 67 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define V9_ONLY_P ( insn   )     (! ((insn)->architecture & ~MASK_V9))

Definition at line 36 of file sparc-dis.c.

#define V9_P ( insn   )     (((insn)->architecture & MASK_V9) != 0)

Definition at line 38 of file sparc-dis.c.

#define X_ASI ( i   )     (((i) >> 5) & 0xff)

Definition at line 114 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_DISP16 ( i   )     (((((i) >> 20) & 3) << 14) | (((i) >> 0) & 0x3fff))

Definition at line 123 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_DISP19 ( i   )     (((i) >> 0) & 0x7ffff)

Definition at line 124 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_DISP22 ( i   )     (((i) >> 0) & 0x3fffff)

Definition at line 118 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_DISP30 ( i   )     (((i) >> 0) & 0x3fffffff)

Definition at line 120 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_IMM ( i,
n   )     (((i) >> 0) & ((1 << (n)) - 1))

Definition at line 116 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_IMM22 ( i   )     X_DISP22 (i)

Definition at line 119 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_LDST_I ( i   )     (((i) >> 13) & 1)

Definition at line 113 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_MEMBAR ( i   )     ((i) & 0x7f)

Definition at line 125 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_RD ( i   )     (((i) >> 25) & 0x1f)

Definition at line 111 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_RS1 ( i   )     (((i) >> 14) & 0x1f)

Definition at line 112 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_RS2 ( i   )     (((i) >> 0) & 0x1f)

Definition at line 115 of file sparc-dis.c.

Referenced by print_insn_sparc().

#define X_SIMM ( i,
n   )     SEX (X_IMM ((i), (n)), (n))

Definition at line 117 of file sparc-dis.c.

Referenced by print_insn_sparc().


Function Documentation

static void build_hash_table ( struct sparc_opcode **  opcode_table,
struct opcode_hash **  hash_table,
int  num_opcodes 
) const [static]

static int compare_opcodes ( PTR  a,
const PTR  b 
) const [static]

static int compute_arch_mask ( unsigned long  mach  )  [static]

static int is_delayed_branch ( unsigned long  insn  )  [static]

static int compare_opcodes PARAMS ( (const PTR, const PTR  )  [static]

static int is_delayed_branch PARAMS ( (unsigned long  )  [static]

static void build_hash_table PARAMS ( (const struct sparc_opcode **, struct opcode_hash **, int)   )  [static]

int print_insn_sparc ( bfd_vma  memaddr,
disassemble_info info 
)


Variable Documentation

unsigned int current_arch_mask [static]

Definition at line 208 of file sparc-dis.c.

int opcode_bits[4] = { 0x01c00000, 0x0, 0x01f80000, 0x01f80000 } [static]

Definition at line 50 of file sparc-dis.c.

struct opcode_hash* opcode_hash_table[HASH_SIZE] [static]

Definition at line 58 of file sparc-dis.c.

char* reg_names[] [static]

Initial value:

{ "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", 
  "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", 
  "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", 
  "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", 
  "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", 
  "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", 
  "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23",
  "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
  "f32", "f33", "f34", "f35", "f36", "f37", "f38", "f39", 
  "f40", "f41", "f42", "f43", "f44", "f45", "f46", "f47", 
  "f48", "f49", "f50", "f51", "f52", "f53", "f54", "f55",
  "f56", "f57", "f58", "f59", "f60", "f61", "f62", "f63",

  "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr"
}

Definition at line 71 of file sparc-dis.c.

Definition at line 41 of file sparc-dis.c.

char* v9_priv_reg_names[] [static]

Initial value:

{
  "tpc", "tnpc", "tstate", "tt", "tick", "tba", "pstate", "tl",
  "pil", "cwp", "cansave", "canrestore", "cleanwin", "otherwin",
  "wstate", "fq"
  
}

Definition at line 92 of file sparc-dis.c.

char* v9a_asr_reg_names[] [static]

Initial value:

{
  "pcr", "pic", "dcr", "gsr", "set_softint", "clear_softint",
  "softint", "tick_cmpr", "sys_tick", "sys_tick_cmpr"
}

Definition at line 102 of file sparc-dis.c.


Generated on Wed Apr 8 15:06:08 2009 for Open64 by  doxygen 1.5.6