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