Back to index

cell-binutils  2.17cvs20070401
openrisc-opc.h
Go to the documentation of this file.
00001 /* Instruction opcode header for openrisc.
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 OPENRISC_OPC_H
00026 #define OPENRISC_OPC_H
00027 
00028 /* -- opc.h */
00029 #undef  CGEN_DIS_HASH_SIZE
00030 #define CGEN_DIS_HASH_SIZE 64
00031 #undef  CGEN_DIS_HASH
00032 #define CGEN_DIS_HASH(buffer, value) (((unsigned char *) (buffer))[0] >> 2)
00033 
00034 extern long openrisc_sign_extend_16bit (long);
00035 /* -- */
00036 /* Enum declaration for openrisc instruction types.  */
00037 typedef enum cgen_insn_type {
00038   OPENRISC_INSN_INVALID, OPENRISC_INSN_L_J, OPENRISC_INSN_L_JAL, OPENRISC_INSN_L_JR
00039  , OPENRISC_INSN_L_JALR, OPENRISC_INSN_L_BAL, OPENRISC_INSN_L_BNF, OPENRISC_INSN_L_BF
00040  , OPENRISC_INSN_L_BRK, OPENRISC_INSN_L_RFE, OPENRISC_INSN_L_SYS, OPENRISC_INSN_L_NOP
00041  , OPENRISC_INSN_L_MOVHI, OPENRISC_INSN_L_MFSR, OPENRISC_INSN_L_MTSR, OPENRISC_INSN_L_LW
00042  , OPENRISC_INSN_L_LBZ, OPENRISC_INSN_L_LBS, OPENRISC_INSN_L_LHZ, OPENRISC_INSN_L_LHS
00043  , OPENRISC_INSN_L_SW, OPENRISC_INSN_L_SB, OPENRISC_INSN_L_SH, OPENRISC_INSN_L_SLL
00044  , OPENRISC_INSN_L_SLLI, OPENRISC_INSN_L_SRL, OPENRISC_INSN_L_SRLI, OPENRISC_INSN_L_SRA
00045  , OPENRISC_INSN_L_SRAI, OPENRISC_INSN_L_ROR, OPENRISC_INSN_L_RORI, OPENRISC_INSN_L_ADD
00046  , OPENRISC_INSN_L_ADDI, OPENRISC_INSN_L_SUB, OPENRISC_INSN_L_SUBI, OPENRISC_INSN_L_AND
00047  , OPENRISC_INSN_L_ANDI, OPENRISC_INSN_L_OR, OPENRISC_INSN_L_ORI, OPENRISC_INSN_L_XOR
00048  , OPENRISC_INSN_L_XORI, OPENRISC_INSN_L_MUL, OPENRISC_INSN_L_MULI, OPENRISC_INSN_L_DIV
00049  , OPENRISC_INSN_L_DIVU, OPENRISC_INSN_L_SFGTS, OPENRISC_INSN_L_SFGTU, OPENRISC_INSN_L_SFGES
00050  , OPENRISC_INSN_L_SFGEU, OPENRISC_INSN_L_SFLTS, OPENRISC_INSN_L_SFLTU, OPENRISC_INSN_L_SFLES
00051  , OPENRISC_INSN_L_SFLEU, OPENRISC_INSN_L_SFGTSI, OPENRISC_INSN_L_SFGTUI, OPENRISC_INSN_L_SFGESI
00052  , OPENRISC_INSN_L_SFGEUI, OPENRISC_INSN_L_SFLTSI, OPENRISC_INSN_L_SFLTUI, OPENRISC_INSN_L_SFLESI
00053  , OPENRISC_INSN_L_SFLEUI, OPENRISC_INSN_L_SFEQ, OPENRISC_INSN_L_SFEQI, OPENRISC_INSN_L_SFNE
00054  , OPENRISC_INSN_L_SFNEI
00055 } CGEN_INSN_TYPE;
00056 
00057 /* Index of `invalid' insn place holder.  */
00058 #define CGEN_INSN_INVALID OPENRISC_INSN_INVALID
00059 
00060 /* Total number of insns in table.  */
00061 #define MAX_INSNS ((int) OPENRISC_INSN_L_SFNEI + 1)
00062 
00063 /* This struct records data prior to insertion or after extraction.  */
00064 struct cgen_fields
00065 {
00066   int length;
00067   long f_nil;
00068   long f_anyof;
00069   long f_class;
00070   long f_sub;
00071   long f_r1;
00072   long f_r2;
00073   long f_r3;
00074   long f_simm16;
00075   long f_uimm16;
00076   long f_uimm5;
00077   long f_hi16;
00078   long f_lo16;
00079   long f_op1;
00080   long f_op2;
00081   long f_op3;
00082   long f_op4;
00083   long f_op5;
00084   long f_op6;
00085   long f_op7;
00086   long f_i16_1;
00087   long f_i16_2;
00088   long f_disp26;
00089   long f_abs26;
00090   long f_i16nc;
00091   long f_f_15_8;
00092   long f_f_10_3;
00093   long f_f_4_1;
00094   long f_f_7_3;
00095   long f_f_10_7;
00096   long f_f_10_11;
00097 };
00098 
00099 #define CGEN_INIT_PARSE(od) \
00100 {\
00101 }
00102 #define CGEN_INIT_INSERT(od) \
00103 {\
00104 }
00105 #define CGEN_INIT_EXTRACT(od) \
00106 {\
00107 }
00108 #define CGEN_INIT_PRINT(od) \
00109 {\
00110 }
00111 
00112 
00113 #endif /* OPENRISC_OPC_H */