Back to index

cell-binutils  2.17cvs20070401
Defines | Enumerations | Functions | Variables
arc-opc.c File Reference
#include "sysdep.h"
#include <stdio.h>
#include "ansidecl.h"
#include "bfd.h"
#include "opcode/arc.h"
#include "opintl.h"

Go to the source code of this file.

Defines

#define OPERANDS   3
#define LS_VALUE   0
#define LS_DEST   0
#define LS_BASE   1
#define LS_OFFSET   2
#define INSERT_FN(fn)
#define EXTRACT_FN(fn)
#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

 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)
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, const struct arc_operand *operand ATTRIBUTE_UNUSED, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static arc_insn insert_nullify (arc_insn insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value, const char **errmsg ATTRIBUTE_UNUSED)
static arc_insn insert_flagfinish (arc_insn insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static arc_insn insert_cond (arc_insn insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value, const char **errmsg ATTRIBUTE_UNUSED)
static arc_insn insert_forcelimm (arc_insn insn, const struct arc_operand *operand ATTRIBUTE_UNUSED, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static arc_insn insert_addr_wb (arc_insn insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
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, const struct arc_operand *operand ATTRIBUTE_UNUSED, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value **opval ATTRIBUTE_UNUSED, int *invalid)
int arc_limm_fixup_adjust (arc_insn insn)
static arc_insn insert_st_syntax (arc_insn insn, const struct arc_operand *operand ATTRIBUTE_UNUSED, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg)
static arc_insn insert_ld_syntax (arc_insn insn, const struct arc_operand *operand ATTRIBUTE_UNUSED, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg)
static long extract_ld_syntax (arc_insn *insn, const struct arc_operand *operand ATTRIBUTE_UNUSED, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value **opval ATTRIBUTE_UNUSED, int *invalid)
static arc_insn insert_shimmfinish (arc_insn insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static arc_insn insert_limmfinish (arc_insn insn, const struct arc_operand *operand ATTRIBUTE_UNUSED, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static arc_insn insert_jumpflags (arc_insn insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value, const char **errmsg)
static arc_insn insert_unopmacro (arc_insn insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED)
static arc_insn insert_reladdr (arc_insn insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value, const char **errmsg)
static arc_insn insert_absaddr (arc_insn insn, const struct arc_operand *operand ATTRIBUTE_UNUSED, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value *reg ATTRIBUTE_UNUSED, long value ATTRIBUTE_UNUSED, const char **errmsg)
void arc_opcode_init_extract (void)
static struct arc_operand_valuelookup_register (int type, long regno)
static long extract_reg (arc_insn *insn, const struct arc_operand *operand, int mods, const struct arc_operand_value **opval, int *invalid ATTRIBUTE_UNUSED)
static long extract_flag (arc_insn *insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value **opval, int *invalid ATTRIBUTE_UNUSED)
static long extract_cond (arc_insn *insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value **opval, int *invalid ATTRIBUTE_UNUSED)
static long extract_reladdr (arc_insn *insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value **opval ATTRIBUTE_UNUSED, int *invalid ATTRIBUTE_UNUSED)
static long extract_jumpflags (arc_insn *insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value **opval ATTRIBUTE_UNUSED, int *invalid)
static long extract_st_offset (arc_insn *insn, const struct arc_operand *operand, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value **opval ATTRIBUTE_UNUSED, 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, const struct arc_operand *operand ATTRIBUTE_UNUSED, int mods ATTRIBUTE_UNUSED, const struct arc_operand_value **opval ATTRIBUTE_UNUSED, int *invalid)
int arc_get_opcode_mach (int bfd_mach, int big_p)
void arc_opcode_init_tables (int flags)
int arc_opcode_supported (const struct arc_opcode *opcode)
struct arc_opcodearc_opcode_lookup_asm (const char *insn)
struct arc_opcodearc_opcode_lookup_dis (unsigned int insn)
void arc_opcode_init_insert (void)
int arc_opcode_limm_p (long *limmp)
struct arc_operand_valuearc_opcode_lookup_suffix (const struct arc_operand *type, int value)
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 (void)

Variables

enum operand[OPERANDS] struct
arc_opcode
arc_ext_opcodes
struct arc_ext_operand_valuearc_ext_operands
unsigned char arc_operand_map [256]
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
const int arc_opcodes_count = sizeof (arc_opcodes) / sizeof (arc_opcodes[0])
const int arc_reg_names_count
const int arc_suffixes_count
static struct arc_opcodeopcode_map [26+1]
static struct arc_opcodeicode_map [32]
static int cpu_type

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 (arc_insn *, const struct arc_operand *, \
              int, const struct arc_operand_value **, int *)

Definition at line 86 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 (arc_insn, const struct arc_operand *, \
                  int, const struct arc_operand_value *, long, \
                  const char **)

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

#define JUMP   (BRANCH + 1)
#define JUMPFLAGS   (JUMP + 1)
#define LD_OFFSET   (ST_OFFSET + 1)
#define LD_SYNTAX (   D,
  B,
  O 
)
Value:
(   (ls_operand[LS_DEST]   == (D) \
    && ls_operand[LS_BASE]   == (B) \
    && ls_operand[LS_OFFSET] == (O)))
#define LIMMFINISH   (SHIMMFINISH + 1)
#define LS_BASE   1

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

#define LS_DEST   0

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

#define LS_OFFSET   2

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

#define LS_VALUE   0

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

#define MODDOT   (UNOPMACRO + 1)
#define OPERANDS   3

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

#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,
  O 
)
Value:
((ls_operand[LS_VALUE]  == (V) && \
  ls_operand[LS_BASE]   == (B) && \
  ls_operand[LS_OFFSET] == (O)))
#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 27 of file arc-opc.c.


Function Documentation

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

Here is the caller graph for this function:

int arc_get_opcode_mach ( int  bfd_mach,
int  big_p 
)

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:

void arc_opcode_init_tables ( int  flags)

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:

int arc_opcode_limm_p ( long limmp)

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

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

Here is the caller graph for this function:

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

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:

int arc_operand_type ( int  opertype)

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:

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

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

{
  long cond;
  const struct arc_operand_value *val;

  if (flagshimm_handled_p)
    return 0;

  cond = (*insn >> operand->shift) & ((1 << operand->bits) - 1);
  val = arc_opcode_lookup_suffix (operand, cond);

  /* Ignore NULL values of `val'.  Several condition code values are
     reserved for extensions.  */
  if (opval != NULL && val != NULL)
    *opval = val;
  return cond;
}

Here is the call graph for this function:

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

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

{
  int f;
  const struct arc_operand_value *val;

  if (flagshimm_handled_p)
    f = flag_p != 0;
  else
    f = (*insn & (1 << operand->shift)) != 0;

  /* There is no text for zero values.  */
  if (f == 0)
    return 0;
  flag_p = 1;
  val = arc_opcode_lookup_suffix (operand, 1);
  if (opval != NULL && val != NULL)
    *opval = val;
  return val->value;
}

Here is the call graph for this function:

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

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

{
  if (!flag_p || !limm_p)
    *invalid = 1;
  return ((flag_p && limm_p)
         ? (insn[1] >> operand->shift) & ((1 << operand->bits) -1): 0);
}
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 1302 of file arc-opc.c.

{
  int test = insn[0] & I(-1);
  int value;

  if (test)
    {
      value = insn[0] & 511;
      if ((operand->flags & ARC_OPERAND_SIGNED) && (value & 256))
       value -= 512;
      if (value)
       ls_operand[LS_OFFSET] = OP_SHIMM;

      return value;
    }
  /* If it isn't in the insn, it's concealed behind reg 'c'.  */
  return extract_reg (insn, &arc_operands[arc_operand_map['c']],
                    mods, opval, invalid);
}

Here is the call graph for this function:

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

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

{
  int test = insn[0] & I(-1);

  if (!(test == I(1)))
    {
      if ((ls_operand[LS_DEST] == OP_SHIMM || ls_operand[LS_BASE] == OP_SHIMM
          || ls_operand[LS_OFFSET] == OP_SHIMM))
       *invalid = 1;
    }
  if (!(   (LD_SYNTAX (OP_REG, OP_REG, OP_NONE) && (test == I(1)))
       ||  LD_SYNTAX (OP_REG, OP_REG, OP_REG)
       ||  LD_SYNTAX (OP_REG, OP_REG, OP_SHIMM)
       || (LD_SYNTAX (OP_REG, OP_REG, OP_LIMM) && !(test == I(1)))
       || (LD_SYNTAX (OP_REG, OP_LIMM, OP_REG) && !(test == I(1)))
       || (LD_SYNTAX (OP_REG, OP_SHIMM, OP_NONE) && (shimm == 0))
       ||  LD_SYNTAX (OP_REG, OP_SHIMM, OP_SHIMM)
       || (LD_SYNTAX (OP_REG, OP_LIMM, OP_NONE) && (test == I(1)))))
    *invalid = 1;
  return 0;
}
static long extract_reg ( arc_insn insn,
const struct arc_operand operand,
int  mods,
const struct arc_operand_value **  opval,
int *invalid  ATTRIBUTE_UNUSED 
) [static]

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

{
  int regno;
  long value;
  enum operand op_type;

  /* Get the register number.  */
  regno = (*insn >> operand->shift) & ((1 << operand->bits) - 1);

  /* Is it a constant marker?  */
  if (regno == ARC_REG_SHIMM)
    {
      op_type = OP_SHIMM;
      /* Always return zero if dest is a shimm  mlm.  */

      if ('a' != operand->fmt)
       {
         value = *insn & 511;
         if ((operand->flags & ARC_OPERAND_SIGNED)
             && (value & 256))
           value -= 512;
         if (!flagshimm_handled_p)
           flag_p = 0;
         flagshimm_handled_p = 1;
       }
      else
       value = 0;
    }
  else if (regno == ARC_REG_SHIMM_UPDATE)
    {
      op_type = OP_SHIMM;

      /* Always return zero if dest is a shimm  mlm.  */
      if ('a' != operand->fmt)
       {
         value = *insn & 511;
         if ((operand->flags & ARC_OPERAND_SIGNED) && (value & 256))
           value -= 512;
       }
      else
       value = 0;

      flag_p = 1;
      flagshimm_handled_p = 1;
    }
  else if (regno == ARC_REG_LIMM)
    {
      op_type = OP_LIMM;
      value = insn[1];
      limm_p = 1;

      /* If this is a jump instruction (j,jl), show new pc correctly.  */
      if (0x07 == ((*insn & I(-1)) >> 27))
       value = (value & 0xffffff);
    }

  /* It's a register, set OPVAL (that's the only way we distinguish registers
     from constants here).  */
  else
    {
      const struct arc_operand_value *reg = lookup_register (REG, regno);

      op_type = OP_REG;

      if (reg == NULL)
       abort ();
      if (opval != NULL)
       *opval = reg;
      value = regno;
    }

  /* If this field takes an auxiliary register, see if it's a known one.  */
  if ((mods & ARC_MOD_AUXREG)
      && ARC_REG_CONSTANT_P (regno))
    {
      const struct arc_operand_value *reg = lookup_register (AUXREG, value);

      /* This is really a constant, but tell the caller it has a special
        name.  */
      if (reg != NULL && opval != NULL)
       *opval = reg;
    }

  switch(operand->fmt)
    {
    case 'a':
      ls_operand[LS_DEST] = op_type;
      break;
    case 's':
      ls_operand[LS_BASE] = op_type;
      break;
    case 'c':
      if ((insn[0]& I(-1)) == I(2))
       ls_operand[LS_VALUE] = op_type;
      else
       ls_operand[LS_OFFSET] = op_type;
      break;
    case 'o': case 'O':
      ls_operand[LS_OFFSET] = op_type;
      break;
    }

  return value;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

{
  long addr;

  addr = (*insn >> operand->shift) & ((1 << operand->bits) - 1);
  if ((operand->flags & ARC_OPERAND_SIGNED)
      && (addr & (1 << (operand->bits - 1))))
    addr -= 1 << operand->bits;
  return addr << 2;
}
static long extract_st_offset ( arc_insn insn,
const struct arc_operand operand,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value **opval  ATTRIBUTE_UNUSED,
int invalid 
) [static]

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

{
  int value = 0;

  if (ls_operand[LS_VALUE] != OP_SHIMM || ls_operand[LS_BASE] != OP_LIMM)
    {
      value = insn[0] & 511;
      if ((operand->flags & ARC_OPERAND_SIGNED) && (value & 256))
       value -= 512;
      if (value)
       ls_operand[LS_OFFSET] = OP_SHIMM;
    }
  else
    *invalid = 1;

  return value;
}
static long extract_st_syntax ( arc_insn insn,
const struct arc_operand *operand  ATTRIBUTE_UNUSED,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value **opval  ATTRIBUTE_UNUSED,
int invalid 
) [static]

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

{
#define ST_SYNTAX(V,B,O) \
((ls_operand[LS_VALUE]  == (V) && \
  ls_operand[LS_BASE]   == (B) && \
  ls_operand[LS_OFFSET] == (O)))

  if (!((ST_SYNTAX(OP_REG,OP_REG,OP_NONE) && (insn[0] & 511) == 0)
       || ST_SYNTAX(OP_REG,OP_LIMM,OP_NONE)
       || (ST_SYNTAX(OP_SHIMM,OP_REG,OP_NONE) && (insn[0] & 511) == 0)
       || (ST_SYNTAX(OP_SHIMM,OP_SHIMM,OP_NONE) && (insn[0] & 511) == 0)
       || ST_SYNTAX(OP_SHIMM,OP_LIMM,OP_NONE)
       || ST_SYNTAX(OP_SHIMM,OP_LIMM,OP_SHIMM)
       || ST_SYNTAX(OP_SHIMM,OP_SHIMM,OP_SHIMM)
       || (ST_SYNTAX(OP_LIMM,OP_REG,OP_NONE) && (insn[0] & 511) == 0)
       || ST_SYNTAX(OP_REG,OP_REG,OP_SHIMM)
       || ST_SYNTAX(OP_REG,OP_SHIMM,OP_SHIMM)
       || ST_SYNTAX(OP_SHIMM,OP_REG,OP_SHIMM)
       || ST_SYNTAX(OP_LIMM,OP_SHIMM,OP_SHIMM)
       || ST_SYNTAX(OP_LIMM,OP_SHIMM,OP_NONE)
       || ST_SYNTAX(OP_LIMM,OP_REG,OP_SHIMM)))
    *invalid = 1;
  return 0;
}
static long extract_unopmacro ( arc_insn insn,
const struct arc_operand *operand  ATTRIBUTE_UNUSED,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value **opval  ATTRIBUTE_UNUSED,
int invalid 
) [static]

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

{
  /* This misses the case where B == ARC_REG_SHIMM_UPDATE &&
     C == ARC_REG_SHIMM (or vice versa).  No big deal.  Those insns will get
     printed as "and"s.  */
  if (((*insn >> ARC_SHIFT_REGB) & ARC_MASK_REG)
      != ((*insn >> ARC_SHIFT_REGC) & ARC_MASK_REG))
    if (invalid != NULL)
      *invalid = 1;
  return 0;
}
struct arc_operand_value* get_ext_suffix ( char *  s) [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:

Here is the caller graph for this function:

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

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

{
  if (limm_p)
    {
      /* If it is a jump and link, .jd must be specified.  */
      if (insn & R (-1, 9, 1))
       {
         if (!nullify_p)
           insn |=  0x02 << 5;  /* Default nullify to .jd.  */

         else if (nullify != 0x02)
           *errmsg = _("must specify .jd or no nullify suffix");
       }
    }
  return insn;
}
static arc_insn insert_addr_wb ( arc_insn  insn,
const struct arc_operand operand,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

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

{
  addrwb_p = 1 << operand->shift;
  return insn;
}
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]

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

{
  if (reg != NULL)
    {
      arc_insn myinsn;
      myinsn = insert_reg (0, operand,mods, reg, value, errmsg) >> operand->shift;
      insn |= B(myinsn);
      ls_operand[LS_BASE] = OP_REG;
    }
  else if (ARC_SHIMM_CONST_P (value) && !cond_p)
    {
      if (shimm_p && value != shimm)
       {
         /* Convert the previous shimm operand to a limm.  */
         limm_p = 1;
         limm = shimm;
         insn &= ~C(-1); /* We know where the value is in insn.  */
         insn |= C(ARC_REG_LIMM);
         ls_operand[LS_VALUE] = OP_LIMM;
       }
      insn |= ARC_REG_SHIMM << operand->shift;
      shimm_p = 1;
      shimm = value;
      ls_operand[LS_BASE] = OP_SHIMM;
      ls_operand[LS_OFFSET] = OP_SHIMM;
    }
  else
    {
      if (limm_p && value != limm)
       {
         *errmsg = _("too many long constants");
         return insn;
       }
      limm_p = 1;
      limm = value;
      insn |= B(ARC_REG_LIMM);
      ls_operand[LS_BASE] = OP_LIMM;
    }

  return insn;
}

Here is the call graph for this function:

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

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

{
  cond_p = 1;
  insn |= (value & ((1 << operand->bits) - 1)) << operand->shift;
  return insn;
}
static arc_insn insert_flag ( arc_insn  insn,
const struct arc_operand *operand  ATTRIBUTE_UNUSED,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

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

{
  /* We can't store anything in the insn until we've parsed the registers.
     Just record the fact that we've got this flag.  `insert_reg' will use it
     to store the correct value (ARC_REG_SHIMM_UPDATE or bit 0x100).  */
  flag_p = 1;
  return insn;
}
static arc_insn insert_flagfinish ( arc_insn  insn,
const struct arc_operand operand,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

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

{
  if (flag_p && !flagshimm_handled_p)
    {
      if (shimm_p)
       abort ();
      flagshimm_handled_p = 1;
      insn |= (1 << operand->shift);
    }
  return insn;
}
static arc_insn insert_forcelimm ( arc_insn  insn,
const struct arc_operand *operand  ATTRIBUTE_UNUSED,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

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

{
  cond_p = 1;
  return insn;
}
static arc_insn insert_jumpflags ( arc_insn  insn,
const struct arc_operand operand,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long  value,
const char **  errmsg 
) [static]

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

{
  if (!flag_p)
    *errmsg = _("jump flags, but no .f seen");

  else if (!limm_p)
    *errmsg = _("jump flags, but no limm addr");

  else if (limm & 0xfc000000)
    *errmsg = _("flag bits of jump address limm lost");

  else if (limm & 0x03000000)
    *errmsg = _("attempt to set HR bits");

  else if ((value & ((1 << operand->bits) - 1)) != value)
    *errmsg = _("bad jump flags value");

  jumpflags_p = 1;
  limm = ((limm & ((1 << operand->shift) - 1))
         | ((value & ((1 << operand->bits) - 1)) << operand->shift));
  return insn;
}
static arc_insn insert_ld_syntax ( arc_insn  insn,
const struct arc_operand *operand  ATTRIBUTE_UNUSED,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long value  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

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

{
#define LD_SYNTAX(D, B, O) \
  (   (ls_operand[LS_DEST]   == (D) \
    && ls_operand[LS_BASE]   == (B) \
    && ls_operand[LS_OFFSET] == (O)))

  int test = insn & I (-1);

  if (!(test == I (1)))
    {
      if ((ls_operand[LS_DEST] == OP_SHIMM || ls_operand[LS_BASE] == OP_SHIMM
          || ls_operand[LS_OFFSET] == OP_SHIMM))
       *errmsg = _("invalid load/shimm insn");
    }
  if (!(LD_SYNTAX(OP_REG,OP_REG,OP_NONE)
       || LD_SYNTAX(OP_REG,OP_REG,OP_REG)
       || LD_SYNTAX(OP_REG,OP_REG,OP_SHIMM)
       || (LD_SYNTAX(OP_REG,OP_LIMM,OP_REG) && !(test == I(1)))
       || (LD_SYNTAX(OP_REG,OP_REG,OP_LIMM) && !(test == I(1)))
       || LD_SYNTAX(OP_REG,OP_SHIMM,OP_SHIMM)
       || (LD_SYNTAX(OP_REG,OP_LIMM,OP_NONE) && (test == I(1)))))
    *errmsg = _("ld operand error");
  if (addrwb_p)
    {
      if (ls_operand[LS_BASE] != OP_REG)
       *errmsg = _("address writeback not allowed");
      insn |= addrwb_p;
    }
  return insn;
}
static arc_insn insert_limmfinish ( arc_insn  insn,
const struct arc_operand *operand  ATTRIBUTE_UNUSED,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

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

{
  return insn;
}
static arc_insn insert_nullify ( arc_insn  insn,
const struct arc_operand operand,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long  value,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

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

{
  nullify_p = 1;
  insn |= (value & ((1 << operand->bits) - 1)) << operand->shift;
  nullify = value;
  return insn;
}
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]

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

{
  long minval, maxval;

  if (reg != NULL)
    {
      arc_insn myinsn;
      myinsn = insert_reg (0,operand,mods,reg,value,errmsg) >> operand->shift;
      ls_operand[LS_OFFSET] = OP_REG;
      if (operand->flags & ARC_OPERAND_LOAD) /* Not if store, catch it later.  */
       if ((insn & I(-1)) != I(1)) /* Not if opcode == 1, catch it later.  */
         insn |= C (myinsn);
    }
  else
    {
      /* This is *way* more general than necessary, but maybe some day it'll
        be useful.  */
      if (operand->flags & ARC_OPERAND_SIGNED)
       {
         minval = -(1 << (operand->bits - 1));
         maxval = (1 << (operand->bits - 1)) - 1;
       }
      else
       {
         minval = 0;
         maxval = (1 << operand->bits) - 1;
       }
      if ((cond_p && !limm_p) || (value < minval || value > maxval))
       {
         if (limm_p && value != limm)
           *errmsg = _("too many long constants");

         else
           {
             limm_p = 1;
             limm = value;
             if (operand->flags & ARC_OPERAND_STORE)
              insn |= B(ARC_REG_LIMM);
             if (operand->flags & ARC_OPERAND_LOAD)
              insn |= C(ARC_REG_LIMM);
             ls_operand[LS_OFFSET] = OP_LIMM;
           }
       }
      else
       {
         if ((value < minval || value > maxval))
           *errmsg = "need too many limms";
         else if (shimm_p && value != shimm)
           {
             /* Check for bad operand combinations
               before we lose info about them.  */
             if ((insn & I(-1)) == I(1))
              {
                *errmsg = _("to many shimms in load");
                goto out;
              }
             if (limm_p && operand->flags & ARC_OPERAND_LOAD)
              {
                *errmsg = _("too many long constants");
                goto out;
              }
             /* Convert what we thought was a shimm to a limm.  */
             limm_p = 1;
             limm = shimm;
             if (ls_operand[LS_VALUE] == OP_SHIMM
                && operand->flags & ARC_OPERAND_STORE)
              {
                insn &= ~C(-1);
                insn |= C(ARC_REG_LIMM);
                ls_operand[LS_VALUE] = OP_LIMM;
              }
             if (ls_operand[LS_BASE] == OP_SHIMM
                && operand->flags & ARC_OPERAND_STORE)
              {
                insn &= ~B(-1);
                insn |= B(ARC_REG_LIMM);
                ls_operand[LS_BASE] = OP_LIMM;
              }
           }
         shimm = value;
         shimm_p = 1;
         ls_operand[LS_OFFSET] = OP_SHIMM;
       }
    }
 out:
  return insn;
}

Here is the call graph for this function:

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]

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

{
  static char buf[100];
  enum operand op_type = OP_NONE;

  if (reg == NULL)
    {
      /* We have a constant that also requires a value stored in a register
        field.  Handle these by updating the register field and saving the
        value for later handling by either %S (shimm) or %L (limm).  */

      /* Try to use a shimm value before a limm one.  */
      if (ARC_SHIMM_CONST_P (value)
         /* If we've seen a conditional suffix we have to use a limm.  */
         && !cond_p
         /* If we already have a shimm value that is different than ours
            we have to use a limm.  */
         && (!shimm_p || shimm == value))
       {
         int marker;

         op_type = OP_SHIMM;
         /* Forget about shimm as dest mlm.  */

         if ('a' != operand->fmt)
           {
             shimm_p = 1;
             shimm = value;
             flagshimm_handled_p = 1;
             marker = flag_p ? ARC_REG_SHIMM_UPDATE : ARC_REG_SHIMM;
           }
         else
           {
             /* Don't request flag setting on shimm as dest.  */
             marker = ARC_REG_SHIMM;
           }
         insn |= marker << operand->shift;
         /* insn |= value & 511; - done later.  */
       }
      /* We have to use a limm.  If we've already seen one they must match.  */
      else if (!limm_p || limm == value)
       {
         op_type = OP_LIMM;
         limm_p = 1;
         limm = value;
         insn |= ARC_REG_LIMM << operand->shift;
         /* The constant is stored later.  */
       }
      else
       *errmsg = _("unable to fit different valued constants into instruction");
    }
  else
    {
      /* We have to handle both normal and auxiliary registers.  */

      if (reg->type == AUXREG)
       {
         if (!(mods & ARC_MOD_AUXREG))
           *errmsg = _("auxiliary register not allowed here");
         else
           {
             if ((insn & I(-1)) == I(2)) /* Check for use validity.  */
              {
                if (reg->flags & ARC_REGISTER_READONLY)
                  *errmsg = _("attempt to set readonly register");
              }
             else
              {
                if (reg->flags & ARC_REGISTER_WRITEONLY)
                  *errmsg = _("attempt to read writeonly register");
              }
             insn |= ARC_REG_SHIMM << operand->shift;
             insn |= reg->value << arc_operands[reg->type].shift;
           }
       }
      else
       {
         /* check for use validity.  */
         if ('a' == operand->fmt || ((insn & I(-1)) < I(2)))
           {
             if (reg->flags & ARC_REGISTER_READONLY)
              *errmsg = _("attempt to set readonly register");
           }
         if ('a' != operand->fmt)
           {
             if (reg->flags & ARC_REGISTER_WRITEONLY)
              *errmsg = _("attempt to read writeonly register");
           }
         /* We should never get an invalid register number here.  */
         if ((unsigned int) reg->value > 60)
           {
             sprintf (buf, _("invalid register number `%d'"), reg->value);
             *errmsg = buf;
           }
         insn |= reg->value << operand->shift;
         op_type = OP_REG;
       }
    }

  switch (operand->fmt)
    {
    case 'a':
      ls_operand[LS_DEST] = op_type;
      break;
    case 's':
      ls_operand[LS_BASE] = op_type;
      break;
    case 'c':
      if ((insn & I(-1)) == I(2))
       ls_operand[LS_VALUE] = op_type;
      else
       ls_operand[LS_OFFSET] = op_type;
      break;
    case 'o': case 'O':
      ls_operand[LS_OFFSET] = op_type;
      break;
    }

  return insn;
}

Here is the caller graph for this function:

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

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

{
  if (value & 3)
    *errmsg = _("branch address not on 4 byte boundary");
  insn |= ((value >> 2) & ((1 << operand->bits) - 1)) << operand->shift;
  return insn;
}
static arc_insn insert_shimmfinish ( arc_insn  insn,
const struct arc_operand operand,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long value  ATTRIBUTE_UNUSED,
const char **errmsg  ATTRIBUTE_UNUSED 
) [static]

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

{
  if (shimm_p)
    insn |= (shimm & ((1 << operand->bits) - 1)) << operand->shift;
  return insn;
}
static arc_insn insert_st_syntax ( arc_insn  insn,
const struct arc_operand *operand  ATTRIBUTE_UNUSED,
int mods  ATTRIBUTE_UNUSED,
const struct arc_operand_value *reg  ATTRIBUTE_UNUSED,
long value  ATTRIBUTE_UNUSED,
const char **  errmsg 
) [static]

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

{
  if (ST_SYNTAX (OP_SHIMM,OP_REG,OP_NONE) && shimm != 0)
    {
      /* Change an illegal insn into a legal one, it's easier to
        do it here than to try to handle it during operand scan.  */
      limm_p = 1;
      limm = shimm;
      shimm_p = 0;
      shimm = 0;
      insn = insn & ~(C(-1) | 511);
      insn |= ARC_REG_LIMM << ARC_SHIFT_REGC;
      ls_operand[LS_VALUE] = OP_LIMM;
    }

  if (ST_SYNTAX (OP_REG, OP_SHIMM, OP_NONE)
      || ST_SYNTAX (OP_LIMM, OP_SHIMM, OP_NONE))
    {
      /* Try to salvage this syntax.  */
      if (shimm & 0x1) /* Odd shimms won't work.  */
       {
         if (limm_p) /* Do we have a limm already?  */
           *errmsg = _("impossible store");

         limm_p = 1;
         limm = shimm;
         shimm = 0;
         shimm_p = 0;
         insn = insn & ~(B(-1) | 511);
         insn |= B(ARC_REG_LIMM);
         ls_operand[LS_BASE] = OP_LIMM;
       }
      else
       {
         shimm >>= 1;
         insn = insn & ~511;
         insn |= shimm;
         ls_operand[LS_OFFSET] = OP_SHIMM;
       }
    }
  if (ST_SYNTAX(OP_SHIMM,OP_LIMM,OP_NONE))
    limm += arc_limm_fixup_adjust(insn);

  if (!   (ST_SYNTAX (OP_REG,OP_REG,OP_NONE)
       || ST_SYNTAX (OP_REG,OP_LIMM,OP_NONE)
       || ST_SYNTAX (OP_REG,OP_REG,OP_SHIMM)
       || ST_SYNTAX (OP_REG,OP_SHIMM,OP_SHIMM)
       || (ST_SYNTAX (OP_SHIMM,OP_SHIMM,OP_NONE) && (shimm == 0))
       || ST_SYNTAX (OP_SHIMM,OP_LIMM,OP_NONE)
       || ST_SYNTAX (OP_SHIMM,OP_REG,OP_NONE)
       || ST_SYNTAX (OP_SHIMM,OP_REG,OP_SHIMM)
       || ST_SYNTAX (OP_SHIMM,OP_SHIMM,OP_SHIMM)
       || ST_SYNTAX (OP_LIMM,OP_SHIMM,OP_SHIMM)
       || ST_SYNTAX (OP_LIMM,OP_REG,OP_NONE)
       || ST_SYNTAX (OP_LIMM,OP_REG,OP_SHIMM)))
    *errmsg = _("st operand error");
  if (addrwb_p)
    {
      if (ls_operand[LS_BASE] != OP_REG)
       *errmsg = _("address writeback not allowed");
      insn |= addrwb_p;
    }
  if (ST_SYNTAX(OP_SHIMM,OP_REG,OP_NONE) && shimm)
    *errmsg = _("store value must be zero");
  return insn;
}

Here is the call graph for this function:

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

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

{
  insn |= ((insn >> ARC_SHIFT_REGB) & ARC_MASK_REG) << operand->shift;
  return insn;
}
static struct arc_operand_value* lookup_register ( int  type,
long  regno 
) [static, read]

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

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

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

  if (type == REG)
    return &arc_reg_names[regno];

  /* ??? This is a little slow and can be speeded up.  */
  for (r = arc_reg_names, end = arc_reg_names + arc_reg_names_count;
       r < end; ++r)
    if (type == r->type     && regno == r->value)
      return r;
  return 0;
}

Here is the caller graph for this function:


Variable Documentation

int addrwb_p [static]

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

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

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

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

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

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

Initial value:
  sizeof (arc_reg_names) / sizeof (arc_reg_names[0])

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

Initial value:
  sizeof (arc_suffixes) / sizeof (arc_suffixes[0])

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

int cond_p [static]

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

int cpu_type [static]

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

int flag_p [static]

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

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

struct arc_opcode* icode_map[32] [static]

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

int jumpflags_p [static]

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

long limm [static]

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

int limm_p [static]

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

int nullify [static]

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

int nullify_p [static]

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

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

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

int shimm [static]

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

int shimm_p [static]

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