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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [opcodes/] [ip2k-opc.c] - Diff between revs 156 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
/* Instruction opcode table for ip2k.
/* Instruction opcode table for ip2k.
 
 
THIS FILE IS MACHINE GENERATED WITH CGEN.
THIS FILE IS MACHINE GENERATED WITH CGEN.
 
 
Copyright 1996-2007 Free Software Foundation, Inc.
Copyright 1996-2007 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 file is free software; you can redistribute it and/or modify
   This file 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 3, or (at your option)
   the Free Software Foundation; either version 3, or (at your option)
   any later version.
   any later version.
 
 
   It is distributed in the hope that it will be useful, but WITHOUT
   It is distributed in the hope that it will be useful, but WITHOUT
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
   License for more details.
   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.,
   51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
   51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, 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 "ip2k-desc.h"
#include "ip2k-desc.h"
#include "ip2k-opc.h"
#include "ip2k-opc.h"
#include "libiberty.h"
#include "libiberty.h"
 
 
/* -- opc.c */
/* -- opc.c */
 
 
#include "safe-ctype.h"
#include "safe-ctype.h"
 
 
/* A better hash function for instruction mnemonics.  */
/* A better hash function for instruction mnemonics.  */
unsigned int
unsigned int
ip2k_asm_hash (const char* insn)
ip2k_asm_hash (const char* insn)
{
{
  unsigned int hash;
  unsigned int hash;
  const char* m = insn;
  const char* m = insn;
 
 
  for (hash = 0; *m && ! ISSPACE (*m); m++)
  for (hash = 0; *m && ! ISSPACE (*m); m++)
    hash = (hash * 23) ^ (0x1F & TOLOWER (*m));
    hash = (hash * 23) ^ (0x1F & TOLOWER (*m));
 
 
  /* printf ("%s %d\n", insn, (hash % CGEN_ASM_HASH_SIZE)); */
  /* printf ("%s %d\n", insn, (hash % CGEN_ASM_HASH_SIZE)); */
 
 
  return hash % CGEN_ASM_HASH_SIZE;
  return hash % CGEN_ASM_HASH_SIZE;
}
}
 
 
 
 
/* Special check to ensure that instruction exists for given machine.  */
/* Special check to ensure that instruction exists for given machine.  */
 
 
int
int
ip2k_cgen_insn_supported (CGEN_CPU_DESC cd, const CGEN_INSN *insn)
ip2k_cgen_insn_supported (CGEN_CPU_DESC cd, const CGEN_INSN *insn)
{
{
  int machs = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_MACH);
  int machs = CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_MACH);
 
 
  /* No mach attribute?  Assume it's supported for all machs.  */
  /* No mach attribute?  Assume it's supported for all machs.  */
  if (machs == 0)
  if (machs == 0)
    return 1;
    return 1;
 
 
  return (machs & cd->machs) != 0;
  return (machs & cd->machs) != 0;
}
}
 
 


/* -- asm.c */
/* -- asm.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        (const CGEN_INSN *);
static int asm_hash_insn_p        (const CGEN_INSN *);
static unsigned int asm_hash_insn (const char *);
static unsigned int asm_hash_insn (const char *);
static int dis_hash_insn_p        (const CGEN_INSN *);
static int dis_hash_insn_p        (const CGEN_INSN *);
static unsigned int dis_hash_insn (const char *, CGEN_INSN_INT);
static unsigned int dis_hash_insn (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) & ip2k_cgen_ifld_table[IP2K_##f]
#define F(f) & ip2k_cgen_ifld_table[IP2K_##f]
#else
#else
#define F(f) & ip2k_cgen_ifld_table[IP2K_/**/f]
#define F(f) & ip2k_cgen_ifld_table[IP2K_/**/f]
#endif
#endif
static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_empty ATTRIBUTE_UNUSED = {
  0, 0, 0x0, { { 0 } }
  0, 0, 0x0, { { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_jmp ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_jmp ATTRIBUTE_UNUSED = {
  16, 16, 0xe000, { { F (F_OP3) }, { F (F_ADDR16CJP) }, { 0 } }
  16, 16, 0xe000, { { F (F_OP3) }, { F (F_ADDR16CJP) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_sb ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_sb ATTRIBUTE_UNUSED = {
  16, 16, 0xf000, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
  16, 16, 0xf000, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_xorw_l ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_xorw_l ATTRIBUTE_UNUSED = {
  16, 16, 0xff00, { { F (F_OP4) }, { F (F_OP4MID) }, { F (F_IMM8) }, { 0 } }
  16, 16, 0xff00, { { F (F_OP4) }, { F (F_OP4MID) }, { F (F_IMM8) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_loadl_a ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_loadl_a ATTRIBUTE_UNUSED = {
  16, 16, 0xff00, { { F (F_OP4) }, { F (F_OP4MID) }, { F (F_IMM8) }, { 0 } }
  16, 16, 0xff00, { { F (F_OP4) }, { F (F_OP4MID) }, { F (F_IMM8) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_loadh_a ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_loadh_a ATTRIBUTE_UNUSED = {
  16, 16, 0xff00, { { F (F_OP4) }, { F (F_OP4MID) }, { F (F_IMM8) }, { 0 } }
  16, 16, 0xff00, { { F (F_OP4) }, { F (F_OP4MID) }, { F (F_IMM8) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_addcfr_w ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_addcfr_w ATTRIBUTE_UNUSED = {
  16, 16, 0xfe00, { { F (F_OP6) }, { F (F_DIR) }, { F (F_REG) }, { 0 } }
  16, 16, 0xfe00, { { F (F_OP6) }, { F (F_DIR) }, { F (F_REG) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_speed ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_speed ATTRIBUTE_UNUSED = {
  16, 16, 0xff00, { { F (F_OP8) }, { F (F_IMM8) }, { 0 } }
  16, 16, 0xff00, { { F (F_OP8) }, { F (F_IMM8) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_ireadi ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_ireadi ATTRIBUTE_UNUSED = {
  16, 16, 0xffff, { { F (F_OP6) }, { F (F_OP6_10LOW) }, { 0 } }
  16, 16, 0xffff, { { F (F_OP6) }, { F (F_OP6_10LOW) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_page ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_page ATTRIBUTE_UNUSED = {
  16, 16, 0xfff8, { { F (F_OP6) }, { F (F_OP6_7LOW) }, { F (F_PAGE3) }, { 0 } }
  16, 16, 0xfff8, { { F (F_OP6) }, { F (F_OP6_7LOW) }, { F (F_PAGE3) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_reti ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_reti ATTRIBUTE_UNUSED = {
  16, 16, 0xfff8, { { F (F_OP6) }, { F (F_OP6_7LOW) }, { F (F_RETI3) }, { 0 } }
  16, 16, 0xfff8, { { F (F_OP6) }, { F (F_OP6_7LOW) }, { F (F_RETI3) }, { 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) IP2K_OPERAND_##op
#define OPERAND(op) IP2K_OPERAND_##op
#else
#else
#define OPERAND(op) IP2K_OPERAND_/**/op
#define OPERAND(op) IP2K_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 ip2k_cgen_insn_opcode_table[MAX_INSNS] =
static const CGEN_OPCODE ip2k_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}},
/* jmp $addr16cjp */
/* jmp $addr16cjp */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (ADDR16CJP), 0 } },
    { { MNEM, ' ', OP (ADDR16CJP), 0 } },
    & ifmt_jmp, { 0xe000 }
    & ifmt_jmp, { 0xe000 }
  },
  },
/* call $addr16cjp */
/* call $addr16cjp */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (ADDR16CJP), 0 } },
    { { MNEM, ' ', OP (ADDR16CJP), 0 } },
    & ifmt_jmp, { 0xc000 }
    & ifmt_jmp, { 0xc000 }
  },
  },
/* sb $fr,$bitno */
/* sb $fr,$bitno */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', OP (BITNO), 0 } },
    { { MNEM, ' ', OP (FR), ',', OP (BITNO), 0 } },
    & ifmt_sb, { 0xb000 }
    & ifmt_sb, { 0xb000 }
  },
  },
/* snb $fr,$bitno */
/* snb $fr,$bitno */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', OP (BITNO), 0 } },
    { { MNEM, ' ', OP (FR), ',', OP (BITNO), 0 } },
    & ifmt_sb, { 0xa000 }
    & ifmt_sb, { 0xa000 }
  },
  },
/* setb $fr,$bitno */
/* setb $fr,$bitno */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', OP (BITNO), 0 } },
    { { MNEM, ' ', OP (FR), ',', OP (BITNO), 0 } },
    & ifmt_sb, { 0x9000 }
    & ifmt_sb, { 0x9000 }
  },
  },
/* clrb $fr,$bitno */
/* clrb $fr,$bitno */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', OP (BITNO), 0 } },
    { { MNEM, ' ', OP (FR), ',', OP (BITNO), 0 } },
    & ifmt_sb, { 0x8000 }
    & ifmt_sb, { 0x8000 }
  },
  },
/* xor W,#$lit8 */
/* xor W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7f00 }
    & ifmt_xorw_l, { 0x7f00 }
  },
  },
/* and W,#$lit8 */
/* and W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7e00 }
    & ifmt_xorw_l, { 0x7e00 }
  },
  },
/* or W,#$lit8 */
/* or W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7d00 }
    & ifmt_xorw_l, { 0x7d00 }
  },
  },
/* add W,#$lit8 */
/* add W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7b00 }
    & ifmt_xorw_l, { 0x7b00 }
  },
  },
/* sub W,#$lit8 */
/* sub W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7a00 }
    & ifmt_xorw_l, { 0x7a00 }
  },
  },
/* cmp W,#$lit8 */
/* cmp W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7900 }
    & ifmt_xorw_l, { 0x7900 }
  },
  },
/* retw #$lit8 */
/* retw #$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7800 }
    & ifmt_xorw_l, { 0x7800 }
  },
  },
/* cse W,#$lit8 */
/* cse W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7700 }
    & ifmt_xorw_l, { 0x7700 }
  },
  },
/* csne W,#$lit8 */
/* csne W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7600 }
    & ifmt_xorw_l, { 0x7600 }
  },
  },
/* push #$lit8 */
/* push #$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7400 }
    & ifmt_xorw_l, { 0x7400 }
  },
  },
/* muls W,#$lit8 */
/* muls W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7300 }
    & ifmt_xorw_l, { 0x7300 }
  },
  },
/* mulu W,#$lit8 */
/* mulu W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7200 }
    & ifmt_xorw_l, { 0x7200 }
  },
  },
/* loadl #$lit8 */
/* loadl #$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7100 }
    & ifmt_xorw_l, { 0x7100 }
  },
  },
/* loadh #$lit8 */
/* loadh #$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7000 }
    & ifmt_xorw_l, { 0x7000 }
  },
  },
/* loadl $addr16l */
/* loadl $addr16l */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (ADDR16L), 0 } },
    { { MNEM, ' ', OP (ADDR16L), 0 } },
    & ifmt_loadl_a, { 0x7100 }
    & ifmt_loadl_a, { 0x7100 }
  },
  },
/* loadh $addr16h */
/* loadh $addr16h */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (ADDR16H), 0 } },
    { { MNEM, ' ', OP (ADDR16H), 0 } },
    & ifmt_loadh_a, { 0x7000 }
    & ifmt_loadh_a, { 0x7000 }
  },
  },
/* addc $fr,W */
/* addc $fr,W */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    & ifmt_addcfr_w, { 0x5e00 }
    & ifmt_addcfr_w, { 0x5e00 }
  },
  },
/* addc W,$fr */
/* addc W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x5c00 }
    & ifmt_addcfr_w, { 0x5c00 }
  },
  },
/* incsnz $fr */
/* incsnz $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x5a00 }
    & ifmt_addcfr_w, { 0x5a00 }
  },
  },
/* incsnz W,$fr */
/* incsnz W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x5800 }
    & ifmt_addcfr_w, { 0x5800 }
  },
  },
/* muls W,$fr */
/* muls W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x5400 }
    & ifmt_addcfr_w, { 0x5400 }
  },
  },
/* mulu W,$fr */
/* mulu W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x5000 }
    & ifmt_addcfr_w, { 0x5000 }
  },
  },
/* decsnz $fr */
/* decsnz $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x4e00 }
    & ifmt_addcfr_w, { 0x4e00 }
  },
  },
/* decsnz W,$fr */
/* decsnz W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x4c00 }
    & ifmt_addcfr_w, { 0x4c00 }
  },
  },
/* subc W,$fr */
/* subc W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x4800 }
    & ifmt_addcfr_w, { 0x4800 }
  },
  },
/* subc $fr,W */
/* subc $fr,W */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    & ifmt_addcfr_w, { 0x4a00 }
    & ifmt_addcfr_w, { 0x4a00 }
  },
  },
/* pop $fr */
/* pop $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x4600 }
    & ifmt_addcfr_w, { 0x4600 }
  },
  },
/* push $fr */
/* push $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x4400 }
    & ifmt_addcfr_w, { 0x4400 }
  },
  },
/* cse W,$fr */
/* cse W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x4200 }
    & ifmt_addcfr_w, { 0x4200 }
  },
  },
/* csne W,$fr */
/* csne W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x4000 }
    & ifmt_addcfr_w, { 0x4000 }
  },
  },
/* incsz $fr */
/* incsz $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x3e00 }
    & ifmt_addcfr_w, { 0x3e00 }
  },
  },
/* incsz W,$fr */
/* incsz W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x3c00 }
    & ifmt_addcfr_w, { 0x3c00 }
  },
  },
/* swap $fr */
/* swap $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x3a00 }
    & ifmt_addcfr_w, { 0x3a00 }
  },
  },
/* swap W,$fr */
/* swap W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x3800 }
    & ifmt_addcfr_w, { 0x3800 }
  },
  },
/* rl $fr */
/* rl $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x3600 }
    & ifmt_addcfr_w, { 0x3600 }
  },
  },
/* rl W,$fr */
/* rl W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x3400 }
    & ifmt_addcfr_w, { 0x3400 }
  },
  },
/* rr $fr */
/* rr $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x3200 }
    & ifmt_addcfr_w, { 0x3200 }
  },
  },
/* rr W,$fr */
/* rr W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x3000 }
    & ifmt_addcfr_w, { 0x3000 }
  },
  },
/* decsz $fr */
/* decsz $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x2e00 }
    & ifmt_addcfr_w, { 0x2e00 }
  },
  },
/* decsz W,$fr */
/* decsz W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x2c00 }
    & ifmt_addcfr_w, { 0x2c00 }
  },
  },
/* inc $fr */
/* inc $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x2a00 }
    & ifmt_addcfr_w, { 0x2a00 }
  },
  },
/* inc W,$fr */
/* inc W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x2800 }
    & ifmt_addcfr_w, { 0x2800 }
  },
  },
/* not $fr */
/* not $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x2600 }
    & ifmt_addcfr_w, { 0x2600 }
  },
  },
/* not W,$fr */
/* not W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x2400 }
    & ifmt_addcfr_w, { 0x2400 }
  },
  },
/* test $fr */
/* test $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x2200 }
    & ifmt_addcfr_w, { 0x2200 }
  },
  },
/* mov W,#$lit8 */
/* mov W,#$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', 'W', ',', '#', OP (LIT8), 0 } },
    & ifmt_xorw_l, { 0x7c00 }
    & ifmt_xorw_l, { 0x7c00 }
  },
  },
/* mov $fr,W */
/* mov $fr,W */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    & ifmt_addcfr_w, { 0x200 }
    & ifmt_addcfr_w, { 0x200 }
  },
  },
/* mov W,$fr */
/* mov W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x2000 }
    & ifmt_addcfr_w, { 0x2000 }
  },
  },
/* add $fr,W */
/* add $fr,W */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    & ifmt_addcfr_w, { 0x1e00 }
    & ifmt_addcfr_w, { 0x1e00 }
  },
  },
/* add W,$fr */
/* add W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x1c00 }
    & ifmt_addcfr_w, { 0x1c00 }
  },
  },
/* xor $fr,W */
/* xor $fr,W */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    & ifmt_addcfr_w, { 0x1a00 }
    & ifmt_addcfr_w, { 0x1a00 }
  },
  },
/* xor W,$fr */
/* xor W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x1800 }
    & ifmt_addcfr_w, { 0x1800 }
  },
  },
/* and $fr,W */
/* and $fr,W */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    & ifmt_addcfr_w, { 0x1600 }
    & ifmt_addcfr_w, { 0x1600 }
  },
  },
/* and W,$fr */
/* and W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x1400 }
    & ifmt_addcfr_w, { 0x1400 }
  },
  },
/* or $fr,W */
/* or $fr,W */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    & ifmt_addcfr_w, { 0x1200 }
    & ifmt_addcfr_w, { 0x1200 }
  },
  },
/* or W,$fr */
/* or W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x1000 }
    & ifmt_addcfr_w, { 0x1000 }
  },
  },
/* dec $fr */
/* dec $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0xe00 }
    & ifmt_addcfr_w, { 0xe00 }
  },
  },
/* dec W,$fr */
/* dec W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0xc00 }
    & ifmt_addcfr_w, { 0xc00 }
  },
  },
/* sub $fr,W */
/* sub $fr,W */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    { { MNEM, ' ', OP (FR), ',', 'W', 0 } },
    & ifmt_addcfr_w, { 0xa00 }
    & ifmt_addcfr_w, { 0xa00 }
  },
  },
/* sub W,$fr */
/* sub W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x800 }
    & ifmt_addcfr_w, { 0x800 }
  },
  },
/* clr $fr */
/* clr $fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (FR), 0 } },
    { { MNEM, ' ', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x600 }
    & ifmt_addcfr_w, { 0x600 }
  },
  },
/* cmp W,$fr */
/* cmp W,$fr */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    { { MNEM, ' ', 'W', ',', OP (FR), 0 } },
    & ifmt_addcfr_w, { 0x400 }
    & ifmt_addcfr_w, { 0x400 }
  },
  },
/* speed #$lit8 */
/* speed #$lit8 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    { { MNEM, ' ', '#', OP (LIT8), 0 } },
    & ifmt_speed, { 0x100 }
    & ifmt_speed, { 0x100 }
  },
  },
/* ireadi */
/* ireadi */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x1d }
    & ifmt_ireadi, { 0x1d }
  },
  },
/* iwritei */
/* iwritei */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x1c }
    & ifmt_ireadi, { 0x1c }
  },
  },
/* fread */
/* fread */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x1b }
    & ifmt_ireadi, { 0x1b }
  },
  },
/* fwrite */
/* fwrite */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x1a }
    & ifmt_ireadi, { 0x1a }
  },
  },
/* iread */
/* iread */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x19 }
    & ifmt_ireadi, { 0x19 }
  },
  },
/* iwrite */
/* iwrite */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x18 }
    & ifmt_ireadi, { 0x18 }
  },
  },
/* page $addr16p */
/* page $addr16p */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', OP (ADDR16P), 0 } },
    { { MNEM, ' ', OP (ADDR16P), 0 } },
    & ifmt_page, { 0x10 }
    & ifmt_page, { 0x10 }
  },
  },
/* system */
/* system */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0xff }
    & ifmt_ireadi, { 0xff }
  },
  },
/* reti #$reti3 */
/* reti #$reti3 */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, ' ', '#', OP (RETI3), 0 } },
    { { MNEM, ' ', '#', OP (RETI3), 0 } },
    & ifmt_reti, { 0x8 }
    & ifmt_reti, { 0x8 }
  },
  },
/* ret */
/* ret */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x7 }
    & ifmt_ireadi, { 0x7 }
  },
  },
/* int */
/* int */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x6 }
    & ifmt_ireadi, { 0x6 }
  },
  },
/* breakx */
/* breakx */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x5 }
    & ifmt_ireadi, { 0x5 }
  },
  },
/* cwdt */
/* cwdt */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x4 }
    & ifmt_ireadi, { 0x4 }
  },
  },
/* ferase */
/* ferase */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x3 }
    & ifmt_ireadi, { 0x3 }
  },
  },
/* retnp */
/* retnp */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x2 }
    & ifmt_ireadi, { 0x2 }
  },
  },
/* break */
/* break */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x1 }
    & ifmt_ireadi, { 0x1 }
  },
  },
/* nop */
/* nop */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_ireadi, { 0x0 }
    & ifmt_ireadi, { 0x0 }
  },
  },
};
};
 
 
#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) & ip2k_cgen_ifld_table[IP2K_##f]
#define F(f) & ip2k_cgen_ifld_table[IP2K_##f]
#else
#else
#define F(f) & ip2k_cgen_ifld_table[IP2K_/**/f]
#define F(f) & ip2k_cgen_ifld_table[IP2K_/**/f]
#endif
#endif
static const CGEN_IFMT ifmt_sc ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_sc ATTRIBUTE_UNUSED = {
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_snc ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_snc ATTRIBUTE_UNUSED = {
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_sz ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_sz ATTRIBUTE_UNUSED = {
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_snz ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_snz ATTRIBUTE_UNUSED = {
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_skip ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_skip ATTRIBUTE_UNUSED = {
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
};
};
 
 
static const CGEN_IFMT ifmt_skipb ATTRIBUTE_UNUSED = {
static const CGEN_IFMT ifmt_skipb ATTRIBUTE_UNUSED = {
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 0 } }
  16, 16, 0xffff, { { F (F_OP4) }, { F (F_BITNO) }, { F (F_REG) }, { 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) IP2K_OPERAND_##op
#define OPERAND(op) IP2K_OPERAND_##op
#else
#else
#define OPERAND(op) IP2K_OPERAND_/**/op
#define OPERAND(op) IP2K_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 ip2k_cgen_macro_insn_table[] =
static const CGEN_IBASE ip2k_cgen_macro_insn_table[] =
{
{
/* sc */
/* sc */
  {
  {
    -1, "sc", "sc", 16,
    -1, "sc", "sc", 16,
    { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
    { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
  },
  },
/* snc */
/* snc */
  {
  {
    -1, "snc", "snc", 16,
    -1, "snc", "snc", 16,
    { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
    { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
  },
  },
/* sz */
/* sz */
  {
  {
    -1, "sz", "sz", 16,
    -1, "sz", "sz", 16,
    { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
    { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
  },
  },
/* snz */
/* snz */
  {
  {
    -1, "snz", "snz", 16,
    -1, "snz", "snz", 16,
    { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
    { 0|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
  },
  },
/* skip */
/* skip */
  {
  {
    -1, "skip", "skip", 16,
    -1, "skip", "skip", 16,
    { 0|A(SKIPA)|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
    { 0|A(SKIPA)|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
  },
  },
/* skip */
/* skip */
  {
  {
    -1, "skipb", "skip", 16,
    -1, "skipb", "skip", 16,
    { 0|A(SKIPA)|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
    { 0|A(SKIPA)|A(ALIAS), { { { (1<<MACH_BASE), 0 } } } }
  },
  },
};
};
 
 
/* The macro instruction opcode table.  */
/* The macro instruction opcode table.  */
 
 
static const CGEN_OPCODE ip2k_cgen_macro_insn_opcode_table[] =
static const CGEN_OPCODE ip2k_cgen_macro_insn_opcode_table[] =
{
{
/* sc */
/* sc */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_sc, { 0xb00b }
    & ifmt_sc, { 0xb00b }
  },
  },
/* snc */
/* snc */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_snc, { 0xa00b }
    & ifmt_snc, { 0xa00b }
  },
  },
/* sz */
/* sz */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_sz, { 0xb40b }
    & ifmt_sz, { 0xb40b }
  },
  },
/* snz */
/* snz */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_snz, { 0xa40b }
    & ifmt_snz, { 0xa40b }
  },
  },
/* skip */
/* skip */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_skip, { 0xa009 }
    & ifmt_skip, { 0xa009 }
  },
  },
/* skip */
/* skip */
  {
  {
    { 0, 0, 0, 0 },
    { 0, 0, 0, 0 },
    { { MNEM, 0 } },
    { { MNEM, 0 } },
    & ifmt_skipb, { 0xb009 }
    & ifmt_skipb, { 0xb009 }
  },
  },
};
};
 
 
#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 ATTRIBUTE_UNUSED;
     const CGEN_INSN *insn ATTRIBUTE_UNUSED;
{
{
  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 ATTRIBUTE_UNUSED;
     const char * buf ATTRIBUTE_UNUSED;
     CGEN_INSN_INT value ATTRIBUTE_UNUSED;
     CGEN_INSN_INT value ATTRIBUTE_UNUSED;
{
{
  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 (CGEN_FIELDS *fields, int size)
set_fields_bitsize (CGEN_FIELDS *fields, 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
ip2k_cgen_init_opcode_table (CGEN_CPU_DESC cd)
ip2k_cgen_init_opcode_table (CGEN_CPU_DESC cd)
{
{
  int i;
  int i;
  int num_macros = (sizeof (ip2k_cgen_macro_insn_table) /
  int num_macros = (sizeof (ip2k_cgen_macro_insn_table) /
                    sizeof (ip2k_cgen_macro_insn_table[0]));
                    sizeof (ip2k_cgen_macro_insn_table[0]));
  const CGEN_IBASE *ib = & ip2k_cgen_macro_insn_table[0];
  const CGEN_IBASE *ib = & ip2k_cgen_macro_insn_table[0];
  const CGEN_OPCODE *oc = & ip2k_cgen_macro_insn_opcode_table[0];
  const CGEN_OPCODE *oc = & ip2k_cgen_macro_insn_opcode_table[0];
  CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN));
  CGEN_INSN *insns = 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];
      ip2k_cgen_build_insn_regex (& insns[i]);
      ip2k_cgen_build_insn_regex (& insns[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 = & ip2k_cgen_insn_opcode_table[0];
  oc = & ip2k_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];
      ip2k_cgen_build_insn_regex (& insns[i]);
      ip2k_cgen_build_insn_regex (& insns[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.