Back to index

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

Go to the source code of this file.

Classes

struct  tic80_opcode
struct  tic80_operand
struct  predefined_symbol

Defines

#define TIC80_OPERAND_EVEN   (1 << 0)
#define TIC80_OPERAND_ODD   (1 << 1)
#define TIC80_OPERAND_SIGNED   (1 << 2)
#define TIC80_OPERAND_NUM   (1 << 3)
#define TIC80_OPERAND_PARENS   (1 << 4)
#define TIC80_OPERAND_PCREL   (1 << 5)
#define TIC80_OPERAND_BITFIELD   (1 << 6)
#define TIC80_OPERAND_M_SI   (1 << 7)
#define TIC80_OPERAND_M_LI   (1 << 8)
#define TIC80_OPERAND_SCALED   (1 << 9)
#define TIC80_OPERAND_FLOAT   (1 << 10)
#define TIC80_OPERAND_BASEREL   (1 << 11)
#define TIC80_OPERAND_ENDMASK   (1 << 12)
#define TIC80_OPERAND_GPR   (1 << 27)
#define TIC80_OPERAND_FPA   ( 1 << 28)
#define TIC80_OPERAND_CR   (1 << 29)
#define TIC80_OPERAND_CC   (1 << 30)
#define TIC80_OPERAND_BITNUM   (1 << 31)
#define TIC80_OPERAND_MASK   (TIC80_OPERAND_GPR | TIC80_OPERAND_FPA | TIC80_OPERAND_CR | TIC80_OPERAND_CC | TIC80_OPERAND_BITNUM)
#define TIC80_VECTOR   01 /* Is a vector instruction */
#define TIC80_NO_R0_DEST   02 /* Register r0 cannot be a destination register */
#define PDS_NAME(pdsp)   ((pdsp) -> name)
#define PDS_VALUE(pdsp)   ((pdsp) -> value)

Functions

const char * tic80_value_to_symbol (int val, int class)
int tic80_symbol_to_value (char *name, int class)
struct predefined_symboltic80_next_predefined_symbol (const struct predefined_symbol *)

Variables

const int tic80_num_opcodes
const int tic80_num_predefined_symbols

Class Documentation

struct tic80_opcode

Definition at line 26 of file tic80.h.

Class Members
unsigned char flags
unsigned long mask
const char * name
unsigned long opcode
unsigned char operands
struct predefined_symbol

Definition at line 259 of file tic80.h.

Class Members
char * name
int value

Define Documentation

#define PDS_NAME (   pdsp)    ((pdsp) -> name)

Definition at line 265 of file tic80.h.

#define PDS_VALUE (   pdsp)    ((pdsp) -> value)

Definition at line 266 of file tic80.h.

#define TIC80_NO_R0_DEST   02 /* Register r0 cannot be a destination register */

Definition at line 251 of file tic80.h.

#define TIC80_OPERAND_BASEREL   (1 << 11)

Definition at line 201 of file tic80.h.

#define TIC80_OPERAND_BITFIELD   (1 << 6)

Definition at line 176 of file tic80.h.

#define TIC80_OPERAND_BITNUM   (1 << 31)

Definition at line 240 of file tic80.h.

#define TIC80_OPERAND_CC   (1 << 30)

Definition at line 232 of file tic80.h.

#define TIC80_OPERAND_CR   (1 << 29)

Definition at line 226 of file tic80.h.

#define TIC80_OPERAND_ENDMASK   (1 << 12)

Definition at line 210 of file tic80.h.

#define TIC80_OPERAND_EVEN   (1 << 0)

Definition at line 140 of file tic80.h.

#define TIC80_OPERAND_FLOAT   (1 << 10)

Definition at line 195 of file tic80.h.

#define TIC80_OPERAND_FPA   ( 1 << 28)

Definition at line 220 of file tic80.h.

#define TIC80_OPERAND_GPR   (1 << 27)

Definition at line 215 of file tic80.h.

#define TIC80_OPERAND_M_LI   (1 << 8)

Definition at line 186 of file tic80.h.

#define TIC80_OPERAND_M_SI   (1 << 7)

Definition at line 181 of file tic80.h.

Definition at line 245 of file tic80.h.

#define TIC80_OPERAND_NUM   (1 << 3)

Definition at line 156 of file tic80.h.

#define TIC80_OPERAND_ODD   (1 << 1)

Definition at line 146 of file tic80.h.

#define TIC80_OPERAND_PARENS   (1 << 4)

Definition at line 163 of file tic80.h.

#define TIC80_OPERAND_PCREL   (1 << 5)

Definition at line 169 of file tic80.h.

#define TIC80_OPERAND_SCALED   (1 << 9)

Definition at line 191 of file tic80.h.

#define TIC80_OPERAND_SIGNED   (1 << 2)

Definition at line 150 of file tic80.h.

#define TIC80_VECTOR   01 /* Is a vector instruction */

Definition at line 250 of file tic80.h.


Function Documentation

int tic80_symbol_to_value ( char *  name,
int  class 
)

Definition at line 236 of file tic80-opc.c.

{
  const struct predefined_symbol *pdsp;
  int low = 0;
  int middle;
  int high = tic80_num_predefined_symbols - 1;
  int cmp;
  int rtnval = -1;

  while (low <= high)
    {
      middle = (low + high) / 2;
      cmp = strcasecmp (name, tic80_predefined_symbols[middle].name);
      if (cmp < 0)
       {
         high = middle - 1;
       }
      else if (cmp > 0)
       {
         low = middle + 1;
       }
      else 
       {
         pdsp = &tic80_predefined_symbols[middle];
         if ((class == 0) || (class & PDS_VALUE (pdsp)))
           {
             rtnval = PDS_VALUE (pdsp);
           }
         /* For now we assume that there are no duplicate names */
         break;
       }
    }
  return (rtnval);
}

Here is the call graph for this function:

const char* tic80_value_to_symbol ( int  val,
int  class 
)

Definition at line 278 of file tic80-opc.c.

{
  const struct predefined_symbol *pdsp;
  int ival;
  char *name;

  name = NULL;
  for (pdsp = tic80_predefined_symbols;
       pdsp < tic80_predefined_symbols + tic80_num_predefined_symbols;
       pdsp++)
    {
      ival = PDS_VALUE (pdsp) & ~TIC80_OPERAND_MASK;
      if (ival == val)
       {
         if ((class == 0) || (class & PDS_VALUE (pdsp)))
           {
             /* Found the desired match */
             name = PDS_NAME (pdsp);
             break;
           }
       }
    }
  return (name);
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 1216 of file tic80-opc.c.

Definition at line 216 of file tic80-opc.c.