Document Number: MD00086
Revision 0.95
March 12, 2001
MIPS Technologies, Inc.
1225 Charleston Road
Mountain View, CA 94043-1353
MIPS32™ Architecture For Programmers
Volume II: The MIPS32™ Instruction Set
Copyright © 2000-2001 MIPS Technologies, Inc. All rights reserved.
Unpublished rights reserved under the Copyright Laws of the United States of America.
This document contains information that is proprietary to MIPS Technologies, Inc. (“MIPS Technologies”). Any
copying, modifyingor use of this information (in whole or in part) which is not expressly permitted in writing by MIPS
Technologies or a contractually-authorized third party is strictly prohibited. At a minimum, this information is protected
under unfair competition laws and the expression of the information contained herein is protected under federal
copyright laws. Violations thereof may result in criminal penalties and fines.
MIPS Technologies or any contractually-authorized third party reserves the right to change the information contained in
this document to improve function, design or otherwise. MIPS Technologies does not assume any liability arising out of
the application or use of this information. Any license under patent rights or any other intellectual property rights owned
by MIPS Technologies or third parties shall be conveyed by MIPS Technologies or any contractually-authorized third
party in a separate license agreement between the parties.
The information contained in this document constitutes one or more of the following: commercial computer software,
commercial computer software documentation or other commercial items. If the user of this information, 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 information, 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 information 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 information from MIPS
Technologies or any contractually-authorized third party.
MIPS, R3000, R4000, R5000, R8000 and R10000 are among the registered trademarks of MIPS Technologies, Inc., and
R4300, R20K, MIPS16, MIPS32, MIPS64, MIPS-3D, MIPS I, MIPS II, MIPS III, MIPS IV, MIPS V, MDMX,
SmartMIPS, 4K, 4Kc, 4Km, 4Kp, 5K, 5Kc, 20K, 20Kc, EC, MGB, SOC-it, SEAD, YAMON, ATLAS, JALGO, CoreLV
and MIPS-based are among the trademarks of MIPS Technologies, Inc.
All other trademarks referred to herein are the property of their respective owners.
MIPS32™ Architecture For Programmers Volume II, Revision 0.95
MIPS32™ Architecture For Programmers Volume II, Revision 0.95 i
Table of Contents
Chapter 1 About This Book ........................................................................................................................................................ 1
1.1 Typographical Conventions ........................................................................................................................................... 1
1.1.1 Italic Text............................................................................................................................................................. 1
1.1.2 Bold Text ............................................................................................................................................................. 1
1.1.3 Courier Text......................................................................................................................................................... 1
1.2 UNPREDICTABLE and UNDEFINED ........................................................................................................................ 2
1.2.1 UNPREDICTABLE............................................................................................................................................. 2
1.2.2 UNDEFINED....................................................................................................................................................... 2
1.3 Special Symbols in Pseudocode Notation...................................................................................................................... 2
1.4 For More Information .................................................................................................................................................... 5
Chapter 2 Guide to the Instruction Set........................................................................................................................................ 7
2.1 Understanding the Instruction Fields ............................................................................................................................. 7
2.1.1 Instruction Fields ................................................................................................................................................. 8
2.1.2 Instruction Descriptive Name and Mnemonic..................................................................................................... 9
2.1.3 Format Field......................................................................................................................................................... 9
2.1.4 Purpose Field ..................................................................................................................................................... 10
2.1.5 Description Field................................................................................................................................................ 10
2.1.6 Restrictions Field ............................................................................................................................................... 10
2.1.7 Operation Field .................................................................................................................................................. 11
2.1.8 Exceptions Field................................................................................................................................................. 11
2.1.9 Programming Notes and Implementation Notes Fields..................................................................................... 11
2.2 Operation Section Notation and Functions .................................................................................................................. 12
2.2.1 Instruction Execution Ordering.......................................................................................................................... 12
2.2.2 Pseudocode Functions........................................................................................................................................ 12
2.3 Op and Function Subfield Notation ............................................................................................................................. 20
2.4 FPU Instructions .......................................................................................................................................................... 20
Chapter 3 The MIPS32™ Instruction Set ................................................................................................................................. 21
3.1 Compliance and Subsetting.......................................................................................................................................... 21
3.2 Alphabetical List of Instructions.................................................................................................................................. 21
ABS.fmt ............................................................................................................................................................................................................................... 30
ADD..................................................................................................................................................................................................................................... 31
ADD.fmt .............................................................................................................................................................................................................................. 33
ADDI.................................................................................................................................................................................................................................... 34
ADDIU................................................................................................................................................................................................................................. 35
ADDU.................................................................................................................................................................................................................................. 36
AND..................................................................................................................................................................................................................................... 37
ANDI.................................................................................................................................................................................................................................... 38
B........................................................................................................................................................................................................................................... 39
BAL...................................................................................................................................................................................................................................... 40
BC1F.................................................................................................................................................................................................................................... 41
BC1FL ................................................................................................................................................................................................................................. 43
BC1T.................................................................................................................................................................................................................................... 45
BC1TL ................................................................................................................................................................................................................................. 47
BC2F.................................................................................................................................................................................................................................... 49
BC2FL ................................................................................................................................................................................................................................. 50
BC2T.................................................................................................................................................................................................................................... 52
BC2TL ................................................................................................................................................................................................................................. 53
BEQ...................................................................................................................................................................................................................................... 55
BEQL................................................................................................................................................................................................................................... 56
BGEZ................................................................................................................................................................................................................................... 58
BGEZAL.............................................................................................................................................................................................................................. 59
BGEZALL ........................................................................................................................................................................................................................... 60
BGEZL................................................................................................................................................................................................................................. 62
ii MIPS32™ Architecture For Programmers Volume II, Revision 0.95
BGTZ................................................................................................................................................................................................................................... 64
BGTZL................................................................................................................................................................................................................................. 65
BLEZ.................................................................................................................................................................................................................................... 67
BLEZL................................................................................................................................................................................................................................. 68
BLTZ.................................................................................................................................................................................................................................... 70
BLTZAL .............................................................................................................................................................................................................................. 71
BLTZALL............................................................................................................................................................................................................................ 72
BLTZL................................................................................................................................................................................................................................. 74
BNE...................................................................................................................................................................................................................................... 76
BNEL................................................................................................................................................................................................................................... 77
BREAK................................................................................................................................................................................................................................ 79
C.cond.fmt............................................................................................................................................................................................................................ 80
CACHE................................................................................................................................................................................................................................ 85
CEIL.W.fmt ......................................................................................................................................................................................................................... 91
CFC1.................................................................................................................................................................................................................................... 92
CFC2.................................................................................................................................................................................................................................... 95
CLO...................................................................................................................................................................................................................................... 96
CLZ...................................................................................................................................................................................................................................... 97
COP2.................................................................................................................................................................................................................................... 99
CTC1.................................................................................................................................................................................................................................. 100
CTC2.................................................................................................................................................................................................................................. 103
CVT.D.fmt......................................................................................................................................................................................................................... 104
CVT.S.fmt.......................................................................................................................................................................................................................... 105
CVT.W.fmt ........................................................................................................................................................................................................................ 106
DERET............................................................................................................................................................................................................................... 107
DIV .................................................................................................................................................................................................................................... 109
DIV.fmt.............................................................................................................................................................................................................................. 111
DIVU.................................................................................................................................................................................................................................. 112
ERET.................................................................................................................................................................................................................................. 113
FLOOR.W.fmt................................................................................................................................................................................................................... 114
J.......................................................................................................................................................................................................................................... 115
JAL..................................................................................................................................................................................................................................... 116
JALR.................................................................................................................................................................................................................................. 117
JR ....................................................................................................................................................................................................................................... 119
LB ...................................................................................................................................................................................................................................... 121
LBU.................................................................................................................................................................................................................................... 122
LDC1.................................................................................................................................................................................................................................. 123
LDC2.................................................................................................................................................................................................................................. 124
LH ...................................................................................................................................................................................................................................... 125
LHU ................................................................................................................................................................................................................................... 126
LL....................................................................................................................................................................................................................................... 127
LUI..................................................................................................................................................................................................................................... 129
LW ..................................................................................................................................................................................................................................... 130
LWC1................................................................................................................................................................................................................................. 131
LWC2................................................................................................................................................................................................................................. 132
LWL................................................................................................................................................................................................................................... 133
LWR................................................................................................................................................................................................................................... 137
MADD ............................................................................................................................................................................................................................... 141
MADDU ............................................................................................................................................................................................................................ 142
MFC0................................................................................................................................................................................................................................. 143
MFC1................................................................................................................................................................................................................................. 144
MFC2................................................................................................................................................................................................................................. 145
MFHI.................................................................................................................................................................................................................................. 146
MFLO ................................................................................................................................................................................................................................ 147
MOV.fmt............................................................................................................................................................................................................................ 148
MOVF................................................................................................................................................................................................................................ 149
MOVF.fmt ......................................................................................................................................................................................................................... 150
MOVN ............................................................................................................................................................................................................................... 152
MOVN.fmt......................................................................................................................................................................................................................... 153
MOVT................................................................................................................................................................................................................................ 155
MOVT.fmt ......................................................................................................................................................................................................................... 156
MOVZ................................................................................................................................................................................................................................ 158
MOVZ.fmt ......................................................................................................................................................................................................................... 159
MSUB ................................................................................................................................................................................................................................ 161
MSUBU ............................................................................................................................................................................................................................. 162
MTC0................................................................................................................................................................................................................................. 163
MIPS32™ Architecture For Programmers Volume II, Revision 0.95 iii
MTC1................................................................................................................................................................................................................................. 164
MTC2................................................................................................................................................................................................................................. 165
MTHI ................................................................................................................................................................................................................................. 166
MTLO ................................................................................................................................................................................................................................ 167
MUL................................................................................................................................................................................................................................... 169
MUL.fmt............................................................................................................................................................................................................................ 170
MULT ................................................................................................................................................................................................................................ 171
MULTU ............................................................................................................................................................................................................................. 172
NEG.fmt............................................................................................................................................................................................................................. 173
NOP.................................................................................................................................................................................................................................... 174
NOR................................................................................................................................................................................................................................... 175
OR...................................................................................................................................................................................................................................... 176
ORI..................................................................................................................................................................................................................................... 177
PREF.................................................................................................................................................................................................................................. 178
ROUND.W.fmt.................................................................................................................................................................................................................. 183
SB....................................................................................................................................................................................................................................... 185
SC....................................................................................................................................................................................................................................... 186
SDBBP............................................................................................................................................................................................................................... 189
SDC1.................................................................................................................................................................................................................................. 190
SDC2.................................................................................................................................................................................................................................. 191
SH ...................................................................................................................................................................................................................................... 192
SLL .................................................................................................................................................................................................................................... 193
SLLV.................................................................................................................................................................................................................................. 194
SLT .................................................................................................................................................................................................................................... 195
SLTI................................................................................................................................................................................................................................... 196
SLTIU ................................................................................................................................................................................................................................ 197
SLTU.................................................................................................................................................................................................................................. 198
SQRT.fmt........................................................................................................................................................................................................................... 199
SRA.................................................................................................................................................................................................................................... 200
SRAV................................................................................................................................................................................................................................. 201
SRL .................................................................................................................................................................................................................................... 202
SRLV ................................................................................................................................................................................................................................. 203
SSNOP............................................................................................................................................................................................................................... 204
SUB.................................................................................................................................................................................................................................... 205
SUB.fmt ............................................................................................................................................................................................................................. 206
SUBU................................................................................................................................................................................................................................. 207
SW...................................................................................................................................................................................................................................... 208
SWC1................................................................................................................................................................................................................................. 209
SWC2................................................................................................................................................................................................................................. 210
SWL................................................................................................................................................................................................................................... 211
SWR................................................................................................................................................................................................................................... 213
SYNC................................................................................................................................................................................................................................. 215
SYSCALL.......................................................................................................................................................................................................................... 219
TEQ.................................................................................................................................................................................................................................... 220
TEQI .................................................................................................................................................................................................................................. 221
TGE.................................................................................................................................................................................................................................... 222
TGEI .................................................................................................................................................................................................................................. 223
TGEIU................................................................................................................................................................................................................................ 224
TGEU................................................................................................................................................................................................................................. 225
TLBP.................................................................................................................................................................................................................................. 226
TLBR ................................................................................................................................................................................................................................. 227
TLBWI............................................................................................................................................................................................................................... 229
TLBWR.............................................................................................................................................................................................................................. 231
TLT .................................................................................................................................................................................................................................... 233
TLTI................................................................................................................................................................................................................................... 234
TLTIU................................................................................................................................................................................................................................ 235
TLTU ................................................................................................................................................................................................................................. 236
TNE.................................................................................................................................................................................................................................... 237
TNEI .................................................................................................................................................................................................................................. 238
TRUNC.W.fmt................................................................................................................................................................................................................... 239
WAIT................................................................................................................................................................................................................................. 241
XOR................................................................................................................................................................................................................................... 243
XORI.................................................................................................................................................................................................................................. 244
Appendix A Revision History................................................................................................................................................. 245