Back to index

cell-binutils  2.17cvs20070401
ip2k-opc.h
Go to the documentation of this file.
00001 /* Instruction opcode header for ip2k.
00002 
00003 THIS FILE IS MACHINE GENERATED WITH CGEN.
00004 
00005 Copyright 1996-2005 Free Software Foundation, Inc.
00006 
00007 This file is part of the GNU Binutils and/or GDB, the GNU debugger.
00008 
00009 This program is free software; you can redistribute it and/or modify
00010 it under the terms of the GNU General Public License as published by
00011 the Free Software Foundation; either version 2, or (at your option)
00012 any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License along
00020 with this program; if not, write to the Free Software Foundation, Inc.,
00021 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
00022 
00023 */
00024 
00025 #ifndef IP2K_OPC_H
00026 #define IP2K_OPC_H
00027 
00028 /* -- opc.h */
00029 
00030 /* Check applicability of instructions against machines.  */
00031 #define CGEN_VALIDATE_INSN_SUPPORTED
00032 
00033 /* Allows reason codes to be output when assembler errors occur.  */
00034 #define CGEN_VERBOSE_ASSEMBLER_ERRORS
00035 
00036 /* Override disassembly hashing - there are variable bits in the top
00037    byte of these instructions.  */
00038 #define CGEN_DIS_HASH_SIZE 8
00039 #define CGEN_DIS_HASH(buf, value) \
00040   (((* (unsigned char*) (buf)) >> 5) % CGEN_DIS_HASH_SIZE)
00041 
00042 #define CGEN_ASM_HASH_SIZE 127
00043 #define CGEN_ASM_HASH(insn) ip2k_asm_hash (insn)
00044 
00045 extern unsigned int ip2k_asm_hash (const char *);
00046 extern int ip2k_cgen_insn_supported (CGEN_CPU_DESC, const CGEN_INSN *);
00047 
00048 /* -- opc.c */
00049 /* Enum declaration for ip2k instruction types.  */
00050 typedef enum cgen_insn_type {
00051   IP2K_INSN_INVALID, IP2K_INSN_JMP, IP2K_INSN_CALL, IP2K_INSN_SB
00052  , IP2K_INSN_SNB, IP2K_INSN_SETB, IP2K_INSN_CLRB, IP2K_INSN_XORW_L
00053  , IP2K_INSN_ANDW_L, IP2K_INSN_ORW_L, IP2K_INSN_ADDW_L, IP2K_INSN_SUBW_L
00054  , IP2K_INSN_CMPW_L, IP2K_INSN_RETW_L, IP2K_INSN_CSEW_L, IP2K_INSN_CSNEW_L
00055  , IP2K_INSN_PUSH_L, IP2K_INSN_MULSW_L, IP2K_INSN_MULUW_L, IP2K_INSN_LOADL_L
00056  , IP2K_INSN_LOADH_L, IP2K_INSN_LOADL_A, IP2K_INSN_LOADH_A, IP2K_INSN_ADDCFR_W
00057  , IP2K_INSN_ADDCW_FR, IP2K_INSN_INCSNZ_FR, IP2K_INSN_INCSNZW_FR, IP2K_INSN_MULSW_FR
00058  , IP2K_INSN_MULUW_FR, IP2K_INSN_DECSNZ_FR, IP2K_INSN_DECSNZW_FR, IP2K_INSN_SUBCW_FR
00059  , IP2K_INSN_SUBCFR_W, IP2K_INSN_POP_FR, IP2K_INSN_PUSH_FR, IP2K_INSN_CSEW_FR
00060  , IP2K_INSN_CSNEW_FR, IP2K_INSN_INCSZ_FR, IP2K_INSN_INCSZW_FR, IP2K_INSN_SWAP_FR
00061  , IP2K_INSN_SWAPW_FR, IP2K_INSN_RL_FR, IP2K_INSN_RLW_FR, IP2K_INSN_RR_FR
00062  , IP2K_INSN_RRW_FR, IP2K_INSN_DECSZ_FR, IP2K_INSN_DECSZW_FR, IP2K_INSN_INC_FR
00063  , IP2K_INSN_INCW_FR, IP2K_INSN_NOT_FR, IP2K_INSN_NOTW_FR, IP2K_INSN_TEST_FR
00064  , IP2K_INSN_MOVW_L, IP2K_INSN_MOVFR_W, IP2K_INSN_MOVW_FR, IP2K_INSN_ADDFR_W
00065  , IP2K_INSN_ADDW_FR, IP2K_INSN_XORFR_W, IP2K_INSN_XORW_FR, IP2K_INSN_ANDFR_W
00066  , IP2K_INSN_ANDW_FR, IP2K_INSN_ORFR_W, IP2K_INSN_ORW_FR, IP2K_INSN_DEC_FR
00067  , IP2K_INSN_DECW_FR, IP2K_INSN_SUBFR_W, IP2K_INSN_SUBW_FR, IP2K_INSN_CLR_FR
00068  , IP2K_INSN_CMPW_FR, IP2K_INSN_SPEED, IP2K_INSN_IREADI, IP2K_INSN_IWRITEI
00069  , IP2K_INSN_FREAD, IP2K_INSN_FWRITE, IP2K_INSN_IREAD, IP2K_INSN_IWRITE
00070  , IP2K_INSN_PAGE, IP2K_INSN_SYSTEM, IP2K_INSN_RETI, IP2K_INSN_RET
00071  , IP2K_INSN_INT, IP2K_INSN_BREAKX, IP2K_INSN_CWDT, IP2K_INSN_FERASE
00072  , IP2K_INSN_RETNP, IP2K_INSN_BREAK, IP2K_INSN_NOP
00073 } CGEN_INSN_TYPE;
00074 
00075 /* Index of `invalid' insn place holder.  */
00076 #define CGEN_INSN_INVALID IP2K_INSN_INVALID
00077 
00078 /* Total number of insns in table.  */
00079 #define MAX_INSNS ((int) IP2K_INSN_NOP + 1)
00080 
00081 /* This struct records data prior to insertion or after extraction.  */
00082 struct cgen_fields
00083 {
00084   int length;
00085   long f_nil;
00086   long f_anyof;
00087   long f_imm8;
00088   long f_reg;
00089   long f_addr16cjp;
00090   long f_dir;
00091   long f_bitno;
00092   long f_op3;
00093   long f_op4;
00094   long f_op4mid;
00095   long f_op6;
00096   long f_op8;
00097   long f_op6_10low;
00098   long f_op6_7low;
00099   long f_reti3;
00100   long f_skipb;
00101   long f_page3;
00102 };
00103 
00104 #define CGEN_INIT_PARSE(od) \
00105 {\
00106 }
00107 #define CGEN_INIT_INSERT(od) \
00108 {\
00109 }
00110 #define CGEN_INIT_EXTRACT(od) \
00111 {\
00112 }
00113 #define CGEN_INIT_PRINT(od) \
00114 {\
00115 }
00116 
00117 
00118 #endif /* IP2K_OPC_H */