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