I am aware of numerous web sites which document "part of" the instruction set, mostly for teaching purposes. They tend to leave out or only partially describe floating-point and privileged instructions.
In case you're wondering, I'm looking at Verilog code for a MIPS processor subset, and trying to figure out exactly to what extent it complies with the instruction sets of any real MIPS processors!
354k 49 49 gold badges 685 685 silver badges 934 934 bronze badges asked Sep 25, 2008 at 20:38 Dan Lenski Dan Lenski 79.2k 13 13 gold badges 81 81 silver badges 127 127 bronze badgessyscall transfers control to supervisor, but does not itself require privileges to execute, that of course being the point. I'm not sure MIPS IV (the manual I searched) had any instructions that always require privileges, or maybe that's because the MIPS IV manual I looked at says it only defines user-mode instructions. (But they may all be implemented as System Control Processor (same as coprocessor 0?) operations, not real CPU instructions. CoProc 0 access from user-mode depends on another bit setting, apparently, from a quick search on on "privilege".)
Commented Jan 6, 2021 at 23:21Okay, I found something!
MIPS offers a set of "MIPS 32 reference manuals" which refer to the latest, standardized instruction set (MIPS32v2): here
These include just about everything, except the information about which version the instructions originated in :-(
This class website at Cornell includes links to what appears to be the same manual, but is in fact an older version of it, and volume 2 of that older version does in fact include information about when the instructions where first introduced. Woohoo!
Why would MIPS remove this information from the revised documentation? There doesn't seem to be any explanation in the revision history.
answered Sep 25, 2008 at 21:34 Dan Lenski Dan Lenski 79.2k 13 13 gold badges 81 81 silver badges 127 127 bronze badges That's cool, but be aware that MIPS32R2 does not encompass all the variants that have gone before. Commented Sep 25, 2008 at 21:41 In hopes to sell you their latest CPU most likely. To make it harder to use older CPUs. Commented Sep 1, 2014 at 16:19I can only partially answer the question: I'd recommend See MIPS Run by Dominic Sweetman, if you're not already referring to it. I have the first edition of the book, the second edition is now current.
The first edition mentions the kernel. supervisor, and user privilege levels but does not discuss what operations are allowed in each. I do not know what changes were made in the second edition.
answered Sep 25, 2008 at 21:04 16.2k 8 8 gold badges 53 53 silver badges 66 66 bronze badgesThank you, Denton! This is the best MIPS book ever. unfortunately it's very in-demand from the university library :-( Hopefully I'll be able to make some photocopies when I can get it checked out.
Commented Sep 25, 2008 at 21:29Doesn't include instruction descriptions, but the source of the GNU assembler is probably as detailed as you can get regarding what instructions are available on what specific CPUs.
Get binutils and look at opcodes/mips-*.c
answered Sep 25, 2008 at 21:15 Mike F Mike FSweet, thanks a ton!! That is exactly what I need: sourceware.org/cgi-bin/cvsweb.cgi/src/opcodes/… Includes detailed info on which instructions are in which revisions of the ISA.
Commented Sep 25, 2008 at 22:05The current instruction-set reference manual is free online: MIPS® Architecture for Programmers Volume II-A: The MIPS32® Instruction Set Manual. That link is Revision 6.06 December 15, 2016. (i.e. it documents MIPS32 Release 6).
It documents all user and supervisor/kernel mode instructions, and all floating-point, in full detail including their machine-code encoding, and with an Operation section that shows what they do. It still documents all the instructions that were removed in MIPS32 release 6. (MIPS32 Release 6 also moved around a lot of opcodes, and this is well documented).
See https://www.mips.com/products/architectures/mips32/ for the latest version. mips.com has a section for "classic cores", but that still appears to only go back to MIPS32, not historical stuff.
Sample of the "availability and compatibility" section for balc (Branch and Link Compact: no branch-delay slot, and GRP31 is the implicit destination, freeing up 26 bits for an offset
This instruction is introduced by and required as of Release 6. Release 6 instruction BALC occupies the same encoding as pre-Release 6 instruction SWC2 . The SWC2 instruction has been moved to the COP2 major opcode in MIPS Release 6
Or for LDXC1 fd, index(base) (Load Doubleword Indexed to Floating Point)
This instruction has been removed in Release 6. Required in all versions of MIPS64 since MIPS64 Release 1. Not available in MIPS32 Release 1. Required in MIPS32 Release 2 and all subsequent versions of MIPS32. When required, required whenever FPU is present, whether a 32-bit or 64-bit FPU, whether in 32-bit or 64-bit FP Register Mode (FIRF64=0 or 1, StatusFR=0 or 1).
For historical stuff, I found the MIPS IV Instruction Set Revision 3.2 September, 1995 on a cmu.edu web page. It lists when instructions were introduced, e.g. MIPS I for div , MIPS III for dmult and other 64-bit instructions, MIPS II for ll / sc .
A good quick-reference with pseudocode for the effect of each instruction is https://inst.eecs.berkeley.edu/~cs61c/resources/MIPS_help.html. It doesn't include encoding details, but does accurately describe the effect of branch and jump instructions on the program counter. (Which is somewhat tricky: they're relative or section-absolute to the branch-delay slot.)
It's not complete even for MIPS I integer instructions, though: it's missing the unaligned-load helper instructions LWL and LWR and corresponding SWL/R stores which were present in MIPS I. It also doesn't include any FP stuff, or later MIPS instructions like mul (only mult ). I don't know what else might be missing; I didn't cross reference it against a complete list.
The MIPS-IV manual linked above confirms that lwl / lwr were available in MIPS I (and documents that the load delay slot restriction applies to them).