📄 archdefs.h
字号:
/* * mips_start_of_legal_notice * * Copyright (c) 2004 MIPS Technologies, Inc. All rights reserved. * * * Unpublished rights (if any) reserved under the copyright laws of the * United States of America and other countries. * * This code is proprietary to MIPS Technologies, Inc. ("MIPS * Technologies"). Any copying, reproducing, modifying or use of this code * (in whole or in part) that is not expressly permitted in writing by MIPS * Technologies or an authorized third party is strictly prohibited. At a * minimum, this code is protected under unfair competition and copyright * laws. Violations thereof may result in criminal penalties and fines. * * MIPS Technologies reserves the right to change this code to improve * function, design or otherwise. MIPS Technologies does not assume any * liability arising out of the application or use of this code, or of any * error or omission in such code. Any warranties, whether express, * statutory, implied or otherwise, including but not limited to the implied * warranties of merchantability or fitness for a particular purpose, are * excluded. Except as expressly provided in any written license agreement * from MIPS Technologies or an authorized third party, the furnishing of * this code does not give recipient any license to any intellectual * property rights, including any patent rights, that cover this code. * * This code shall not be exported, reexported, transferred, or released, * directly or indirectly, in violation of the law of any country or * international law, regulation, treaty, Executive Order, statute, * amendments or supplements thereto. Should a conflict arise regarding the * export, reexport, transfer, or release of this code, the laws of the * United States of America shall be the governing law. * * This code constitutes one or more of the following: commercial computer * software, commercial computer software documentation or other commercial * items. If the user of this code, or any related documentation of any * kind, including related technical data or manuals, is an agency, * department, or other entity of the United States government * ("Government"), the use, duplication, reproduction, release, * modification, disclosure, or transfer of this code, or any related * documentation of any kind, is restricted in accordance with Federal * Acquisition Regulation 12.212 for civilian agencies and Defense Federal * Acquisition Regulation Supplement 227.7202 for military agencies. The use * of this code by the Government is further restricted in accordance with * the terms of the license agreement(s) and/or applicable contract terms * and conditions covering this code from MIPS Technologies or an authorized * third party. * * * * * mips_end_of_legal_notice * * *++ * File: ArchDefs.h * * Description: * Architecture definitions * * Compile Options: * MIPSAVPENV selects the special MIPS AVP environment * * Notes: * * ArchDefs.h: 1.126 */#ifndef _ArchDefs_h_#define _ArchDefs_h_/* * Define __ASSEMBLER__ if a different tool specific define indicating * the an assembly language file is being processed is set. This allows * support for new tools to be added in one place (here). The remainder * of ArchDefs.h simply uses __ASSEMBLER__ to separate assembly specific * code from C or C++ code. */#if defined(MIPSAVPENV) || defined(__LANGUAGE_ASM__) || defined(__assembler)#undef __ASSEMBLER__#define __ASSEMBLER__#endif/* * Utility defines for cross platform handling of 64bit constants. */#if defined(__ASSEMBLER__) #undef UINT64_C #undef INT64_C #define UINT64_C(c) c #define INT64_C(c) c#endif /* defined(__ASSEMBLER__) *//* ************************************************************************ * I N S T R U C T I O N F O R M A T S * ************************************************************************ * * The following definitions describe each field in an instruction. There * is one diagram for each type of instruction, with field definitions * following the diagram for that instruction. Note that if a field of * the same name and position is defined in an earlier diagram, it is * not defined again in the subsequent diagram. Only new fields are * defined for each diagram. * * R-Type (operate) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | | rs | rt | rd | sa | | * | Opcode | | | Tcode | func | * | | Bcode | | * | | |s| |h| |s| | * | | |r| |b| hint |c| | sel | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnOpcode 26#define M_InstnOpcode (0x3f << S_InstnOpcode)#define S_InstnRS 21#define M_InstnRS (0x1f << S_InstnRS)#define S_InstnRT 16#define M_InstnRT (0x1f << S_InstnRT)#define S_InstnRD 11#define M_InstnRD (0x1f << S_InstnRD)#define S_InstnSA 6#define M_InstnSA (0x1f << S_InstnSA)#define S_InstnTcode 6#define M_InstnTcode (0x3ff << S_InstnTcode)#define S_InstnBcode 6#define M_InstnBcode (0xfffff << S_InstnBcode)#define S_InstnFunc 0#define M_InstnFunc (0x3f << S_InstnFunc)#define S_InstnSel 0#define M_InstnSel (0x7 << S_InstnSel)/* to distinguish release2 DI/EI */#define S_InstnSC 5#define M_InstnSC (0x1 << S_InstnSC)/* to distinguish release2 shift/rotate */#define S_InstnSR 21#define M_InstnSR (0x1 << S_InstnSR)/* to distinguish release2 jump with hazard barrier */#define S_InstnHB 10#define M_InstnHB (0x1 << S_InstnHB)/* * I-Type (load, store, branch, immediate) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | rs | rt | Offset | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnOffset 0#define M_InstnOffset (0xffff << S_InstnOffset)/* * I-Type (pref) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | rs | hint | Offset | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnHint S_InstnRT#define M_InstnHint M_InstnRT/* * J-Type (jump) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | JIndex | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnJIndex 0#define M_InstnJIndex (0x03ffffff << S_InstnJIndex)/* * FP R-Type (operate) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | fmt | ft | fs | fd | func | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnFmt S_InstnRS#define M_InstnFmt M_InstnRS#define S_InstnFT S_InstnRT#define M_InstnFT M_InstnRT#define S_InstnFS S_InstnRD#define M_InstnFS M_InstnRD#define S_InstnFD S_InstnSA#define M_InstnFD M_InstnSA/* * FP R-Type (cpu <-> cpu data movement)) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | sub | rt | fs | 0 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnSub S_InstnRS#define M_InstnSub M_InstnRS/* * FP R-Type (compare) * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | | | | | | |C| | * | Opcode | fmt | ft | fs | cc |0|A| func | * | | | | | | |B| | * | | | | | | |S| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnCCcmp 8#define M_InstnCCcmp (0x7 << S_InstnCCcmp)#define S_InstnCABS 6#define M_InstnCABS (0x1 << S_InstnCABS)/* * FP R-Type (FPR conditional move on FP cc) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | fmt | cc |n|t| fs | fd | func | * | | | |d|f| | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnCC 18#define M_InstnCC (0x7 << S_InstnCC)#define S_InstnND 17#define M_InstnND (0x1 << S_InstnND)#define S_InstnTF 16#define M_InstnTF (0x1 << S_InstnTF)/* * FP R-Type (3-operand operate) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | fr | ft | fs | fd | op4 | fmt3| * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnFR S_InstnRS#define M_InstnFR M_InstnRS#define S_InstnOp4 3#define M_InstnOp4 (0x7 << S_InstnOp4)#define S_InstnFmt3 0#define M_InstnFmt3 (0x7 << S_InstnFmt3)/* * FP R-Type (Indexed load, store) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | rs | rt | 0 | fd | func | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ *//* * FP R-Type (prefx) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | rs | rt | hint | 0 | func | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnHintX S_InstnRD#define M_InstnHintX M_InstnRD/* * FP R-Type (GPR conditional move on FP cc) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | rs | cc |n|t| rd | 0 | func | * | | | |d|f| | | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ *//* * FP I-Type (load, store) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | rs | ft | Offset | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ *//* * FP I-Type (branch) * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | fmt | cc |n|t| Offset | * | | | |d|f| | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ *//* * Vector Type * * bit[25:21] This field is mostly format select (fmtsel), or combind * with operation select for shuffle, read/write accumulator, * or fourth register (rs) for variable alignment, or * immediate for constant alignment. * bit[10] L bit is only used for VMac instructions. * * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 * 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * | Opcode | fmtsel | vt | vs | vd | func | * | | fmt/op | | | | | * | | rs | | | | | * | | 0 | imm | | |L| | | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */#define S_InstnVT S_InstnRT#define M_InstnVT M_InstnRT#define S_InstnVS S_InstnRD#define M_InstnVS M_InstnRD#define S_InstnVD S_InstnSA#define M_InstnVD M_InstnSA#define S_InstnFmtsel S_InstnFmt#define M_InstnFmtsel (0x1 << S_InstnFmtsel)#define S_InstnVImm S_InstnFmt#define M_InstnVImm (0x7 << S_InstnVImm)#define S_InstnL 10#define M_InstnL (0x1 << S_InstnL)/* ************************************************************************ * M I P S 1 6 I N S T R U C T I O N F O R M A T S * ************************************************************************ *//* * MIPS16 I Type (operate) * * 1 1 1 1 1 1 * 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -