Back to index

cell-binutils  2.17cvs20070401
Defines | Functions | Variables
frv-opc.c File Reference
#include "sysdep.h"
#include "ansidecl.h"
#include "bfd.h"
#include "symcat.h"
#include "frv-desc.h"
#include "frv-opc.h"
#include "libiberty.h"
#include "elf/frv.h"
#include <stdio.h>

Go to the source code of this file.

Defines

#define F(f)   & frv_cgen_ifld_table[FRV_f]
#define A(a)   (1 << CGEN_INSN_a)
#define OPERAND(op)   FRV_OPERAND_op
#define MNEM   CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
#define OP(field)   CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
#define F(f)   & frv_cgen_ifld_table[FRV_f]
#define A(a)   (1 << CGEN_INSN_a)
#define OPERAND(op)   FRV_OPERAND_op
#define MNEM   CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
#define OP(field)   CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
#define CGEN_ASM_HASH_P(insn)   1
#define CGEN_DIS_HASH_P(insn)   1
#define CGEN_ASM_HASH_SIZE   127
#define CGEN_ASM_HASH(mnem)   (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)

Functions

bfd_boolean frv_is_branch_major (CGEN_ATTR_VALUE_ENUM_TYPE major, unsigned long mach)
bfd_boolean frv_is_float_major (CGEN_ATTR_VALUE_ENUM_TYPE major, unsigned long mach)
bfd_boolean frv_is_media_major (CGEN_ATTR_VALUE_ENUM_TYPE major, unsigned long mach)
bfd_boolean frv_is_branch_insn (const CGEN_INSN *insn)
bfd_boolean frv_is_float_insn (const CGEN_INSN *insn)
bfd_boolean frv_is_media_insn (const CGEN_INSN *insn)
void frv_vliw_reset (FRV_VLIW *vliw, unsigned long mach, unsigned long elf_flags)
static bfd_boolean match_unit (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE unit1, CGEN_ATTR_VALUE_ENUM_TYPE unit2)
static bfd_boolean match_vliw (VLIW_COMBO *vliw1, VLIW_COMBO *vliw2, int vliw_size)
static VLIW_COMBOadd_next_to_vliw (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE unit)
static bfd_boolean find_major_in_vliw (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major)
static bfd_boolean fr400_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major)
static bfd_boolean fr450_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major)
static bfd_boolean find_unit_in_vliw (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE unit)
static bfd_boolean find_major_in_slot (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major, CGEN_ATTR_VALUE_ENUM_TYPE slot)
static bfd_boolean fr550_find_media_in_vliw (FRV_VLIW *vliw)
static bfd_boolean fr550_find_float_in_vliw (FRV_VLIW *vliw)
static bfd_boolean fr550_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major, const CGEN_INSN *insn)
static bfd_boolean fr500_check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major)
static bfd_boolean check_insn_major_constraints (FRV_VLIW *vliw, CGEN_ATTR_VALUE_ENUM_TYPE major, const CGEN_INSN *insn)
int frv_vliw_add_insn (FRV_VLIW *vliw, const CGEN_INSN *insn)
bfd_boolean spr_valid (long regno)
static int asm_hash_insn_p (const CGEN_INSN *)
static unsigned int asm_hash_insn (const char *)
static int dis_hash_insn_p (const CGEN_INSN *)
static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT)
static int asm_hash_insn_p (insn) const
static int dis_hash_insn_p (CGEN_INSN *insn) const
static unsigned int asm_hash_insn (char *mnem) const
static unsigned int dis_hash_insn (buf, value) const
static void set_fields_bitsize (CGEN_FIELDS *fields, int size)
void frv_cgen_init_opcode_table (CGEN_CPU_DESC cd)

Variables

static VLIW_COMBO fr400_allowed_vliw []
static VLIW_COMBO fr500_allowed_vliw []
static VLIW_COMBO fr550_allowed_vliw []
static CGEN_ATTR_VALUE_ENUM_TYPE fr400_unit_mapping []
static CGEN_ATTR_VALUE_ENUM_TYPE fr450_unit_mapping []
static CGEN_ATTR_VALUE_ENUM_TYPE fr500_unit_mapping []
static CGEN_ATTR_VALUE_ENUM_TYPE fr550_unit_mapping []
static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED
static const CGEN_OPCODE frv_cgen_insn_opcode_table [MAX_INSNS]
static const CGEN_IBASE frv_cgen_macro_insn_table []
static const CGEN_OPCODE frv_cgen_macro_insn_opcode_table []

Define Documentation

#define A (   a)    (1 << CGEN_INSN_a)

Definition at line 6032 of file frv-opc.c.

#define A (   a)    (1 << CGEN_INSN_a)

Definition at line 6032 of file frv-opc.c.

#define CGEN_ASM_HASH (   mnem)    (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)

Definition at line 6168 of file frv-opc.c.

#define CGEN_ASM_HASH_P (   insn)    1

Definition at line 6137 of file frv-opc.c.

#define CGEN_ASM_HASH_SIZE   127

Definition at line 6166 of file frv-opc.c.

#define CGEN_DIS_HASH_P (   insn)    1

Definition at line 6141 of file frv-opc.c.

#define F (   f)    & frv_cgen_ifld_table[FRV_f]

Definition at line 5995 of file frv-opc.c.

#define F (   f)    & frv_cgen_ifld_table[FRV_f]

Definition at line 5995 of file frv-opc.c.

#define MNEM   CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */

Definition at line 6039 of file frv-opc.c.

#define MNEM   CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */

Definition at line 6039 of file frv-opc.c.

#define OP (   field)    CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))

Definition at line 6040 of file frv-opc.c.

#define OP (   field)    CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))

Definition at line 6040 of file frv-opc.c.

#define OPERAND (   op)    FRV_OPERAND_op

Definition at line 6037 of file frv-opc.c.

#define OPERAND (   op)    FRV_OPERAND_op

Definition at line 6037 of file frv-opc.c.


Function Documentation

static VLIW_COMBO* add_next_to_vliw ( FRV_VLIW vliw,
CGEN_ATTR_VALUE_ENUM_TYPE  unit 
) [static]

Definition at line 445 of file frv-opc.c.

{
  int           next    = vliw->next_slot;
  VLIW_COMBO    *current = vliw->current_vliw;
  VLIW_COMBO    *potential;

  if (next <= 0)
    {
      fprintf (stderr, "frv-opc.c line %d: bad vliw->next_slot value.\n",
              __LINE__);
      abort (); /* Should never happen.  */
    }

  /* The table is sorted by units allowed within slots, so vliws with
     identical starting sequences are together.  */
  potential = current;
  do
    {
      if (match_unit (vliw, unit, (*potential)[next]))
       return potential;
      ++potential;
    }
  while (match_vliw (potential, current, next));

  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned int asm_hash_insn ( const char *  ) [static]
static unsigned int asm_hash_insn ( char *  mnem) const [static]

Definition at line 6188 of file frv-opc.c.

{
  return CGEN_ASM_HASH (mnem);
}
static int asm_hash_insn_p ( const CGEN_INSN *  ) [static]
static int asm_hash_insn_p ( insn  ) const [static]

Definition at line 6148 of file frv-opc.c.

{
  return CGEN_ASM_HASH_P (insn);
}
static bfd_boolean check_insn_major_constraints ( FRV_VLIW vliw,
CGEN_ATTR_VALUE_ENUM_TYPE  major,
const CGEN_INSN *  insn 
) [static]

Definition at line 772 of file frv-opc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned int dis_hash_insn ( const char *  ,
CGEN_INSN_INT   
) [static]
static unsigned int dis_hash_insn ( buf  ,
value   
) const [static]

Definition at line 6198 of file frv-opc.c.

{
  return CGEN_DIS_HASH (buf, value);
}
static int dis_hash_insn_p ( const CGEN_INSN *  ) [static]
static int dis_hash_insn_p ( CGEN_INSN *  insn) const [static]

Definition at line 6155 of file frv-opc.c.

{
  /* If building the hash table and the NO-DIS attribute is present,
     ignore.  */
  if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
    return 0;
  return CGEN_DIS_HASH_P (insn);
}

Definition at line 558 of file frv-opc.c.

{
  int i;

  for (i = 0; i < vliw->next_slot; ++i)
    if (vliw->major[i] == major && (*vliw->current_vliw)[i] == slot)
      return TRUE;

  return FALSE;
}

Here is the caller graph for this function:

static bfd_boolean find_major_in_vliw ( FRV_VLIW vliw,
CGEN_ATTR_VALUE_ENUM_TYPE  major 
) [static]

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

{
  int i;

  for (i = 0; i < vliw->next_slot; ++i)
    if (vliw->major[i] == major)
      return TRUE;

  return FALSE;
}

Here is the caller graph for this function:

static bfd_boolean find_unit_in_vliw ( FRV_VLIW vliw,
CGEN_ATTR_VALUE_ENUM_TYPE  unit 
) [static]

Definition at line 546 of file frv-opc.c.

{
  int i;

  for (i = 0; i < vliw->next_slot; ++i)
    if (CGEN_INSN_ATTR_VALUE (vliw->insn[i], CGEN_INSN_UNIT) == unit)
      return TRUE;

  return FALSE; /* Not found.  */
}

Here is the caller graph for this function:

Definition at line 491 of file frv-opc.c.

{
  /* In the cpu file, all media insns are represented as being allowed in
     both media units. This makes it easier since this is the case for fr500.
     Catch the invalid combinations here.  Insns of major class FR400_MAJOR_M_2
     cannot coexist with any other media insn in a vliw.  */
  switch (major)
    {
    case FR400_MAJOR_M_2:
      return ! find_major_in_vliw (vliw, FR400_MAJOR_M_1)
       &&   ! find_major_in_vliw (vliw, FR400_MAJOR_M_2);
    case FR400_MAJOR_M_1:
      return ! find_major_in_vliw (vliw, FR400_MAJOR_M_2);
    default:
      break;
    }
  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 511 of file frv-opc.c.

{
  CGEN_ATTR_VALUE_ENUM_TYPE other_major;

  /* Our caller guarantees there's at least one other instruction.  */
  other_major = CGEN_INSN_ATTR_VALUE (vliw->insn[0], CGEN_INSN_FR450_MAJOR);

  /* (M4, M5) and (M4, M6) are allowed.  */
  if (other_major == FR450_MAJOR_M_4)
    if (major == FR450_MAJOR_M_5 || major == FR450_MAJOR_M_6)
      return TRUE;

  /* Otherwise, instructions in even-numbered media categories cannot be
     executed in parallel with other media instructions.  */
  switch (major)
    {
    case FR450_MAJOR_M_2:
    case FR450_MAJOR_M_4:
    case FR450_MAJOR_M_6:
      return !(other_major >= FR450_MAJOR_M_1
              && other_major <= FR450_MAJOR_M_6);

    case FR450_MAJOR_M_1:
    case FR450_MAJOR_M_3:
    case FR450_MAJOR_M_5:
      return !(other_major == FR450_MAJOR_M_2
              || other_major == FR450_MAJOR_M_4
              || other_major == FR450_MAJOR_M_6);

    default:
      return TRUE;
    }
}

Here is the caller graph for this function:

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

{
  /* TODO: A table might be faster for some of the more complex instances
     here.  */
  switch (major)
    {
    case FR500_MAJOR_I_1:
    case FR500_MAJOR_I_4:
    case FR500_MAJOR_I_5:
    case FR500_MAJOR_I_6:
    case FR500_MAJOR_B_1:
    case FR500_MAJOR_B_2:
    case FR500_MAJOR_B_3:
    case FR500_MAJOR_B_4:
    case FR500_MAJOR_B_5:
    case FR500_MAJOR_B_6:
    case FR500_MAJOR_F_4:
    case FR500_MAJOR_F_8:
    case FR500_MAJOR_M_8:
      return TRUE; /* OK */
    case FR500_MAJOR_I_2:
      /* Cannot coexist with I-3 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_I_3);
    case FR500_MAJOR_I_3:
      /* Cannot coexist with I-2 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_I_2);
    case FR500_MAJOR_F_1:
    case FR500_MAJOR_F_2:
      /* Cannot coexist with F-5, F-6, or M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_F_5)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_6)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_7);
    case FR500_MAJOR_F_3:
      /* Cannot coexist with F-7, or M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_F_7)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_7);
    case FR500_MAJOR_F_5:
      /* Cannot coexist with F-1, F-2, F-6, F-7, or M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_F_1)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_2)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_6)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_7)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_7);
    case FR500_MAJOR_F_6:
      /* Cannot coexist with F-1, F-2, F-5, F-6, or M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_F_1)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_2)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_5)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_6)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_7);
    case FR500_MAJOR_F_7:
      /* Cannot coexist with F-3, F-5, F-7, or M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_F_3)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_5)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_7)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_7);
    case FR500_MAJOR_M_1:
      /* Cannot coexist with M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_M_7);
    case FR500_MAJOR_M_2:
    case FR500_MAJOR_M_3:
      /* Cannot coexist with M-5, M-6 or M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_M_5)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_6)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_7);
    case FR500_MAJOR_M_4:
      /* Cannot coexist with M-6 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_M_6);
    case FR500_MAJOR_M_5:
      /* Cannot coexist with M-2, M-3, M-5, M-6  or M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_M_2)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_3)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_5)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_6)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_7);
    case FR500_MAJOR_M_6:
      /* Cannot coexist with M-2, M-3, M-4, M-5, M-6  or M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_M_2)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_3)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_4)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_5)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_6)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_7);
    case FR500_MAJOR_M_7:
      /* Cannot coexist with M-1, M-2, M-3, M-5, M-6  or M-7 insn.  */
      return ! find_major_in_vliw (vliw, FR500_MAJOR_M_1)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_2)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_3)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_5)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_6)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_M_7)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_1)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_2)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_3)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_5)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_6)
       &&   ! find_major_in_vliw (vliw, FR500_MAJOR_F_7);
    default:
      fprintf (stderr, "frv-opc.c, line %d: bad major code, aborting.\n",
              __LINE__);
      abort ();
      break;
    }
  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static bfd_boolean fr550_check_insn_major_constraints ( FRV_VLIW vliw,
CGEN_ATTR_VALUE_ENUM_TYPE  major,
const CGEN_INSN *  insn 
) [static]

Definition at line 614 of file frv-opc.c.

{
  CGEN_ATTR_VALUE_ENUM_TYPE unit;
  CGEN_ATTR_VALUE_ENUM_TYPE slot = (*vliw->current_vliw)[vliw->next_slot];
  switch (slot)
    {
    case UNIT_I2:
      /* If it's a store, then there must be another store in I1 */
      unit = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_UNIT);
      if (unit == UNIT_STORE)
       return find_unit_in_vliw (vliw, UNIT_STORE);
      break;
    case UNIT_FM2:
    case UNIT_FM3:
      /* Floating point insns other than FNOP in slot f2 or f3 cannot coexist
        with media insns.  */
      if (major >= FR550_MAJOR_F_1 && major <= FR550_MAJOR_F_4
         && CGEN_INSN_NUM (insn) != FRV_INSN_FNOP)
       return ! fr550_find_media_in_vliw (vliw);
      /* Media insns other than MNOP in slot m2 or m3 cannot coexist with
        floating point insns.  */
      if (major >= FR550_MAJOR_M_1 && major <= FR550_MAJOR_M_5
         && CGEN_INSN_NUM (insn) != FRV_INSN_MNOP)
       return ! fr550_find_float_in_vliw (vliw);
      /* F-2 in slot f2 or f3 cannot coexist with F-2 or F-4 in slot f1 or f2
        respectively.  */
      if (major == FR550_MAJOR_F_2)
       return ! find_major_in_slot (vliw, FR550_MAJOR_F_2,
                                 slot - (UNIT_FM2 - UNIT_FM0))
         &&   ! find_major_in_slot (vliw, FR550_MAJOR_F_4,
                                 slot - (UNIT_FM2 - UNIT_FM0));
      /* M-2 or M-5 in slot m2 or m3 cannot coexist with M-2 in slot m1 or m2
        respectively.  */
      if (major == FR550_MAJOR_M_2 || major == FR550_MAJOR_M_5)
       return ! find_major_in_slot (vliw, FR550_MAJOR_M_2,
                                 slot - (UNIT_FM2 - UNIT_FM0));
      /* M-4 in slot m2 or m3 cannot coexist with M-4 in slot m1 or m2
        respectively.  */
      if (major == FR550_MAJOR_M_4)
       return ! find_major_in_slot (vliw, FR550_MAJOR_M_4,
                                 slot - (UNIT_FM2 - UNIT_FM0));
      break;
    default:
      break;
    }
  return TRUE; /* All OK.  */
}

Here is the call graph for this function:

Here is the caller graph for this function:

static bfd_boolean fr550_find_float_in_vliw ( FRV_VLIW vliw) [static]

Definition at line 594 of file frv-opc.c.

{
  int i;

  for (i = 0; i < vliw->next_slot; ++i)
    {
      if (vliw->major[i] < FR550_MAJOR_F_1 || vliw->major[i] > FR550_MAJOR_F_4)
       continue;

      /* Found a floating point insn, however, FNOP doesn't count.  */
      if (CGEN_INSN_NUM (vliw->insn[i]) == FRV_INSN_FNOP)
       continue;

      return TRUE; /* Found one.  */
    }

  return FALSE;
}

Here is the caller graph for this function:

static bfd_boolean fr550_find_media_in_vliw ( FRV_VLIW vliw) [static]

Definition at line 572 of file frv-opc.c.

{
  int i;

  for (i = 0; i < vliw->next_slot; ++i)
    {
      if (vliw->major[i] < FR550_MAJOR_M_1 || vliw->major[i] > FR550_MAJOR_M_5)
       continue;

      /* Found a media insn, however, MNOP and MCLRACC don't count.  */
      if (CGEN_INSN_NUM (vliw->insn[i]) == FRV_INSN_MNOP
         || CGEN_INSN_NUM (vliw->insn[i]) == FRV_INSN_MCLRACC_0
         || CGEN_INSN_NUM (vliw->insn[i]) == FRV_INSN_MCLRACC_1)
       continue;

      return TRUE; /* Found one.  */
    }

  return FALSE;
}

Here is the caller graph for this function:

Definition at line 6217 of file frv-opc.c.

{
  int i;
  int num_macros = (sizeof (frv_cgen_macro_insn_table) /
                  sizeof (frv_cgen_macro_insn_table[0]));
  const CGEN_IBASE *ib = & frv_cgen_macro_insn_table[0];
  const CGEN_OPCODE *oc = & frv_cgen_macro_insn_opcode_table[0];
  CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN));

  memset (insns, 0, num_macros * sizeof (CGEN_INSN));
  for (i = 0; i < num_macros; ++i)
    {
      insns[i].base = &ib[i];
      insns[i].opcode = &oc[i];
      frv_cgen_build_insn_regex (& insns[i]);
    }
  cd->macro_insn_table.init_entries = insns;
  cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
  cd->macro_insn_table.num_init_entries = num_macros;

  oc = & frv_cgen_insn_opcode_table[0];
  insns = (CGEN_INSN *) cd->insn_table.init_entries;
  for (i = 0; i < MAX_INSNS; ++i)
    {
      insns[i].opcode = &oc[i];
      frv_cgen_build_insn_regex (& insns[i]);
    }

  cd->sizeof_fields = sizeof (CGEN_FIELDS);
  cd->set_fields_bitsize = set_fields_bitsize;

  cd->asm_hash_p = asm_hash_insn_p;
  cd->asm_hash = asm_hash_insn;
  cd->asm_hash_size = CGEN_ASM_HASH_SIZE;

  cd->dis_hash_p = dis_hash_insn_p;
  cd->dis_hash = dis_hash_insn;
  cd->dis_hash_size = CGEN_DIS_HASH_SIZE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bfd_boolean frv_is_branch_insn ( const CGEN_INSN *  insn)

Definition at line 106 of file frv-opc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 41 of file frv-opc.c.

{
  switch (mach)
    {
    case bfd_mach_fr400:
      if (major >= FR400_MAJOR_B_1 && major <= FR400_MAJOR_B_6)
       return TRUE;
      break;
    case bfd_mach_fr450:
      if (major >= FR450_MAJOR_B_1 && major <= FR450_MAJOR_B_6)
       return TRUE;
      break;
    default:
      if (major >= FR500_MAJOR_B_1 && major <= FR500_MAJOR_B_6)
       return TRUE;
      break;
    }

  return FALSE;
}

Here is the caller graph for this function:

bfd_boolean frv_is_float_insn ( const CGEN_INSN *  insn)

Definition at line 65 of file frv-opc.c.

{
  switch (mach)
    {
    case bfd_mach_fr400:
    case bfd_mach_fr450:
      return FALSE;
    default:
      if (major >= FR500_MAJOR_F_1 && major <= FR500_MAJOR_F_8)
       return TRUE;
      break;
    }

  return FALSE;
}

Here is the caller graph for this function:

bfd_boolean frv_is_media_insn ( const CGEN_INSN *  insn)

Definition at line 84 of file frv-opc.c.

{
  switch (mach)
    {
    case bfd_mach_fr400:
      if (major >= FR400_MAJOR_M_1 && major <= FR400_MAJOR_M_2)
       return TRUE;
      break;
    case bfd_mach_fr450:
      if (major >= FR450_MAJOR_M_1 && major <= FR450_MAJOR_M_6)
       return TRUE;
      break;
    default:
      if (major >= FR500_MAJOR_M_1 && major <= FR500_MAJOR_M_8)
       return TRUE;
      break;
    }

  return FALSE;
}

Here is the caller graph for this function:

int frv_vliw_add_insn ( FRV_VLIW vliw,
const CGEN_INSN *  insn 
)

Definition at line 796 of file frv-opc.c.

{
  int index;
  CGEN_ATTR_VALUE_ENUM_TYPE major;
  CGEN_ATTR_VALUE_ENUM_TYPE unit;
  VLIW_COMBO *new_vliw;

  if (vliw->constraint_violation || CGEN_INSN_INVALID_P (insn))
    return 1;

  index = vliw->next_slot;
  if (index >= FRV_VLIW_SIZE)
    return 1;

  unit = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_UNIT);
  if (unit == UNIT_NIL)
    {
      fprintf (stderr, "frv-opc.c line %d: bad insn unit.\n",
              __LINE__);
      abort (); /* No UNIT specified for this insn in frv.cpu.  */
    }

  switch (vliw->mach)
    {
    case bfd_mach_fr400:
      major = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR400_MAJOR);
      break;
    case bfd_mach_fr450:
      major = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR450_MAJOR);
      break;
    case bfd_mach_fr550:
      major = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR550_MAJOR);
      break;
    default:
      major = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_FR500_MAJOR);
      break;
    }

  if (index <= 0)
    {
      /* Any insn can be added to slot 0.  */
      while (! match_unit (vliw, unit, (*vliw->current_vliw)[0]))
       ++vliw->current_vliw;
      vliw->major[0] = major;
      vliw->insn[0] = insn;
      vliw->next_slot = 1;
      return 0;
    }

  /* If there are already insns in the vliw(s) check to see that
     this one can be added.  Do this by finding an allowable vliw
     combination that can accept the new insn.  */
  if (! (vliw->elf_flags & EF_FRV_NOPACK))
    {
      new_vliw = add_next_to_vliw (vliw, unit);
      if (new_vliw && check_insn_major_constraints (vliw, major, insn))
       {
         vliw->current_vliw = new_vliw;
         vliw->major[index] = major;
         vliw->insn[index] = insn;
         vliw->next_slot++;
         return 0;
       }

      /* The frv machine supports all packing conbinations.  If we fail,
        to add the insn, then it could not be handled as if it was the fr500.
        Just return as if it was handled ok.  */
      if (vliw->mach == bfd_mach_frv)
       return 0;
    }

  vliw->constraint_violation = 1;
  return 1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void frv_vliw_reset ( FRV_VLIW vliw,
unsigned long  mach,
unsigned long  elf_flags 
)

Definition at line 360 of file frv-opc.c.

Here is the caller graph for this function:

static bfd_boolean match_unit ( FRV_VLIW vliw,
CGEN_ATTR_VALUE_ENUM_TYPE  unit1,
CGEN_ATTR_VALUE_ENUM_TYPE  unit2 
) [static]

Definition at line 392 of file frv-opc.c.

{
  /* Map any specialized implementation units to actual ones.  */
  unit1 = vliw->unit_mapping[unit1];

  if (unit1 == unit2)
    return TRUE;
  if (unit1 < unit2)
    return FALSE;

  switch (unit1)
    {
    case UNIT_I01:
    case UNIT_FM01:
    case UNIT_B01:
      /* The 01 versions of these units are within 2 enums of the 0 or 1
        versions.  */
      if (unit1 - unit2 <= 2)
       return TRUE;
      break;
    case UNIT_IALL:
    case UNIT_FMALL:
      /* The ALL versions of these units are within 5 enums of the 0, 1, 2 or 3
        versions.  */
      if (unit1 - unit2 <= 5)
       return TRUE;
      break;
    default:
      break;
    }

  return FALSE;
}

Here is the caller graph for this function:

static bfd_boolean match_vliw ( VLIW_COMBO vliw1,
VLIW_COMBO vliw2,
int  vliw_size 
) [static]

Definition at line 430 of file frv-opc.c.

{
  int i;

  for (i = 0; i < vliw_size; ++i)
    if ((*vliw1)[i] != (*vliw2)[i])
      return FALSE;

  return TRUE;
}

Here is the caller graph for this function:

static void set_fields_bitsize ( CGEN_FIELDS *  fields,
int  size 
) [static]

Definition at line 6208 of file frv-opc.c.

{
  CGEN_FIELDS_BITSIZE (fields) = size;
}

Here is the caller graph for this function:

Definition at line 872 of file frv-opc.c.

{
  if (regno < 0)     return FALSE;
  if (regno <= 4095) return TRUE;
  return FALSE;
}

Here is the caller graph for this function:


Variable Documentation

const CGEN_IFMT ifmt_cmov ATTRIBUTE_UNUSED [static]
Initial value:
 {
  0, 0, 0x0, { { 0 } }
}

Definition at line 894 of file frv-opc.c.

Initial value:

Definition at line 157 of file frv-opc.c.

Definition at line 228 of file frv-opc.c.

Definition at line 263 of file frv-opc.c.

Definition at line 295 of file frv-opc.c.

Definition at line 192 of file frv-opc.c.

Definition at line 327 of file frv-opc.c.

Definition at line 1519 of file frv-opc.c.

Definition at line 6085 of file frv-opc.c.

Definition at line 6044 of file frv-opc.c.