12124SN/A// -*- mode:c++ -*-
22124SN/A
35268Sksewell@umich.edu// Copyright (c) 2007 MIPS Technologies, Inc.
45268Sksewell@umich.edu// All rights reserved.
55268Sksewell@umich.edu//
65268Sksewell@umich.edu// Redistribution and use in source and binary forms, with or without
75268Sksewell@umich.edu// modification, are permitted provided that the following conditions are
85268Sksewell@umich.edu// met: redistributions of source code must retain the above copyright
95268Sksewell@umich.edu// notice, this list of conditions and the following disclaimer;
105268Sksewell@umich.edu// redistributions in binary form must reproduce the above copyright
115268Sksewell@umich.edu// notice, this list of conditions and the following disclaimer in the
125268Sksewell@umich.edu// documentation and/or other materials provided with the distribution;
135268Sksewell@umich.edu// neither the name of the copyright holders nor the names of its
145268Sksewell@umich.edu// contributors may be used to endorse or promote products derived from
155268Sksewell@umich.edu// this software without specific prior written permission.
165268Sksewell@umich.edu//
175268Sksewell@umich.edu// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
185268Sksewell@umich.edu// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
195268Sksewell@umich.edu// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
205268Sksewell@umich.edu// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
215268Sksewell@umich.edu// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
225268Sksewell@umich.edu// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
235268Sksewell@umich.edu// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
245268Sksewell@umich.edu// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
255268Sksewell@umich.edu// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
265268Sksewell@umich.edu// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
275268Sksewell@umich.edu// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
285268Sksewell@umich.edu//
295268Sksewell@umich.edu// Authors: Korey Sewell
305268Sksewell@umich.edu//          Jaidev Patwardhan
315222Sksewell@umich.edu
322022SN/A////////////////////////////////////////////////////////////////////
332022SN/A//
342022SN/A// Bitfield definitions.
352022SN/A//
362022SN/A
372135SN/Adef bitfield OPCODE     <31:26>;
382025SN/Adef bitfield OPCODE_HI  <31:29>;
392025SN/Adef bitfield OPCODE_LO  <28:26>;
402022SN/A
412135SN/Adef bitfield REGIMM      <20:16>;
422135SN/Adef bitfield REGIMM_HI   <20:19>;
432135SN/Adef bitfield REGIMM_LO   <18:16>;
442135SN/A
452135SN/Adef bitfield FUNCTION      < 5: 0>;
462026SN/Adef bitfield FUNCTION_HI   < 5: 3>;
472026SN/Adef bitfield FUNCTION_LO   < 2: 0>;
482025SN/A
497799Sgblack@eecs.umich.edudef bitfield RS       <25:21>;
502061SN/Adef bitfield RS_MSB   <25:25>;
512026SN/Adef bitfield RS_HI    <25:24>;
522026SN/Adef bitfield RS_LO    <23:21>;
532686Sksewell@umich.edudef bitfield RS_SRL   <25:22>;
542686Sksewell@umich.edudef bitfield RS_RT    <25:16>;
557799Sgblack@eecs.umich.edudef bitfield RT       <20:16>;
562686Sksewell@umich.edudef bitfield RT_HI    <20:19>;
572686Sksewell@umich.edudef bitfield RT_LO    <18:16>;
582686Sksewell@umich.edudef bitfield RT_RD    <20:11>;
597799Sgblack@eecs.umich.edudef bitfield RD       <15:11>;
602026SN/A
617799Sgblack@eecs.umich.edudef bitfield INTIMM       <15: 0>;
624661Sksewell@umich.edudef bitfield RS_RT_INTIMM <25: 0>;
632041SN/A
642029SN/A// Floating-point operate format
652041SN/Adef bitfield FMT      <25:21>;
662239SN/Adef bitfield FR       <25:21>;
677799Sgblack@eecs.umich.edudef bitfield FT       <20:16>;
687799Sgblack@eecs.umich.edudef bitfield FS       <15:11>;
697799Sgblack@eecs.umich.edudef bitfield FD       <10:6>;
702029SN/A
712135SN/Adef bitfield ND       <17:17>;
722135SN/Adef bitfield TF       <16:16>;
732029SN/Adef bitfield MOVCI    <16:16>;
742029SN/Adef bitfield MOVCF    <16:16>;
752029SN/Adef bitfield SRL      <21:21>;
762029SN/Adef bitfield SRLV     < 6: 6>;
772029SN/Adef bitfield SA       <10: 6>;
782029SN/A
792601SN/A// Floating Point Condition Codes
802601SN/Adef bitfield CC <10:8>;
812601SN/Adef bitfield BRANCH_CC <20:18>;
822601SN/A
832239SN/A// CP0 Register Select
842239SN/Adef bitfield SEL       < 2: 0>;
852239SN/A
864661Sksewell@umich.edu// INTERRUPTS
872029SN/Adef bitfield SC       < 5: 5>;
882025SN/A
892029SN/A// Branch format
902029SN/Adef bitfield OFFSET <15: 0>; // displacement
912025SN/A
922124SN/A// Jmp format
937799Sgblack@eecs.umich.edudef bitfield JMPTARG    <25: 0>;
947799Sgblack@eecs.umich.edudef bitfield HINT       <10: 6>;
952025SN/A
962043SN/Adef bitfield SYSCALLCODE <25: 6>;
972043SN/Adef bitfield TRAPCODE    <15:13>;
982025SN/A
992686Sksewell@umich.edu// EXT/INS instructions
1007799Sgblack@eecs.umich.edudef bitfield MSB        <15:11>;
1017799Sgblack@eecs.umich.edudef bitfield LSB        <10: 6>;
1022686Sksewell@umich.edu
1032025SN/A// M5 instructions
1042025SN/Adef bitfield M5FUNC <7:0>;
1054661Sksewell@umich.edu
1064661Sksewell@umich.edu// DSP instructions
1074661Sksewell@umich.edudef bitfield OP        <10:6>;
1084661Sksewell@umich.edudef bitfield OP_HI     <10:9>;
1094661Sksewell@umich.edudef bitfield OP_LO     <8:6>;
1104661Sksewell@umich.edudef bitfield DSPSA     <23:21>;
1114661Sksewell@umich.edudef bitfield HILOSA    <25:20>;
1124661Sksewell@umich.edudef bitfield RDDSPMASK <21:16>;
1134661Sksewell@umich.edudef bitfield WRDSPMASK <16:11>;
1144661Sksewell@umich.edudef bitfield ACSRC     <22:21>;
1154661Sksewell@umich.edudef bitfield ACDST     <12:11>;
1164661Sksewell@umich.edudef bitfield BP        <12:11>;
1174661Sksewell@umich.edu
1184661Sksewell@umich.edu// MT Instructions
1194661Sksewell@umich.edudef bitfield POS   <10: 6>;
1204661Sksewell@umich.edudef bitfield MT_U     <5:5>;
1214661Sksewell@umich.edudef bitfield MT_H     <4:4>;
1225222Sksewell@umich.edu
1235222Sksewell@umich.edu//Cache Ops
1245222Sksewell@umich.edudef bitfield CACHE_OP <20:16>;
125