1*3d8817e4Smiod /* Instruction opcode header for ip2k.
2*3d8817e4Smiod 
3*3d8817e4Smiod THIS FILE IS MACHINE GENERATED WITH CGEN.
4*3d8817e4Smiod 
5*3d8817e4Smiod Copyright 1996-2005 Free Software Foundation, Inc.
6*3d8817e4Smiod 
7*3d8817e4Smiod This file is part of the GNU Binutils and/or GDB, the GNU debugger.
8*3d8817e4Smiod 
9*3d8817e4Smiod This program is free software; you can redistribute it and/or modify
10*3d8817e4Smiod it under the terms of the GNU General Public License as published by
11*3d8817e4Smiod the Free Software Foundation; either version 2, or (at your option)
12*3d8817e4Smiod any later version.
13*3d8817e4Smiod 
14*3d8817e4Smiod This program is distributed in the hope that it will be useful,
15*3d8817e4Smiod but WITHOUT ANY WARRANTY; without even the implied warranty of
16*3d8817e4Smiod MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17*3d8817e4Smiod GNU General Public License for more details.
18*3d8817e4Smiod 
19*3d8817e4Smiod You should have received a copy of the GNU General Public License along
20*3d8817e4Smiod with this program; if not, write to the Free Software Foundation, Inc.,
21*3d8817e4Smiod 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
22*3d8817e4Smiod 
23*3d8817e4Smiod */
24*3d8817e4Smiod 
25*3d8817e4Smiod #ifndef IP2K_OPC_H
26*3d8817e4Smiod #define IP2K_OPC_H
27*3d8817e4Smiod 
28*3d8817e4Smiod /* -- opc.h */
29*3d8817e4Smiod 
30*3d8817e4Smiod /* Check applicability of instructions against machines.  */
31*3d8817e4Smiod #define CGEN_VALIDATE_INSN_SUPPORTED
32*3d8817e4Smiod 
33*3d8817e4Smiod /* Allows reason codes to be output when assembler errors occur.  */
34*3d8817e4Smiod #define CGEN_VERBOSE_ASSEMBLER_ERRORS
35*3d8817e4Smiod 
36*3d8817e4Smiod /* Override disassembly hashing - there are variable bits in the top
37*3d8817e4Smiod    byte of these instructions.  */
38*3d8817e4Smiod #define CGEN_DIS_HASH_SIZE 8
39*3d8817e4Smiod #define CGEN_DIS_HASH(buf, value) \
40*3d8817e4Smiod   (((* (unsigned char*) (buf)) >> 5) % CGEN_DIS_HASH_SIZE)
41*3d8817e4Smiod 
42*3d8817e4Smiod #define CGEN_ASM_HASH_SIZE 127
43*3d8817e4Smiod #define CGEN_ASM_HASH(insn) ip2k_asm_hash (insn)
44*3d8817e4Smiod 
45*3d8817e4Smiod extern unsigned int ip2k_asm_hash (const char *);
46*3d8817e4Smiod extern int ip2k_cgen_insn_supported (CGEN_CPU_DESC, const CGEN_INSN *);
47*3d8817e4Smiod 
48*3d8817e4Smiod /* -- opc.c */
49*3d8817e4Smiod /* Enum declaration for ip2k instruction types.  */
50*3d8817e4Smiod typedef enum cgen_insn_type {
51*3d8817e4Smiod   IP2K_INSN_INVALID, IP2K_INSN_JMP, IP2K_INSN_CALL, IP2K_INSN_SB
52*3d8817e4Smiod  , IP2K_INSN_SNB, IP2K_INSN_SETB, IP2K_INSN_CLRB, IP2K_INSN_XORW_L
53*3d8817e4Smiod  , IP2K_INSN_ANDW_L, IP2K_INSN_ORW_L, IP2K_INSN_ADDW_L, IP2K_INSN_SUBW_L
54*3d8817e4Smiod  , IP2K_INSN_CMPW_L, IP2K_INSN_RETW_L, IP2K_INSN_CSEW_L, IP2K_INSN_CSNEW_L
55*3d8817e4Smiod  , IP2K_INSN_PUSH_L, IP2K_INSN_MULSW_L, IP2K_INSN_MULUW_L, IP2K_INSN_LOADL_L
56*3d8817e4Smiod  , IP2K_INSN_LOADH_L, IP2K_INSN_LOADL_A, IP2K_INSN_LOADH_A, IP2K_INSN_ADDCFR_W
57*3d8817e4Smiod  , IP2K_INSN_ADDCW_FR, IP2K_INSN_INCSNZ_FR, IP2K_INSN_INCSNZW_FR, IP2K_INSN_MULSW_FR
58*3d8817e4Smiod  , IP2K_INSN_MULUW_FR, IP2K_INSN_DECSNZ_FR, IP2K_INSN_DECSNZW_FR, IP2K_INSN_SUBCW_FR
59*3d8817e4Smiod  , IP2K_INSN_SUBCFR_W, IP2K_INSN_POP_FR, IP2K_INSN_PUSH_FR, IP2K_INSN_CSEW_FR
60*3d8817e4Smiod  , IP2K_INSN_CSNEW_FR, IP2K_INSN_INCSZ_FR, IP2K_INSN_INCSZW_FR, IP2K_INSN_SWAP_FR
61*3d8817e4Smiod  , IP2K_INSN_SWAPW_FR, IP2K_INSN_RL_FR, IP2K_INSN_RLW_FR, IP2K_INSN_RR_FR
62*3d8817e4Smiod  , IP2K_INSN_RRW_FR, IP2K_INSN_DECSZ_FR, IP2K_INSN_DECSZW_FR, IP2K_INSN_INC_FR
63*3d8817e4Smiod  , IP2K_INSN_INCW_FR, IP2K_INSN_NOT_FR, IP2K_INSN_NOTW_FR, IP2K_INSN_TEST_FR
64*3d8817e4Smiod  , IP2K_INSN_MOVW_L, IP2K_INSN_MOVFR_W, IP2K_INSN_MOVW_FR, IP2K_INSN_ADDFR_W
65*3d8817e4Smiod  , IP2K_INSN_ADDW_FR, IP2K_INSN_XORFR_W, IP2K_INSN_XORW_FR, IP2K_INSN_ANDFR_W
66*3d8817e4Smiod  , IP2K_INSN_ANDW_FR, IP2K_INSN_ORFR_W, IP2K_INSN_ORW_FR, IP2K_INSN_DEC_FR
67*3d8817e4Smiod  , IP2K_INSN_DECW_FR, IP2K_INSN_SUBFR_W, IP2K_INSN_SUBW_FR, IP2K_INSN_CLR_FR
68*3d8817e4Smiod  , IP2K_INSN_CMPW_FR, IP2K_INSN_SPEED, IP2K_INSN_IREADI, IP2K_INSN_IWRITEI
69*3d8817e4Smiod  , IP2K_INSN_FREAD, IP2K_INSN_FWRITE, IP2K_INSN_IREAD, IP2K_INSN_IWRITE
70*3d8817e4Smiod  , IP2K_INSN_PAGE, IP2K_INSN_SYSTEM, IP2K_INSN_RETI, IP2K_INSN_RET
71*3d8817e4Smiod  , IP2K_INSN_INT, IP2K_INSN_BREAKX, IP2K_INSN_CWDT, IP2K_INSN_FERASE
72*3d8817e4Smiod  , IP2K_INSN_RETNP, IP2K_INSN_BREAK, IP2K_INSN_NOP
73*3d8817e4Smiod } CGEN_INSN_TYPE;
74*3d8817e4Smiod 
75*3d8817e4Smiod /* Index of `invalid' insn place holder.  */
76*3d8817e4Smiod #define CGEN_INSN_INVALID IP2K_INSN_INVALID
77*3d8817e4Smiod 
78*3d8817e4Smiod /* Total number of insns in table.  */
79*3d8817e4Smiod #define MAX_INSNS ((int) IP2K_INSN_NOP + 1)
80*3d8817e4Smiod 
81*3d8817e4Smiod /* This struct records data prior to insertion or after extraction.  */
82*3d8817e4Smiod struct cgen_fields
83*3d8817e4Smiod {
84*3d8817e4Smiod   int length;
85*3d8817e4Smiod   long f_nil;
86*3d8817e4Smiod   long f_anyof;
87*3d8817e4Smiod   long f_imm8;
88*3d8817e4Smiod   long f_reg;
89*3d8817e4Smiod   long f_addr16cjp;
90*3d8817e4Smiod   long f_dir;
91*3d8817e4Smiod   long f_bitno;
92*3d8817e4Smiod   long f_op3;
93*3d8817e4Smiod   long f_op4;
94*3d8817e4Smiod   long f_op4mid;
95*3d8817e4Smiod   long f_op6;
96*3d8817e4Smiod   long f_op8;
97*3d8817e4Smiod   long f_op6_10low;
98*3d8817e4Smiod   long f_op6_7low;
99*3d8817e4Smiod   long f_reti3;
100*3d8817e4Smiod   long f_skipb;
101*3d8817e4Smiod   long f_page3;
102*3d8817e4Smiod };
103*3d8817e4Smiod 
104*3d8817e4Smiod #define CGEN_INIT_PARSE(od) \
105*3d8817e4Smiod {\
106*3d8817e4Smiod }
107*3d8817e4Smiod #define CGEN_INIT_INSERT(od) \
108*3d8817e4Smiod {\
109*3d8817e4Smiod }
110*3d8817e4Smiod #define CGEN_INIT_EXTRACT(od) \
111*3d8817e4Smiod {\
112*3d8817e4Smiod }
113*3d8817e4Smiod #define CGEN_INIT_PRINT(od) \
114*3d8817e4Smiod {\
115*3d8817e4Smiod }
116*3d8817e4Smiod 
117*3d8817e4Smiod 
118*3d8817e4Smiod #endif /* IP2K_OPC_H */
119