bitfields.isa revision 5222
12124SN/A// -*- mode:c++ -*-
22124SN/A
35222Sksewell@umich.edu// Copyright .AN) 2007 MIPS Technologies, Inc.  All Rights Reserved
42706Sksewell@umich.edu
55222Sksewell@umich.edu//  This software is part of the M5 simulator.
65222Sksewell@umich.edu
75222Sksewell@umich.edu//  THIS IS A LEGAL AGREEMENT.  BY DOWNLOADING, USING, COPYING, CREATING
85222Sksewell@umich.edu//  DERIVATIVE WORKS, AND/OR DISTRIBUTING THIS SOFTWARE YOU ARE AGREEING
95222Sksewell@umich.edu//  TO THESE TERMS AND CONDITIONS.
105222Sksewell@umich.edu
115222Sksewell@umich.edu//  Permission is granted to use, copy, create derivative works and
125222Sksewell@umich.edu//  distribute this software and such derivative works for any purpose,
135222Sksewell@umich.edu//  so long as (1) the copyright notice above, this grant of permission,
145222Sksewell@umich.edu//  and the disclaimer below appear in all copies and derivative works
155222Sksewell@umich.edu//  made, (2) the copyright notice above is augmented as appropriate to
165222Sksewell@umich.edu//  reflect the addition of any new copyrightable work in a derivative
175222Sksewell@umich.edu//  work (e.g., Copyright .AN) <Publication Year> Copyright Owner), and (3)
185222Sksewell@umich.edu//  the name of MIPS Technologies, Inc. ($B!H(BMIPS$B!I(B) is not used in any
195222Sksewell@umich.edu//  advertising or publicity pertaining to the use or distribution of
205222Sksewell@umich.edu//  this software without specific, written prior authorization.
215222Sksewell@umich.edu
225222Sksewell@umich.edu//  THIS SOFTWARE IS PROVIDED $B!H(BAS IS.$B!I(B  MIPS MAKES NO WARRANTIES AND
235222Sksewell@umich.edu//  DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS, STATUTORY, IMPLIED OR
245222Sksewell@umich.edu//  OTHERWISE, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
255222Sksewell@umich.edu//  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
265222Sksewell@umich.edu//  NON-INFRINGEMENT OF THIRD PARTY RIGHTS, REGARDING THIS SOFTWARE.
275222Sksewell@umich.edu//  IN NO EVENT SHALL MIPS BE LIABLE FOR ANY DAMAGES, INCLUDING DIRECT,
285222Sksewell@umich.edu//  INDIRECT, INCIDENTAL, CONSEQUENTIAL, SPECIAL, OR PUNITIVE DAMAGES OF
295222Sksewell@umich.edu//  ANY KIND OR NATURE, ARISING OUT OF OR IN CONNECTION WITH THIS AGREEMENT,
305222Sksewell@umich.edu//  THIS SOFTWARE AND/OR THE USE OF THIS SOFTWARE, WHETHER SUCH LIABILITY
315222Sksewell@umich.edu//  IS ASSERTED ON THE BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE OR
325222Sksewell@umich.edu//  STRICT LIABILITY), OR OTHERWISE, EVEN IF MIPS HAS BEEN WARNED OF THE
335222Sksewell@umich.edu//  POSSIBILITY OF ANY SUCH LOSS OR DAMAGE IN ADVANCE.
345222Sksewell@umich.edu
355222Sksewell@umich.edu//Authors: Korey L. Sewell
365222Sksewell@umich.edu//         Jaidev Patwardhan
375222Sksewell@umich.edu
385222Sksewell@umich.edu
392022SN/A////////////////////////////////////////////////////////////////////
402022SN/A//
412022SN/A// Bitfield definitions.
422022SN/A//
432022SN/A
442135SN/Adef bitfield OPCODE     <31:26>;
452025SN/Adef bitfield OPCODE_HI  <31:29>;
462025SN/Adef bitfield OPCODE_LO  <28:26>;
472022SN/A
482135SN/Adef bitfield REGIMM      <20:16>;
492135SN/Adef bitfield REGIMM_HI   <20:19>;
502135SN/Adef bitfield REGIMM_LO   <18:16>;
512135SN/A
522135SN/Adef bitfield FUNCTION      < 5: 0>;
532026SN/Adef bitfield FUNCTION_HI   < 5: 3>;
542026SN/Adef bitfield FUNCTION_LO   < 2: 0>;
552025SN/A
562026SN/Adef bitfield RS	      <25:21>;
572061SN/Adef bitfield RS_MSB   <25:25>;
582026SN/Adef bitfield RS_HI    <25:24>;
592026SN/Adef bitfield RS_LO    <23:21>;
602686Sksewell@umich.edudef bitfield RS_SRL   <25:22>;
612686Sksewell@umich.edudef bitfield RS_RT    <25:16>;
622686Sksewell@umich.edudef bitfield RT	      <20:16>;
632686Sksewell@umich.edudef bitfield RT_HI    <20:19>;
642686Sksewell@umich.edudef bitfield RT_LO    <18:16>;
652686Sksewell@umich.edudef bitfield RT_RD    <20:11>;
662029SN/Adef bitfield RD	      <15:11>;
672026SN/A
682686Sksewell@umich.edudef bitfield INTIMM	  <15: 0>;
694661Sksewell@umich.edudef bitfield RS_RT_INTIMM <25: 0>;
702041SN/A
712029SN/A// Floating-point operate format
722041SN/Adef bitfield FMT      <25:21>;
732239SN/Adef bitfield FR       <25:21>;
742029SN/Adef bitfield FT	      <20:16>;
752029SN/Adef bitfield FS	      <15:11>;
762029SN/Adef bitfield FD	      <10:6>;
772029SN/A
782135SN/Adef bitfield ND       <17:17>;
792135SN/Adef bitfield TF       <16:16>;
802029SN/Adef bitfield MOVCI    <16:16>;
812029SN/Adef bitfield MOVCF    <16:16>;
822029SN/Adef bitfield SRL      <21:21>;
832029SN/Adef bitfield SRLV     < 6: 6>;
842029SN/Adef bitfield SA       <10: 6>;
852029SN/A
862601SN/A// Floating Point Condition Codes
872601SN/Adef bitfield CC <10:8>;
882601SN/Adef bitfield BRANCH_CC <20:18>;
892601SN/A
902239SN/A// CP0 Register Select
912239SN/Adef bitfield SEL       < 2: 0>;
922239SN/A
934661Sksewell@umich.edu// INTERRUPTS
942029SN/Adef bitfield SC       < 5: 5>;
952025SN/A
962029SN/A// Branch format
972029SN/Adef bitfield OFFSET <15: 0>; // displacement
982025SN/A
992124SN/A// Jmp format
1002043SN/Adef bitfield JMPTARG	<25: 0>;
1012135SN/Adef bitfield HINT	<10: 6>;
1022025SN/A
1032043SN/Adef bitfield SYSCALLCODE <25: 6>;
1042043SN/Adef bitfield TRAPCODE    <15:13>;
1052025SN/A
1062686Sksewell@umich.edu// EXT/INS instructions
1072686Sksewell@umich.edudef bitfield MSB	<15:11>;
1082686Sksewell@umich.edudef bitfield LSB	<10: 6>;
1092686Sksewell@umich.edu
1102025SN/A// M5 instructions
1112025SN/Adef bitfield M5FUNC <7:0>;
1124661Sksewell@umich.edu
1134661Sksewell@umich.edu// DSP instructions
1144661Sksewell@umich.edudef bitfield OP        <10:6>;
1154661Sksewell@umich.edudef bitfield OP_HI     <10:9>;
1164661Sksewell@umich.edudef bitfield OP_LO     <8:6>;
1174661Sksewell@umich.edudef bitfield DSPSA     <23:21>;
1184661Sksewell@umich.edudef bitfield HILOSA    <25:20>;
1194661Sksewell@umich.edudef bitfield RDDSPMASK <21:16>;
1204661Sksewell@umich.edudef bitfield WRDSPMASK <16:11>;
1214661Sksewell@umich.edudef bitfield ACSRC     <22:21>;
1224661Sksewell@umich.edudef bitfield ACDST     <12:11>;
1234661Sksewell@umich.edudef bitfield BP        <12:11>;
1244661Sksewell@umich.edu
1254661Sksewell@umich.edu// MT Instructions
1264661Sksewell@umich.edudef bitfield POS   <10: 6>;
1274661Sksewell@umich.edudef bitfield MT_U     <5:5>;
1284661Sksewell@umich.edudef bitfield MT_H     <4:4>;
1295222Sksewell@umich.edu
1305222Sksewell@umich.edu//Cache Ops
1315222Sksewell@umich.edudef bitfield CACHE_OP <20:16>;
132