OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [opcodes/] [openrisc-opc.c] - Diff between revs 578 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 578 Rev 1765
/* Instruction opcode table for openrisc.
/* Instruction opcode table for openrisc.
 
 
THIS FILE IS MACHINE GENERATED WITH CGEN.
THIS FILE IS MACHINE GENERATED WITH CGEN.
 
 
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
Copyright 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
 
 
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
This file is part of the GNU Binutils and/or GDB, the GNU debugger.
 
 
This program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
the Free Software Foundation; either version 2, or (at your option)
any later version.
any later version.
 
 
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
GNU General Public License for more details.
 
 
You should have received a copy of the GNU General Public License along
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
*/
*/
 
 
#include "sysdep.h"
#include "sysdep.h"
#include "ansidecl.h"
#include "ansidecl.h"
#include "bfd.h"
#include "bfd.h"
#include "symcat.h"
#include "symcat.h"
#include "openrisc-desc.h"
#include "openrisc-desc.h"
#include "openrisc-opc.h"
#include "openrisc-opc.h"
#include "libiberty.h"
#include "libiberty.h"
 
 
/* -- opc.c */
/* -- opc.c */
/* -- */
/* -- */
/* The hash functions are recorded here to help keep assembler code out of
/* The hash functions are recorded here to help keep assembler code out of
   the disassembler and vice versa.  */
   the disassembler and vice versa.  */
 
 
static int asm_hash_insn_p PARAMS ((const CGEN_INSN *));
static int asm_hash_insn_p PARAMS ((const CGEN_INSN *));
static unsigned int asm_hash_insn PARAMS ((const char *));
static unsigned int asm_hash_insn PARAMS ((const char *));
static int dis_hash_insn_p PARAMS ((const CGEN_INSN *));
static int dis_hash_insn_p PARAMS ((const CGEN_INSN *));
static unsigned int dis_hash_insn PARAMS ((const char *, CGEN_INSN_INT));
static unsigned int dis_hash_insn PARAMS ((const char *, CGEN_INSN_INT));
 
 
/* Instruction formats.  */
/* Instruction formats.  */
 
 
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#define F(f) & openrisc_cgen_ifld_table[OPENRISC_##f]
#define F(f) & openrisc_cgen_ifld_table[OPENRISC_##f]
#else
#else
#define F(f) & openrisc_cgen_ifld_table[OPENRISC_/**/f]
#define F(f) & openrisc_cgen_ifld_table[OPENRISC_/**/f]
#endif
#endif
static const CGEN_IFMT ifmt_empty = {
static const CGEN_IFMT ifmt_empty = {
  0, 0, 0x0, { { 0 } }
  0, 0, 0x0, { { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_j = {
static const CGEN_IFMT ifmt_l_j = {
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_ABS26) }, { 0 } }
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_ABS26) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_jr = {
static const CGEN_IFMT ifmt_l_jr = {
  32, 32, 0xffe00000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP3) }, { F (F_OP4) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
  32, 32, 0xffe00000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP3) }, { F (F_OP4) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_bal = {
static const CGEN_IFMT ifmt_l_bal = {
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_DISP26) }, { 0 } }
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_DISP26) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_movhi = {
static const CGEN_IFMT ifmt_l_movhi = {
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_mfsr = {
static const CGEN_IFMT ifmt_l_mfsr = {
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_mtsr = {
static const CGEN_IFMT ifmt_l_mtsr = {
  32, 32, 0xfc0007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_I16_1) }, { 0 } }
  32, 32, 0xfc0007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_I16_1) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_lw = {
static const CGEN_IFMT ifmt_l_lw = {
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_sw = {
static const CGEN_IFMT ifmt_l_sw = {
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R3) }, { F (F_I16NC) }, { 0 } }
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R3) }, { F (F_I16NC) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_sll = {
static const CGEN_IFMT ifmt_l_sll = {
  32, 32, 0xfc0007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_F_10_3) }, { F (F_OP6) }, { F (F_F_4_1) }, { F (F_OP7) }, { 0 } }
  32, 32, 0xfc0007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_F_10_3) }, { F (F_OP6) }, { F (F_F_4_1) }, { F (F_OP7) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_slli = {
static const CGEN_IFMT ifmt_l_slli = {
  32, 32, 0xfc00ffe0, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_F_15_8) }, { F (F_OP6) }, { F (F_UIMM5) }, { 0 } }
  32, 32, 0xfc00ffe0, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_F_15_8) }, { F (F_OP6) }, { F (F_UIMM5) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_add = {
static const CGEN_IFMT ifmt_l_add = {
  32, 32, 0xfc0007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_F_10_7) }, { F (F_OP7) }, { 0 } }
  32, 32, 0xfc0007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_R3) }, { F (F_F_10_7) }, { F (F_OP7) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_addi = {
static const CGEN_IFMT ifmt_l_addi = {
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_LO16) }, { 0 } }
  32, 32, 0xfc000000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_R1) }, { F (F_R2) }, { F (F_LO16) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_sfgts = {
static const CGEN_IFMT ifmt_l_sfgts = {
  32, 32, 0xffe007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP5) }, { F (F_R2) }, { F (F_R3) }, { F (F_F_10_11) }, { 0 } }
  32, 32, 0xffe007ff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP5) }, { F (F_R2) }, { F (F_R3) }, { F (F_F_10_11) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_sfgtsi = {
static const CGEN_IFMT ifmt_l_sfgtsi = {
  32, 32, 0xffe00000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP5) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
  32, 32, 0xffe00000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP5) }, { F (F_R2) }, { F (F_SIMM16) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_l_sfgtui = {
static const CGEN_IFMT ifmt_l_sfgtui = {
  32, 32, 0xffe00000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP5) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
  32, 32, 0xffe00000, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP5) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
};
};
 
 
#undef F
#undef F
 
 
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#define A(a) (1 << CGEN_INSN_##a)
#define A(a) (1 << CGEN_INSN_##a)
#else
#else
#define A(a) (1 << CGEN_INSN_/**/a)
#define A(a) (1 << CGEN_INSN_/**/a)
#endif
#endif
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#define OPERAND(op) OPENRISC_OPERAND_##op
#define OPERAND(op) OPENRISC_OPERAND_##op
#else
#else
#define OPERAND(op) OPENRISC_OPERAND_/**/op
#define OPERAND(op) OPENRISC_OPERAND_/**/op
#endif
#endif
#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
 
 
/* The instruction table.  */
/* The instruction table.  */
 
 
static const CGEN_OPCODE openrisc_cgen_insn_opcode_table[MAX_INSNS] =
static const CGEN_OPCODE openrisc_cgen_insn_opcode_table[MAX_INSNS] =
{
{
  /* Special null first entry.
  /* Special null first entry.
     A `num' value of zero is thus invalid.
     A `num' value of zero is thus invalid.
     Also, the special `invalid' insn resides here.  */
     Also, the special `invalid' insn resides here.  */
  { { 0, 0, 0, 0 }, {{0}}, 0, {0}},
  { { 0, 0, 0, 0 }, {{0}}, 0, {0}},
/* l.j ${abs-26} */
/* l.j ${abs-26} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (ABS_26), 0 } },
    { { MNEM, ' ', OP (ABS_26), 0 } },
    & ifmt_l_j, { 0x0 }
    & ifmt_l_j, { 0x0 }
  },
  },
/* l.jal ${abs-26} */
/* l.jal ${abs-26} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (ABS_26), 0 } },
    { { MNEM, ' ', OP (ABS_26), 0 } },
    & ifmt_l_j, { 0x4000000 }
    & ifmt_l_j, { 0x4000000 }
  },
  },
/* l.jr $rA */
/* l.jr $rA */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), 0 } },
    { { MNEM, ' ', OP (RA), 0 } },
    & ifmt_l_jr, { 0x14000000 }
    & ifmt_l_jr, { 0x14000000 }
  },
  },
/* l.jalr $rA */
/* l.jalr $rA */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), 0 } },
    { { MNEM, ' ', OP (RA), 0 } },
    & ifmt_l_jr, { 0x14200000 }
    & ifmt_l_jr, { 0x14200000 }
  },
  },
/* l.bal ${disp-26} */
/* l.bal ${disp-26} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (DISP_26), 0 } },
    { { MNEM, ' ', OP (DISP_26), 0 } },
    & ifmt_l_bal, { 0x8000000 }
    & ifmt_l_bal, { 0x8000000 }
  },
  },
/* l.bnf ${disp-26} */
/* l.bnf ${disp-26} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (DISP_26), 0 } },
    { { MNEM, ' ', OP (DISP_26), 0 } },
    & ifmt_l_bal, { 0xc000000 }
    & ifmt_l_bal, { 0xc000000 }
  },
  },
/* l.bf ${disp-26} */
/* l.bf ${disp-26} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (DISP_26), 0 } },
    { { MNEM, ' ', OP (DISP_26), 0 } },
    & ifmt_l_bal, { 0x10000000 }
    & ifmt_l_bal, { 0x10000000 }
  },
  },
/* l.brk ${uimm-16} */
/* l.brk ${uimm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (UIMM_16), 0 } },
    { { MNEM, ' ', OP (UIMM_16), 0 } },
    & ifmt_l_jr, { 0x17000000 }
    & ifmt_l_jr, { 0x17000000 }
  },
  },
/* l.rfe $rA */
/* l.rfe $rA */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), 0 } },
    { { MNEM, ' ', OP (RA), 0 } },
    & ifmt_l_jr, { 0x14400000 }
    & ifmt_l_jr, { 0x14400000 }
  },
  },
/* l.sys ${uimm-16} */
/* l.sys ${uimm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (UIMM_16), 0 } },
    { { MNEM, ' ', OP (UIMM_16), 0 } },
    & ifmt_l_jr, { 0x16000000 }
    & ifmt_l_jr, { 0x16000000 }
  },
  },
/* l.nop */
/* l.nop */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_l_jr, { 0x15000000 }
    & ifmt_l_jr, { 0x15000000 }
  },
  },
/* l.movhi $rD,$hi16 */
/* l.movhi $rD,$hi16 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (HI16), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (HI16), 0 } },
    & ifmt_l_movhi, { 0x18000000 }
    & ifmt_l_movhi, { 0x18000000 }
  },
  },
/* l.mfsr $rD,$rA */
/* l.mfsr $rD,$rA */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), 0 } },
    & ifmt_l_mfsr, { 0x1c000000 }
    & ifmt_l_mfsr, { 0x1c000000 }
  },
  },
/* l.mtsr $rA,$rB */
/* l.mtsr $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_mtsr, { 0x40000000 }
    & ifmt_l_mtsr, { 0x40000000 }
  },
  },
/* l.lw $rD,${simm-16}($rA) */
/* l.lw $rD,${simm-16}($rA) */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    & ifmt_l_lw, { 0x80000000 }
    & ifmt_l_lw, { 0x80000000 }
  },
  },
/* l.lbz $rD,${simm-16}($rA) */
/* l.lbz $rD,${simm-16}($rA) */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    & ifmt_l_lw, { 0x84000000 }
    & ifmt_l_lw, { 0x84000000 }
  },
  },
/* l.lbs $rD,${simm-16}($rA) */
/* l.lbs $rD,${simm-16}($rA) */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    & ifmt_l_lw, { 0x88000000 }
    & ifmt_l_lw, { 0x88000000 }
  },
  },
/* l.lhz $rD,${simm-16}($rA) */
/* l.lhz $rD,${simm-16}($rA) */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    & ifmt_l_lw, { 0x8c000000 }
    & ifmt_l_lw, { 0x8c000000 }
  },
  },
/* l.lhs $rD,${simm-16}($rA) */
/* l.lhs $rD,${simm-16}($rA) */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (SIMM_16), '(', OP (RA), ')', 0 } },
    & ifmt_l_lw, { 0x90000000 }
    & ifmt_l_lw, { 0x90000000 }
  },
  },
/* l.sw ${ui16nc}($rA),$rB */
/* l.sw ${ui16nc}($rA),$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (UI16NC), '(', OP (RA), ')', ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (UI16NC), '(', OP (RA), ')', ',', OP (RB), 0 } },
    & ifmt_l_sw, { 0xd4000000 }
    & ifmt_l_sw, { 0xd4000000 }
  },
  },
/* l.sb ${ui16nc}($rA),$rB */
/* l.sb ${ui16nc}($rA),$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (UI16NC), '(', OP (RA), ')', ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (UI16NC), '(', OP (RA), ')', ',', OP (RB), 0 } },
    & ifmt_l_sw, { 0xd8000000 }
    & ifmt_l_sw, { 0xd8000000 }
  },
  },
/* l.sh ${ui16nc}($rA),$rB */
/* l.sh ${ui16nc}($rA),$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (UI16NC), '(', OP (RA), ')', ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (UI16NC), '(', OP (RA), ')', ',', OP (RB), 0 } },
    & ifmt_l_sw, { 0xdc000000 }
    & ifmt_l_sw, { 0xdc000000 }
  },
  },
/* l.sll $rD,$rA,$rB */
/* l.sll $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sll, { 0xe0000008 }
    & ifmt_l_sll, { 0xe0000008 }
  },
  },
/* l.slli $rD,$rA,${uimm-5} */
/* l.slli $rD,$rA,${uimm-5} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } },
    & ifmt_l_slli, { 0xb4000000 }
    & ifmt_l_slli, { 0xb4000000 }
  },
  },
/* l.srl $rD,$rA,$rB */
/* l.srl $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sll, { 0xe0000028 }
    & ifmt_l_sll, { 0xe0000028 }
  },
  },
/* l.srli $rD,$rA,${uimm-5} */
/* l.srli $rD,$rA,${uimm-5} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } },
    & ifmt_l_slli, { 0xb4000020 }
    & ifmt_l_slli, { 0xb4000020 }
  },
  },
/* l.sra $rD,$rA,$rB */
/* l.sra $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sll, { 0xe0000048 }
    & ifmt_l_sll, { 0xe0000048 }
  },
  },
/* l.srai $rD,$rA,${uimm-5} */
/* l.srai $rD,$rA,${uimm-5} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } },
    & ifmt_l_slli, { 0xb4000040 }
    & ifmt_l_slli, { 0xb4000040 }
  },
  },
/* l.ror $rD,$rA,$rB */
/* l.ror $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sll, { 0xe0000088 }
    & ifmt_l_sll, { 0xe0000088 }
  },
  },
/* l.rori $rD,$rA,${uimm-5} */
/* l.rori $rD,$rA,${uimm-5} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (UIMM_5), 0 } },
    & ifmt_l_slli, { 0xb4000080 }
    & ifmt_l_slli, { 0xb4000080 }
  },
  },
/* l.add $rD,$rA,$rB */
/* l.add $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_add, { 0xe0000000 }
    & ifmt_l_add, { 0xe0000000 }
  },
  },
/* l.addi $rD,$rA,$lo16 */
/* l.addi $rD,$rA,$lo16 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    & ifmt_l_addi, { 0x94000000 }
    & ifmt_l_addi, { 0x94000000 }
  },
  },
/* l.sub $rD,$rA,$rB */
/* l.sub $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_add, { 0xe0000002 }
    & ifmt_l_add, { 0xe0000002 }
  },
  },
/* l.subi $rD,$rA,$lo16 */
/* l.subi $rD,$rA,$lo16 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    & ifmt_l_addi, { 0x9c000000 }
    & ifmt_l_addi, { 0x9c000000 }
  },
  },
/* l.and $rD,$rA,$rB */
/* l.and $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_add, { 0xe0000003 }
    & ifmt_l_add, { 0xe0000003 }
  },
  },
/* l.andi $rD,$rA,$lo16 */
/* l.andi $rD,$rA,$lo16 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    & ifmt_l_addi, { 0xa0000000 }
    & ifmt_l_addi, { 0xa0000000 }
  },
  },
/* l.or $rD,$rA,$rB */
/* l.or $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_add, { 0xe0000004 }
    & ifmt_l_add, { 0xe0000004 }
  },
  },
/* l.ori $rD,$rA,$lo16 */
/* l.ori $rD,$rA,$lo16 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    & ifmt_l_addi, { 0xa4000000 }
    & ifmt_l_addi, { 0xa4000000 }
  },
  },
/* l.xor $rD,$rA,$rB */
/* l.xor $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_add, { 0xe0000005 }
    & ifmt_l_add, { 0xe0000005 }
  },
  },
/* l.xori $rD,$rA,$lo16 */
/* l.xori $rD,$rA,$lo16 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    & ifmt_l_addi, { 0xa8000000 }
    & ifmt_l_addi, { 0xa8000000 }
  },
  },
/* l.mul $rD,$rA,$rB */
/* l.mul $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_add, { 0xe0000006 }
    & ifmt_l_add, { 0xe0000006 }
  },
  },
/* l.muli $rD,$rA,$lo16 */
/* l.muli $rD,$rA,$lo16 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (LO16), 0 } },
    & ifmt_l_addi, { 0xac000000 }
    & ifmt_l_addi, { 0xac000000 }
  },
  },
/* l.div $rD,$rA,$rB */
/* l.div $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_add, { 0xe0000009 }
    & ifmt_l_add, { 0xe0000009 }
  },
  },
/* l.divu $rD,$rA,$rB */
/* l.divu $rD,$rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RD), ',', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_add, { 0xe000000a }
    & ifmt_l_add, { 0xe000000a }
  },
  },
/* l.sfgts $rA,$rB */
/* l.sfgts $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe4c00000 }
    & ifmt_l_sfgts, { 0xe4c00000 }
  },
  },
/* l.sfgtu $rA,$rB */
/* l.sfgtu $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe4400000 }
    & ifmt_l_sfgts, { 0xe4400000 }
  },
  },
/* l.sfges $rA,$rB */
/* l.sfges $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe4e00000 }
    & ifmt_l_sfgts, { 0xe4e00000 }
  },
  },
/* l.sfgeu $rA,$rB */
/* l.sfgeu $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe4600000 }
    & ifmt_l_sfgts, { 0xe4600000 }
  },
  },
/* l.sflts $rA,$rB */
/* l.sflts $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe5000000 }
    & ifmt_l_sfgts, { 0xe5000000 }
  },
  },
/* l.sfltu $rA,$rB */
/* l.sfltu $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe4800000 }
    & ifmt_l_sfgts, { 0xe4800000 }
  },
  },
/* l.sfles $rA,$rB */
/* l.sfles $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe5200000 }
    & ifmt_l_sfgts, { 0xe5200000 }
  },
  },
/* l.sfleu $rA,$rB */
/* l.sfleu $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe4a00000 }
    & ifmt_l_sfgts, { 0xe4a00000 }
  },
  },
/* l.sfgtsi $rA,${simm-16} */
/* l.sfgtsi $rA,${simm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    & ifmt_l_sfgtsi, { 0xb8c00000 }
    & ifmt_l_sfgtsi, { 0xb8c00000 }
  },
  },
/* l.sfgtui $rA,${uimm-16} */
/* l.sfgtui $rA,${uimm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } },
    & ifmt_l_sfgtui, { 0xb8400000 }
    & ifmt_l_sfgtui, { 0xb8400000 }
  },
  },
/* l.sfgesi $rA,${simm-16} */
/* l.sfgesi $rA,${simm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    & ifmt_l_sfgtsi, { 0xb8e00000 }
    & ifmt_l_sfgtsi, { 0xb8e00000 }
  },
  },
/* l.sfgeui $rA,${uimm-16} */
/* l.sfgeui $rA,${uimm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } },
    & ifmt_l_sfgtui, { 0xb8600000 }
    & ifmt_l_sfgtui, { 0xb8600000 }
  },
  },
/* l.sfltsi $rA,${simm-16} */
/* l.sfltsi $rA,${simm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    & ifmt_l_sfgtsi, { 0xb9000000 }
    & ifmt_l_sfgtsi, { 0xb9000000 }
  },
  },
/* l.sfltui $rA,${uimm-16} */
/* l.sfltui $rA,${uimm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } },
    & ifmt_l_sfgtui, { 0xb8800000 }
    & ifmt_l_sfgtui, { 0xb8800000 }
  },
  },
/* l.sflesi $rA,${simm-16} */
/* l.sflesi $rA,${simm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    & ifmt_l_sfgtsi, { 0xb9200000 }
    & ifmt_l_sfgtsi, { 0xb9200000 }
  },
  },
/* l.sfleui $rA,${uimm-16} */
/* l.sfleui $rA,${uimm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (UIMM_16), 0 } },
    & ifmt_l_sfgtui, { 0xb8a00000 }
    & ifmt_l_sfgtui, { 0xb8a00000 }
  },
  },
/* l.sfeq $rA,$rB */
/* l.sfeq $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe4000000 }
    & ifmt_l_sfgts, { 0xe4000000 }
  },
  },
/* l.sfeqi $rA,${simm-16} */
/* l.sfeqi $rA,${simm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    & ifmt_l_sfgtsi, { 0xb8000000 }
    & ifmt_l_sfgtsi, { 0xb8000000 }
  },
  },
/* l.sfne $rA,$rB */
/* l.sfne $rA,$rB */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (RB), 0 } },
    & ifmt_l_sfgts, { 0xe4200000 }
    & ifmt_l_sfgts, { 0xe4200000 }
  },
  },
/* l.sfnei $rA,${simm-16} */
/* l.sfnei $rA,${simm-16} */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    { { MNEM, ' ', OP (RA), ',', OP (SIMM_16), 0 } },
    & ifmt_l_sfgtsi, { 0xb8200000 }
    & ifmt_l_sfgtsi, { 0xb8200000 }
  },
  },
};
};
 
 
#undef A
#undef A
#undef OPERAND
#undef OPERAND
#undef MNEM
#undef MNEM
#undef OP
#undef OP
 
 
/* Formats for ALIAS macro-insns.  */
/* Formats for ALIAS macro-insns.  */
 
 
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#define F(f) & openrisc_cgen_ifld_table[OPENRISC_##f]
#define F(f) & openrisc_cgen_ifld_table[OPENRISC_##f]
#else
#else
#define F(f) & openrisc_cgen_ifld_table[OPENRISC_/**/f]
#define F(f) & openrisc_cgen_ifld_table[OPENRISC_/**/f]
#endif
#endif
static const CGEN_IFMT ifmt_l_ret = {
static const CGEN_IFMT ifmt_l_ret = {
  32, 32, 0xffffffff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP3) }, { F (F_OP4) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
  32, 32, 0xffffffff, { { F (F_CLASS) }, { F (F_SUB) }, { F (F_OP3) }, { F (F_OP4) }, { F (F_R2) }, { F (F_UIMM16) }, { 0 } }
};
};
 
 
#undef F
#undef F
 
 
/* Each non-simple macro entry points to an array of expansion possibilities.  */
/* Each non-simple macro entry points to an array of expansion possibilities.  */
 
 
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#define A(a) (1 << CGEN_INSN_##a)
#define A(a) (1 << CGEN_INSN_##a)
#else
#else
#define A(a) (1 << CGEN_INSN_/**/a)
#define A(a) (1 << CGEN_INSN_/**/a)
#endif
#endif
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
#define OPERAND(op) OPENRISC_OPERAND_##op
#define OPERAND(op) OPENRISC_OPERAND_##op
#else
#else
#define OPERAND(op) OPENRISC_OPERAND_/**/op
#define OPERAND(op) OPENRISC_OPERAND_/**/op
#endif
#endif
#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
#define MNEM CGEN_SYNTAX_MNEMONIC /* syntax value for mnemonic */
#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
#define OP(field) CGEN_SYNTAX_MAKE_FIELD (OPERAND (field))
 
 
/* The macro instruction table.  */
/* The macro instruction table.  */
 
 
static const CGEN_IBASE openrisc_cgen_macro_insn_table[] =
static const CGEN_IBASE openrisc_cgen_macro_insn_table[] =
{
{
/* l.ret */
/* l.ret */
  {
  {
    -1, "l-ret", "l.ret", 32,
    -1, "l-ret", "l.ret", 32,
    { 0|A(ALIAS), { (1<<MACH_BASE) } }
    { 0|A(ALIAS), { (1<<MACH_BASE) } }
  },
  },
};
};
 
 
/* The macro instruction opcode table.  */
/* The macro instruction opcode table.  */
 
 
static const CGEN_OPCODE openrisc_cgen_macro_insn_opcode_table[] =
static const CGEN_OPCODE openrisc_cgen_macro_insn_opcode_table[] =
{
{
/* l.ret */
/* l.ret */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_l_ret, { 0x140b0000 }
    & ifmt_l_ret, { 0x140b0000 }
  },
  },
};
};
 
 
#undef A
#undef A
#undef OPERAND
#undef OPERAND
#undef MNEM
#undef MNEM
#undef OP
#undef OP
 
 
#ifndef CGEN_ASM_HASH_P
#ifndef CGEN_ASM_HASH_P
#define CGEN_ASM_HASH_P(insn) 1
#define CGEN_ASM_HASH_P(insn) 1
#endif
#endif
 
 
#ifndef CGEN_DIS_HASH_P
#ifndef CGEN_DIS_HASH_P
#define CGEN_DIS_HASH_P(insn) 1
#define CGEN_DIS_HASH_P(insn) 1
#endif
#endif
 
 
/* Return non-zero if INSN is to be added to the hash table.
/* Return non-zero if INSN is to be added to the hash table.
   Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file.  */
   Targets are free to override CGEN_{ASM,DIS}_HASH_P in the .opc file.  */
 
 
static int
static int
asm_hash_insn_p (insn)
asm_hash_insn_p (insn)
     const CGEN_INSN *insn;
     const CGEN_INSN *insn;
{
{
  return CGEN_ASM_HASH_P (insn);
  return CGEN_ASM_HASH_P (insn);
}
}
 
 
static int
static int
dis_hash_insn_p (insn)
dis_hash_insn_p (insn)
     const CGEN_INSN *insn;
     const CGEN_INSN *insn;
{
{
  /* If building the hash table and the NO-DIS attribute is present,
  /* If building the hash table and the NO-DIS attribute is present,
     ignore.  */
     ignore.  */
  if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
  if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_NO_DIS))
    return 0;
    return 0;
  return CGEN_DIS_HASH_P (insn);
  return CGEN_DIS_HASH_P (insn);
}
}
 
 
#ifndef CGEN_ASM_HASH
#ifndef CGEN_ASM_HASH
#define CGEN_ASM_HASH_SIZE 127
#define CGEN_ASM_HASH_SIZE 127
#ifdef CGEN_MNEMONIC_OPERANDS
#ifdef CGEN_MNEMONIC_OPERANDS
#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)
#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE)
#else
#else
#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
#define CGEN_ASM_HASH(mnem) (*(unsigned char *) (mnem) % CGEN_ASM_HASH_SIZE) /*FIXME*/
#endif
#endif
#endif
#endif
 
 
/* It doesn't make much sense to provide a default here,
/* It doesn't make much sense to provide a default here,
   but while this is under development we do.
   but while this is under development we do.
   BUFFER is a pointer to the bytes of the insn, target order.
   BUFFER is a pointer to the bytes of the insn, target order.
   VALUE is the first base_insn_bitsize bits as an int in host order.  */
   VALUE is the first base_insn_bitsize bits as an int in host order.  */
 
 
#ifndef CGEN_DIS_HASH
#ifndef CGEN_DIS_HASH
#define CGEN_DIS_HASH_SIZE 256
#define CGEN_DIS_HASH_SIZE 256
#define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
#define CGEN_DIS_HASH(buf, value) (*(unsigned char *) (buf))
#endif
#endif
 
 
/* The result is the hash value of the insn.
/* The result is the hash value of the insn.
   Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file.  */
   Targets are free to override CGEN_{ASM,DIS}_HASH in the .opc file.  */
 
 
static unsigned int
static unsigned int
asm_hash_insn (mnem)
asm_hash_insn (mnem)
     const char * mnem;
     const char * mnem;
{
{
  return CGEN_ASM_HASH (mnem);
  return CGEN_ASM_HASH (mnem);
}
}
 
 
/* BUF is a pointer to the bytes of the insn, target order.
/* BUF is a pointer to the bytes of the insn, target order.
   VALUE is the first base_insn_bitsize bits as an int in host order.  */
   VALUE is the first base_insn_bitsize bits as an int in host order.  */
 
 
static unsigned int
static unsigned int
dis_hash_insn (buf, value)
dis_hash_insn (buf, value)
     const char * buf;
     const char * buf;
     CGEN_INSN_INT value;
     CGEN_INSN_INT value;
{
{
  return CGEN_DIS_HASH (buf, value);
  return CGEN_DIS_HASH (buf, value);
}
}
 
 
/* Set the recorded length of the insn in the CGEN_FIELDS struct.  */
/* Set the recorded length of the insn in the CGEN_FIELDS struct.  */
 
 
static void
static void
set_fields_bitsize (fields, size)
set_fields_bitsize (fields, size)
     CGEN_FIELDS *fields;
     CGEN_FIELDS *fields;
     int size;
     int size;
{
{
  CGEN_FIELDS_BITSIZE (fields) = size;
  CGEN_FIELDS_BITSIZE (fields) = size;
}
}
 
 
/* Function to call before using the operand instance table.
/* Function to call before using the operand instance table.
   This plugs the opcode entries and macro instructions into the cpu table.  */
   This plugs the opcode entries and macro instructions into the cpu table.  */
 
 
void
void
openrisc_cgen_init_opcode_table (cd)
openrisc_cgen_init_opcode_table (cd)
     CGEN_CPU_DESC cd;
     CGEN_CPU_DESC cd;
{
{
  int i;
  int i;
  int num_macros = (sizeof (openrisc_cgen_macro_insn_table) /
  int num_macros = (sizeof (openrisc_cgen_macro_insn_table) /
                    sizeof (openrisc_cgen_macro_insn_table[0]));
                    sizeof (openrisc_cgen_macro_insn_table[0]));
  const CGEN_IBASE *ib = & openrisc_cgen_macro_insn_table[0];
  const CGEN_IBASE *ib = & openrisc_cgen_macro_insn_table[0];
  const CGEN_OPCODE *oc = & openrisc_cgen_macro_insn_opcode_table[0];
  const CGEN_OPCODE *oc = & openrisc_cgen_macro_insn_opcode_table[0];
  CGEN_INSN *insns = (CGEN_INSN *) xmalloc (num_macros * sizeof (CGEN_INSN));
  CGEN_INSN *insns = (CGEN_INSN *) xmalloc (num_macros * sizeof (CGEN_INSN));
  memset (insns, 0, num_macros * sizeof (CGEN_INSN));
  memset (insns, 0, num_macros * sizeof (CGEN_INSN));
  for (i = 0; i < num_macros; ++i)
  for (i = 0; i < num_macros; ++i)
    {
    {
      insns[i].base = &ib[i];
      insns[i].base = &ib[i];
      insns[i].opcode = &oc[i];
      insns[i].opcode = &oc[i];
    }
    }
  cd->macro_insn_table.init_entries = insns;
  cd->macro_insn_table.init_entries = insns;
  cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
  cd->macro_insn_table.entry_size = sizeof (CGEN_IBASE);
  cd->macro_insn_table.num_init_entries = num_macros;
  cd->macro_insn_table.num_init_entries = num_macros;
 
 
  oc = & openrisc_cgen_insn_opcode_table[0];
  oc = & openrisc_cgen_insn_opcode_table[0];
  insns = (CGEN_INSN *) cd->insn_table.init_entries;
  insns = (CGEN_INSN *) cd->insn_table.init_entries;
  for (i = 0; i < MAX_INSNS; ++i)
  for (i = 0; i < MAX_INSNS; ++i)
    insns[i].opcode = &oc[i];
    insns[i].opcode = &oc[i];
 
 
  cd->sizeof_fields = sizeof (CGEN_FIELDS);
  cd->sizeof_fields = sizeof (CGEN_FIELDS);
  cd->set_fields_bitsize = set_fields_bitsize;
  cd->set_fields_bitsize = set_fields_bitsize;
 
 
  cd->asm_hash_p = asm_hash_insn_p;
  cd->asm_hash_p = asm_hash_insn_p;
  cd->asm_hash = asm_hash_insn;
  cd->asm_hash = asm_hash_insn;
  cd->asm_hash_size = CGEN_ASM_HASH_SIZE;
  cd->asm_hash_size = CGEN_ASM_HASH_SIZE;
 
 
  cd->dis_hash_p = dis_hash_insn_p;
  cd->dis_hash_p = dis_hash_insn_p;
  cd->dis_hash = dis_hash_insn;
  cd->dis_hash = dis_hash_insn;
  cd->dis_hash_size = CGEN_DIS_HASH_SIZE;
  cd->dis_hash_size = CGEN_DIS_HASH_SIZE;
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.