Back to index

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

Go to the source code of this file.

Classes

struct  _symbol
struct  _template

Defines

#define INDIRECT(OP)   ((OP)&0x80)
#define MOD(OP)   (((OP)>>3)&0xF)
#define ARF(OP)   ((OP)&0x7)
#define IS_LKADDR(OP)   (INDIRECT(OP) && MOD(OP)>=12)
#define SRC(OP)   ((OP)&0x200)
#define DST(OP)   ((OP)&0x100)
#define SRC1(OP)   ((OP)&0x100)
#define SHIFT(OP)   (((OP)&0x10)?(((OP)&0x1F)-32):((OP)&0x1F))
#define SHFT(OP)   ((OP)&0xF)
#define ARX(OP)   ((OP)&0x7)
#define XMEM(OP)   (((OP)&0x00F0)>>4)
#define YMEM(OP)   ((OP)&0x000F)
#define XMOD(C)   (((C)&0xC)>>2)
#define XARX(C)   (((C)&0x3)+2)
#define CC3(OP)   (((OP)>>8)&0x3)
#define SBIT(OP)   ((OP)&0xF)
#define MMR(OP)   ((OP)&0x7F)
#define MMRX(OP)   ((((OP)>>4)&0xF)+16)
#define MMRY(OP)   (((OP)&0xF)+16)
#define OPTYPE(X)   ((X)&~OPT)
#define MAX_OPERANDS   4
#define B_NEXT   0 /* normal execution, next insn is next address */
#define B_BRANCH   1 /* next insn is in opcode */
#define B_RET   2 /* next insn is on stack */
#define B_BACC   3 /* next insn is in acc */
#define B_REPEAT   4 /* next insn repeats */
#define FL_BMASK   0x07
#define FL_DELAY   0x10 /* instruction uses delay slots */
#define FL_EXT   0x20 /* instruction takes two words */
#define FL_FAR   0x40 /* far mode addressing */
#define FL_LP   0x80 /* LP-only instruction */
#define FL_NR   0x100 /* no repeat allowed */
#define FL_SMR   0x200 /* Smem read (for flagging write-only *+ARx */
#define FL_PAR   0x400 /* Parallel instruction. */

Typedefs

typedef struct _symbol symbol
typedef struct _template template

Enumerations

enum  optype {
  OPT = 0x8000, OP_None = 0x0, OP_Xmem, OP_Ymem,
  OP_pmad, OP_dmad, OP_Smem, OP_Lmem,
  OP_MMR, OP_PA, OP_Sind, OP_xpmad,
  OP_xpmad_ms7, OP_MMRX, OP_MMRY, OP_SRC1,
  OP_SRC, OP_RND, OP_DST, OP_ARX,
  OP_SHIFT, OP_SHFT, OP_B, OP_A,
  OP_lk, OP_TS, OP_k8, OP_16,
  OP_BITC, OP_CC, OP_CC2, OP_CC3,
  OP_123, OP_031, OP_k5, OP_k8u,
  OP_ASM, OP_T, OP_DP, OP_ARP,
  OP_k3, OP_lku, OP_N, OP_SBIT,
  OP_12, OP_k9, OP_TRN
}

Functions

const templatetic54x_get_insn (struct disassemble_info *, bfd_vma, unsigned short, int *)

Variables

const template tic54x_unknown_opcode
const template tic54x_optab []
const template tic54x_paroptab []
const symbol mmregs []
const symbol regs []
const symbol condition_codes []
const symbol cc2_codes []
const symbol status_bits []
const symbol cc3_codes []
const char * misc_symbols []

Class Documentation

struct _symbol

Definition at line 25 of file tic54x.h.

Class Members
const char * name
unsigned short value
struct _template

Definition at line 216 of file tic30.h.

Class Members
unsigned int base_opcode
int imm_arg_type
unsigned short mask
unsigned short mask2
int maxops
int minops
const char * name
char * name
unsigned short opcode
unsigned short opcode2
unsigned int opcode_modifier
unsigned int operand_types
unsigned int operands
const char * parname
unsigned int words

Define Documentation

#define ARF (   OP)    ((OP)&0x7)

Definition at line 98 of file tic54x.h.

#define ARX (   OP)    ((OP)&0x7)

Definition at line 105 of file tic54x.h.

#define B_BACC   3 /* next insn is in acc */

Definition at line 132 of file tic54x.h.

#define B_BRANCH   1 /* next insn is in opcode */

Definition at line 130 of file tic54x.h.

#define B_NEXT   0 /* normal execution, next insn is next address */

Definition at line 129 of file tic54x.h.

#define B_REPEAT   4 /* next insn repeats */

Definition at line 133 of file tic54x.h.

#define B_RET   2 /* next insn is on stack */

Definition at line 131 of file tic54x.h.

#define CC3 (   OP)    (((OP)>>8)&0x3)

Definition at line 110 of file tic54x.h.

#define DST (   OP)    ((OP)&0x100)

Definition at line 101 of file tic54x.h.

#define FL_BMASK   0x07

Definition at line 134 of file tic54x.h.

#define FL_DELAY   0x10 /* instruction uses delay slots */

Definition at line 136 of file tic54x.h.

#define FL_EXT   0x20 /* instruction takes two words */

Definition at line 137 of file tic54x.h.

#define FL_FAR   0x40 /* far mode addressing */

Definition at line 138 of file tic54x.h.

#define FL_LP   0x80 /* LP-only instruction */

Definition at line 139 of file tic54x.h.

#define FL_NR   0x100 /* no repeat allowed */

Definition at line 140 of file tic54x.h.

#define FL_PAR   0x400 /* Parallel instruction. */

Definition at line 143 of file tic54x.h.

#define FL_SMR   0x200 /* Smem read (for flagging write-only *+ARx */

Definition at line 141 of file tic54x.h.

#define INDIRECT (   OP)    ((OP)&0x80)

Definition at line 96 of file tic54x.h.

#define IS_LKADDR (   OP)    (INDIRECT(OP) && MOD(OP)>=12)

Definition at line 99 of file tic54x.h.

#define MAX_OPERANDS   4

Definition at line 123 of file tic54x.h.

#define MMR (   OP)    ((OP)&0x7F)

Definition at line 112 of file tic54x.h.

#define MMRX (   OP)    ((((OP)>>4)&0xF)+16)

Definition at line 113 of file tic54x.h.

#define MMRY (   OP)    (((OP)&0xF)+16)

Definition at line 114 of file tic54x.h.

#define MOD (   OP)    (((OP)>>3)&0xF)

Definition at line 97 of file tic54x.h.

#define OPTYPE (   X)    ((X)&~OPT)

Definition at line 116 of file tic54x.h.

#define SBIT (   OP)    ((OP)&0xF)

Definition at line 111 of file tic54x.h.

#define SHFT (   OP)    ((OP)&0xF)

Definition at line 104 of file tic54x.h.

#define SHIFT (   OP)    (((OP)&0x10)?(((OP)&0x1F)-32):((OP)&0x1F))

Definition at line 103 of file tic54x.h.

#define SRC (   OP)    ((OP)&0x200)

Definition at line 100 of file tic54x.h.

#define SRC1 (   OP)    ((OP)&0x100)

Definition at line 102 of file tic54x.h.

#define XARX (   C)    (((C)&0x3)+2)

Definition at line 109 of file tic54x.h.

#define XMEM (   OP)    (((OP)&0x00F0)>>4)

Definition at line 106 of file tic54x.h.

#define XMOD (   C)    (((C)&0xC)>>2)

Definition at line 108 of file tic54x.h.

#define YMEM (   OP)    ((OP)&0x000F)

Definition at line 107 of file tic54x.h.


Typedef Documentation


Enumeration Type Documentation

enum optype
Enumerator:
OPT 
OP_None 
OP_Xmem 
OP_Ymem 
OP_pmad 
OP_dmad 
OP_Smem 
OP_Lmem 
OP_MMR 
OP_PA 
OP_Sind 
OP_xpmad 
OP_xpmad_ms7 
OP_MMRX 
OP_MMRY 
OP_SRC1 
OP_SRC 
OP_RND 
OP_DST 
OP_ARX 
OP_SHIFT 
OP_SHFT 
OP_B 
OP_A 
OP_lk 
OP_TS 
OP_k8 
OP_16 
OP_BITC 
OP_CC 
OP_CC2 
OP_CC3 
OP_123 
OP_031 
OP_k5 
OP_k8u 
OP_ASM 
OP_T 
OP_DP 
OP_ARP 
OP_k3 
OP_lku 
OP_N 
OP_SBIT 
OP_12 
OP_k9 
OP_TRN 

Definition at line 31 of file tic54x.h.

            {
  OPT = 0x8000,
  OP_None = 0x0,

  OP_Xmem, /* AR3 or AR4, indirect */
  OP_Ymem, /* AR3 or AR4, indirect */
  OP_pmad, /* PROG mem, direct */
  OP_dmad, /* DATA mem, direct */
  OP_Smem,
  OP_Lmem, /* 32-bit single-addressed (direct/indirect) */
  OP_MMR,
  OP_PA,
  OP_Sind,
  OP_xpmad,
  OP_xpmad_ms7,
  OP_MMRX,
  OP_MMRY,

  OP_SRC1, /* src accumulator in bit 8 */
  OP_SRC, /* src accumulator in bit 9 */
  OP_RND, /* rounded result dst accumulator, opposite of bit 8 */
  OP_DST, /* dst accumulator in bit 8 */
  OP_ARX, /* arX in bits 0-3 */
  OP_SHIFT, /* -16 to 15 (SHIFT), bits 0-4 */
  OP_SHFT, /*   0 to 15 (SHIFT1 in summary), bits 0-3 */
  OP_B, /* ACC B only */
  OP_A, /* ACC A only */

  OP_lk, /* 16-bit immediate, '#' optional */
  OP_TS,
  OP_k8, /* -128 <= k <= 128 */
  OP_16, /* literal "16" */
  OP_BITC, /* 0 to 16 */
  OP_CC, /* condition code */
  OP_CC2, /* 4-bit condition code */
  OP_CC3, /* 2-bit condition code */
  OP_123, /* 1, 2, or 3 */
  OP_031, /* 0-31, numeric */
  OP_k5, /* 0 to 31 */
  OP_k8u, /* 0 to 255 */
  OP_ASM, /* "ASM" */
  OP_T, /* "T" */
  OP_DP, /* "DP" */
  OP_ARP, /* "ARP" */
  OP_k3, /* 0-7 */
  OP_lku, /* 0 to 65535 */
  OP_N, /* 0/1 or ST0/ST1 */
  OP_SBIT, /* status bit or 0-15 */
  OP_12, /* one or two */
  OP_k9, /* 9 bits of data page (DP) address */
  OP_TRN, /* "TRN" */

};

Function Documentation

Definition at line 101 of file tic54x-dis.c.

{
  const template *tm = NULL;

  for (tm = tic54x_optab; tm->name; tm++)
  {
    if (tm->opcode == (memdata & tm->mask))
    {
      /* a few opcodes span two words */
      if (tm->flags & FL_EXT)
        {
          /* if lk addressing is used, the second half of the opcode gets
             pushed one word later */
          bfd_byte opbuf[2];
          bfd_vma addr2 = addr + 1 + has_lkaddr (memdata, tm);
          int status = (*info->read_memory_func) (addr2, opbuf, 2, info);
          // FIXME handle errors
          if (status == 0)
            {
              unsigned short data2 = bfd_getl16 (opbuf);
              if (tm->opcode2 == (data2 & tm->mask2))
                {
                  if (size) *size = get_insn_size (memdata, tm);
                  return tm;
                }
            }
        }
      else
        {
          if (size) *size = get_insn_size (memdata, tm);
          return tm;
        }
    }
  }
  for (tm = (template *) tic54x_paroptab; tm->name; tm++)
  {
    if (tm->opcode == (memdata & tm->mask))
    {
      if (size) *size = get_insn_size (memdata, tm);
      return tm;
    }
  }

  if (size) *size = 1;
  return &tic54x_unknown_opcode;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 156 of file tic54x-opc.c.

Definition at line 173 of file tic54x-opc.c.

Definition at line 112 of file tic54x-opc.c.

Definition at line 210 of file tic54x-opc.c.

Definition at line 39 of file tic54x-opc.c.

Definition at line 25 of file tic54x-opc.c.

Definition at line 190 of file tic54x-opc.c.

Definition at line 234 of file tic54x-opc.c.

Definition at line 466 of file tic54x-opc.c.

Definition at line 232 of file tic54x-opc.c.