logo资料库

MIPS指令集手册.pdf

第1页 / 共463页
第2页 / 共463页
第3页 / 共463页
第4页 / 共463页
第5页 / 共463页
第6页 / 共463页
第7页 / 共463页
第8页 / 共463页
资料共463页,剩余部分请下载后查看
MIPS® Architecture for Programmers Volume II-A: The MIPS32® Instruction Set Manual
Table of Contents
List of Figures
List of Tables
About This Book
1.1 Typographical Conventions
1.1.1 Italic Text
1.1.2 Bold Text
1.1.3 Courier Text
1.2 UNPREDICTABLE and UNDEFINED
1.2.1 UNPREDICTABLE
1.2.2 UNDEFINED
1.2.3 UNSTABLE
1.3 Special Symbols in Pseudocode Notation
1.4 Notation for Register Field Accessibility
1.5 For More Information
Guide to the Instruction Set
2.1 Understanding the Instruction Fields
2.1.1 Instruction Fields
2.1.2 Instruction Descriptive Name and Mnemonic
2.1.3 Format Field
2.1.4 Purpose Field
2.1.5 Description Field
2.1.6 Restrictions Field
2.1.7 Availability and Compatibility Fields
2.1.8 Operation Field
2.1.9 Exceptions Field
2.1.10 Programming Notes and Implementation Notes Fields
2.2 Operation Section Notation and Functions
2.2.1 Instruction Execution Ordering
2.2.2 Pseudocode Functions
2.2.2.1 Coprocessor General Register Access Functions
2.2.2.2 Memory Operation Functions
2.2.2.3 Floating Point Functions
2.2.2.4 Pseudocode Functions Related to Sign and Zero Extension
2.2.2.5 Miscellaneous Functions
2.3 Op and Function Subfield Notation
2.4 FPU Instructions
The MIPS32® Instruction Set
3.1 Compliance and Subsetting
3.1.1 Subsetting of Non-Privileged Architecture
3.2 Alphabetical List of Instructions
ABS.fmt
ADD
ADD.fmt
ADDI
ADDIU
ADDIUPC
ADDU
ALIGN
ALNV.PS
ALUIPC
AND
ANDI
AUI
AUIPC
B
BAL
BALC
BC
BC1EQZ BC1NEZ
BC1F
BC1FL
BC1T
BC1TL
BC2EQZ BC2NEZ
BC2F
BC2FL
BC2T
BC2TL
BEQ
BEQL
BGEZ
BGEZAL
B{LE,GE,GT,LT,EQ,NE}ZALC
BGEZALL
BC
BGEZL
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Z
SELEQZ.fmt SELNEQZ.fmt
SH
SHE
SIGRIE
SLL
SLLV
SLT
SLTI
SLTIU
SLTU
SQRT.fmt
SRA
SRAV
SRL
SRLV
SSNOP
SUB
SUB.fmt
SUBU
SUXC1
SW
SWC1
SWC2
SWE
SWL
SWLE
SWR
SWRE
SWXC1
SYNC
SYNCI
SYSCALL
TEQ
TEQI
TGE
TGEI
TGEIU
TGEU
TLBINV
TLBINVF
TLBP
TLBR
TLBWI
TLBWR
TLT
TLTI
TLTIU
TLTU
TNE
TNEI
TRUNC.L.fmt
TRUNC.W.fmt
WAIT
WRPGPR
WSBH
XOR
XORI
Instruction Bit Encodings
A.1 Instruction Encodings and Instruction Classes
A.2 Instruction Bit Encoding Tables
A.3 Floating Point Unit Instruction Format Encodings
A.4 Release 6 Instruction Encodings
Revision History
MIPS® Architecture for Programmers Volume II-A: The MIPS32® Instruction Set Manual Document Number: MD00086 Revision 6.05 May 20, 2016 Copyright © 2016 Imagination Technologies LTD. and/or its Affiliated Group Com- panies. All rights reserved. MIPS Verified™
Public. This publication contains proprietary information which is subject to change without notice and is supplied ‘as is’, without any warranty of any kind. Template: nB1.03, Built with tags: 2B ARCH FPU_PS FPU_PSandARCH MIPS32 Copyright © 2016 Imagination Technologies LTD. and/or its Affiliated Group Companies. All rights reserved. The MIPS32® Instruction Set Manual, Revision 6.05
Table of Contents Chapter 1: About This Book .................................................................................................................. 2 1.1: Typographical Conventions ......................................................................................................................... 3 1.1.1: Italic Text............................................................................................................................................ 3 1.1.2: Bold Text ............................................................................................................................................ 3 1.1.3: Courier Text ....................................................................................................................................... 3 1.2: UNPREDICTABLE and UNDEFINED ......................................................................................................... 3 1.2.1: UNPREDICTABLE ............................................................................................................................. 3 1.2.2: UNDEFINED ...................................................................................................................................... 4 1.2.3: UNSTABLE ........................................................................................................................................ 4 1.3: Special Symbols in Pseudocode Notation................................................................................................... 4 1.4: Notation for Register Field Accessibility ...................................................................................................... 7 1.5: For More Information ................................................................................................................................... 9 Chapter 2: Guide to the Instruction Set.............................................................................................. 10 2.1: Understanding the Instruction Fields ......................................................................................................... 10 2.1.1: Instruction Fields.............................................................................................................................. 12 2.1.2: Instruction Descriptive Name and Mnemonic................................................................................... 12 2.1.3: Format Field ..................................................................................................................................... 12 2.1.4: Purpose Field ................................................................................................................................... 13 2.1.5: Description Field .............................................................................................................................. 13 2.1.6: Restrictions Field.............................................................................................................................. 13 2.1.7: Availability and Compatibility Fields ................................................................................................. 14 2.1.8: Operation Field................................................................................................................................. 15 2.1.9: Exceptions Field............................................................................................................................... 15 2.1.10: Programming Notes and Implementation Notes Fields.................................................................. 15 2.2: Operation Section Notation and Functions................................................................................................ 16 2.2.1: Instruction Execution Ordering......................................................................................................... 16 2.2.2: Pseudocode Functions..................................................................................................................... 16 2.3: Op and Function Subfield Notation............................................................................................................ 27 2.4: FPU Instructions ........................................................................................................................................ 27 Chapter 3: The MIPS32® Instruction Set ............................................................................................ 29 3.1: Compliance and Subsetting....................................................................................................................... 29 3.1.1: Subsetting of Non-Privileged Architecture ....................................................................................... 29 3.2: Alphabetical List of Instructions ................................................................................................................. 31 ABS.fmt ......................................................................................................................................................... 32 ADD............................................................................................................................................................... 33 ADD.fmt......................................................................................................................................................... 34 ADDI.............................................................................................................................................................. 35 ADDIU ........................................................................................................................................................... 36 ADDIUPC ...................................................................................................................................................... 37 ADDU ............................................................................................................................................................ 38 ALIGN............................................................................................................................................................ 39 ALNV.PS ....................................................................................................................................................... 41 ALUIPC ......................................................................................................................................................... 43 AND............................................................................................................................................................... 44 ANDI.............................................................................................................................................................. 45 3 The MIPS32® Instruction Set Manual, Revision 6.05 Copyright © 2016 Imagination Technologies LTD. and/or its Affiliated Group Companies. All rights reserved.
AUI ................................................................................................................................................................ 47 AUIPC ........................................................................................................................................................... 48 B .................................................................................................................................................................... 49 BAL................................................................................................................................................................ 50 BALC ............................................................................................................................................................. 52 BC ................................................................................................................................................................. 53 BC1EQZ BC1NEZ......................................................................................................................................... 54 BC1F ............................................................................................................................................................. 56 BC1FL ........................................................................................................................................................... 58 BC1T ............................................................................................................................................................. 60 BC1TL ........................................................................................................................................................... 62 BC2EQZ BC2NEZ......................................................................................................................................... 64 BC2F ............................................................................................................................................................. 66 BC2FL ........................................................................................................................................................... 67 BC2T ............................................................................................................................................................. 69 BC2TL ........................................................................................................................................................... 70 BEQ............................................................................................................................................................... 72 BEQL............................................................................................................................................................. 73 BGEZ............................................................................................................................................................. 75 BGEZAL ........................................................................................................................................................ 76 B{LE,GE,GT,LT,EQ,NE}ZALC ...................................................................................................................... 77 BGEZALL ...................................................................................................................................................... 80 BC ..................................................................................................................................................... 82 BGEZL........................................................................................................................................................... 86 BGTZ............................................................................................................................................................. 88 BGTZL........................................................................................................................................................... 89 BITSWAP ..................................................................................................................................................... 91 BLEZ ............................................................................................................................................................. 93 BLEZL ........................................................................................................................................................... 94 BLTZ.............................................................................................................................................................. 96 BLTZAL ......................................................................................................................................................... 97 BLTZALL ....................................................................................................................................................... 98 BLTZL.......................................................................................................................................................... 100 BNE ............................................................................................................................................................. 102 BNEL ........................................................................................................................................................... 103 BOVC BNVC ............................................................................................................................................... 105 BREAK ........................................................................................................................................................ 107 C.cond.fmt ................................................................................................................................................... 108 CACHE........................................................................................................................................................ 112 CACHEE ..................................................................................................................................................... 119 CEIL.L.fmt ................................................................................................................................................... 125 CEIL.W.fmt .................................................................................................................................................. 126 CFC1 ........................................................................................................................................................... 127 CFC2 ........................................................................................................................................................... 129 CLASS.fmt................................................................................................................................................... 130 CLO ............................................................................................................................................................. 132 CLZ.............................................................................................................................................................. 133 CMP.condn.fmt............................................................................................................................................ 134 COP2........................................................................................................................................................... 139 CTC1 ........................................................................................................................................................... 140 CTC2 ........................................................................................................................................................... 143 CVT.D.fmt.................................................................................................................................................... 144 CVT.L.fmt .................................................................................................................................................... 145 The MIPS32® Instruction Set Manual, Revision 6.05 4 Copyright © 2016 Imagination Technologies LTD. and/or its Affiliated Group Companies. All rights reserved.
CVT.PS.S .................................................................................................................................................... 146 CVT.S.PL .................................................................................................................................................... 148 CVT.S.PU.................................................................................................................................................... 149 CVT.S.fmt.................................................................................................................................................... 150 CVT.W.fmt................................................................................................................................................... 151 DDIV............................................................................................................................................................ 152 DDIVU ......................................................................................................................................................... 153 DERET ........................................................................................................................................................ 154 DI................................................................................................................................................................. 155 DIV .............................................................................................................................................................. 156 DIV MOD DIVU MODU ............................................................................................................................... 158 DIV.fmt ........................................................................................................................................................ 160 DIVU............................................................................................................................................................ 161 DVP ............................................................................................................................................................. 162 EHB ............................................................................................................................................................. 165 EI ................................................................................................................................................................. 166 ERET........................................................................................................................................................... 167 ERETNC...................................................................................................................................................... 169 EVP ............................................................................................................................................................. 171 EXT ............................................................................................................................................................. 173 FLOOR.L.fmt ............................................................................................................................................... 175 FLOOR.W.fmt.............................................................................................................................................. 176 INS .............................................................................................................................................................. 177 J................................................................................................................................................................... 179 JAL .............................................................................................................................................................. 180 JALR............................................................................................................................................................ 181 JALR.HB...................................................................................................................................................... 183 JALX............................................................................................................................................................ 187 JIALC........................................................................................................................................................... 189 JIC ............................................................................................................................................................... 191 JR ................................................................................................................................................................ 192 JR.HB .......................................................................................................................................................... 194 LB ................................................................................................................................................................ 197 LBE.............................................................................................................................................................. 198 LBU ............................................................................................................................................................. 199 LBUE ........................................................................................................................................................... 200 LDC1 ........................................................................................................................................................... 201 LDC2 ........................................................................................................................................................... 202 LDXC1......................................................................................................................................................... 204 LH................................................................................................................................................................ 205 LHE ............................................................................................................................................................. 206 LHU ............................................................................................................................................................. 207 LHUE........................................................................................................................................................... 208 LL ................................................................................................................................................................ 209 LLE .............................................................................................................................................................. 211 LLWP........................................................................................................................................................... 213 LLWPE ........................................................................................................................................................ 215 LSA ............................................................................................................................................................. 217 LUI............................................................................................................................................................... 218 LUXC1......................................................................................................................................................... 219 LW ............................................................................................................................................................... 220 LWC1 .......................................................................................................................................................... 221 LWC2 .......................................................................................................................................................... 222 5 The MIPS32® Instruction Set Manual, Revision 6.05 Copyright © 2016 Imagination Technologies LTD. and/or its Affiliated Group Companies. All rights reserved.
LWE............................................................................................................................................................. 224 LWL ............................................................................................................................................................. 225 LWLE........................................................................................................................................................... 227 LWPC .......................................................................................................................................................... 230 LWR ............................................................................................................................................................ 231 LWRE .......................................................................................................................................................... 234 LWXC1 ........................................................................................................................................................ 237 MADD.......................................................................................................................................................... 238 MADD.fmt.................................................................................................................................................... 239 MADDF.fmt MSUBF.fmt .............................................................................................................................. 242 MADDU ....................................................................................................................................................... 244 MAX.fmt MIN.fmt MAXA.fmt MINA.fmt........................................................................................................ 245 MFC0........................................................................................................................................................... 249 MFC1........................................................................................................................................................... 250 MFC2........................................................................................................................................................... 251 MFHC0 ........................................................................................................................................................ 252 MFHC1 ........................................................................................................................................................ 253 MFHC2 ........................................................................................................................................................ 254 MFHI............................................................................................................................................................ 255 MFLO .......................................................................................................................................................... 256 MOV.fmt ...................................................................................................................................................... 257 MOVF .......................................................................................................................................................... 258 MOVF.fmt .................................................................................................................................................... 259 MOVN.......................................................................................................................................................... 261 MOVN.fmt.................................................................................................................................................... 262 MOVT .......................................................................................................................................................... 263 MOVT.fmt .................................................................................................................................................... 264 MOVZ .......................................................................................................................................................... 266 MOVZ.fmt .................................................................................................................................................... 267 MSUB .......................................................................................................................................................... 268 MSUB.fmt .................................................................................................................................................... 269 MSUBU ....................................................................................................................................................... 271 MTC0........................................................................................................................................................... 272 MTC1........................................................................................................................................................... 274 MTC2........................................................................................................................................................... 275 MTHC0 ........................................................................................................................................................ 276 MTHC1 ........................................................................................................................................................ 277 MTHC2 ........................................................................................................................................................ 278 MTHI............................................................................................................................................................ 279 MTLO .......................................................................................................................................................... 280 MUL............................................................................................................................................................. 281 MUL MUH MULU MUHU ............................................................................................................................ 282 MUL.fmt....................................................................................................................................................... 284 MULT........................................................................................................................................................... 285 MULTU ........................................................................................................................................................ 286 NAL ............................................................................................................................................................. 287 NEG.fmt....................................................................................................................................................... 288 NMADD.fmt ................................................................................................................................................. 289 NMSUB.fmt ................................................................................................................................................. 291 NOP............................................................................................................................................................. 293 NOR ............................................................................................................................................................ 294 OR ............................................................................................................................................................... 295 ORI .............................................................................................................................................................. 296 The MIPS32® Instruction Set Manual, Revision 6.05 6 Copyright © 2016 Imagination Technologies LTD. and/or its Affiliated Group Companies. All rights reserved.
PAUSE ........................................................................................................................................................ 298 PLL.PS ........................................................................................................................................................ 300 PLU.PS........................................................................................................................................................ 301 PREF........................................................................................................................................................... 302 PREFE ........................................................................................................................................................ 306 PREFX ........................................................................................................................................................ 310 PUL.PS........................................................................................................................................................ 311 PUU.PS ....................................................................................................................................................... 312 RDHWR....................................................................................................................................................... 313 RDPGPR ..................................................................................................................................................... 316 RECIP.fmt ................................................................................................................................................... 317 RINT.fmt ...................................................................................................................................................... 318 ROTR .......................................................................................................................................................... 320 ROTRV........................................................................................................................................................ 321 ROUND.L.fmt .............................................................................................................................................. 322 ROUND.W.fmt............................................................................................................................................. 323 RSQRT.fmt.................................................................................................................................................. 324 SB................................................................................................................................................................ 325 SBE ............................................................................................................................................................. 326 SC ............................................................................................................................................................... 327 SCE ............................................................................................................................................................. 330 SCWP.......................................................................................................................................................... 333 SCWPE ....................................................................................................................................................... 335 SDBBP ........................................................................................................................................................ 338 SDC1........................................................................................................................................................... 339 SDC2........................................................................................................................................................... 340 SDXC1 ........................................................................................................................................................ 341 SEB ............................................................................................................................................................. 342 SEH ............................................................................................................................................................. 343 SEL.fmt........................................................................................................................................................ 344 SELEQZ SELNEZ ....................................................................................................................................... 346 SELEQZ.fmt SELNEQZ.fmt ........................................................................................................................ 348 SH ............................................................................................................................................................... 350 SHE ............................................................................................................................................................. 351 SIGRIE ........................................................................................................................................................ 353 SLL .............................................................................................................................................................. 354 SLLV............................................................................................................................................................ 355 SLT.............................................................................................................................................................. 356 SLTI............................................................................................................................................................. 357 SLTIU .......................................................................................................................................................... 358 SLTU ........................................................................................................................................................... 359 SQRT.fmt .................................................................................................................................................... 360 SRA ............................................................................................................................................................. 361 SRAV........................................................................................................................................................... 362 SRL ............................................................................................................................................................. 363 SRLV ........................................................................................................................................................... 364 SSNOP........................................................................................................................................................ 365 SUB ............................................................................................................................................................. 366 SUB.fmt ....................................................................................................................................................... 367 SUBU .......................................................................................................................................................... 368 SUXC1 ........................................................................................................................................................ 369 SW............................................................................................................................................................... 370 SWC1 .......................................................................................................................................................... 371 7 The MIPS32® Instruction Set Manual, Revision 6.05 Copyright © 2016 Imagination Technologies LTD. and/or its Affiliated Group Companies. All rights reserved.
SWC2 .......................................................................................................................................................... 372 SWE ............................................................................................................................................................ 373 SWL............................................................................................................................................................. 374 SWLE .......................................................................................................................................................... 377 SWR ............................................................................................................................................................ 379 SWRE.......................................................................................................................................................... 382 SWXC1........................................................................................................................................................ 384 SYNC .......................................................................................................................................................... 385 SYNCI ......................................................................................................................................................... 390 SYSCALL .................................................................................................................................................... 393 TEQ ............................................................................................................................................................. 394 TEQI ............................................................................................................................................................ 395 TGE ............................................................................................................................................................. 396 TGEI ............................................................................................................................................................ 397 TGEIU ......................................................................................................................................................... 398 TGEU .......................................................................................................................................................... 399 TLBINV........................................................................................................................................................ 400 TLBINVF...................................................................................................................................................... 403 TLBP ........................................................................................................................................................... 405 TLBR ........................................................................................................................................................... 406 TLBWI ......................................................................................................................................................... 408 TLBWR........................................................................................................................................................ 410 TLT .............................................................................................................................................................. 412 TLTI ............................................................................................................................................................. 413 TLTIU .......................................................................................................................................................... 414 TLTU ........................................................................................................................................................... 415 TNE ............................................................................................................................................................. 416 TNEI ............................................................................................................................................................ 417 TRUNC.L.fmt............................................................................................................................................... 418 TRUNC.W.fmt ............................................................................................................................................. 419 WAIT ........................................................................................................................................................... 420 WRPGPR .................................................................................................................................................... 422 WSBH.......................................................................................................................................................... 423 XOR............................................................................................................................................................. 424 XORI............................................................................................................................................................ 425 Appendix A: Instruction Bit Encodings............................................................................................ 426 A.1: Instruction Encodings and Instruction Classes ....................................................................................... 426 A.2: Instruction Bit Encoding Tables............................................................................................................... 426 A.3: Floating Point Unit Instruction Format Encodings ................................................................................... 437 A.4: Release 6 Instruction Encodings............................................................................................................. 439 Appendix B: Revision History ........................................................................................................... 444 The MIPS32® Instruction Set Manual, Revision 6.05 8 Copyright © 2016 Imagination Technologies LTD. and/or its Affiliated Group Companies. All rights reserved.
分享到:
收藏