IDT MIPS32 4Kc Processor Core
Instruction Set
79RC32438 User Reference Manual
2 - 86
November 4, 2002
Notes
Jump and Branch Instructions
Jump and branch instructions change the control flow of a program. All jump and branch instructions
occur with a delay of one instruction: that is, the instruction immediately following the jump or branch (this is
known as the instruction in the delay slot) always executes while the target instruction is being fetched from
storage.
Overview of Jump Instructions
Subroutine calls in high-level languages are usually implemented with Jump or Jump and Link instruc-
tions, both of which are J-type instructions. In J-type format, the 26-bit target address shifts left 2 bits and
combines with the high-order 4 bits of the current program counter to form an absolute address. Returns,
dispatches, and large cross-page jumps are usually implemented with the Jump Register or Jump and Link
Register instructions. Both are R-type instructions that take the 32-bit byte address contained in one of the
general purpose registers. For more information about jump instructions, see the Instruction Set section
earlier in this chapter.
Overview of Branch Instructions
All branch instruction target addresses are computed by adding the address of the instruction in the
delay slot to the 16-bit offset (shifted left 2 bits and sign-extended to 32 bits). All branches occur with a
delay of one instruction. If a conditional branch likely is not taken, the instruction in the delay slot is nullified.
Branches, jumps, ERET, and DERET instructions should not be placed in the delay slot of a branch or jump.
Control Instructions
Control instructions allow the software to initiate traps; they are always R-type.
Coprocessor Instructions
CP0 instructions perform operations on the System Control Coprocessor registers to manipulate the
memory management and exception handling facilities of the processor. For a listing of CP0 instructions,
refer to Appendix A, 4Kc Processor Core Instructions, in this manual.
Enhancements to the MIPS Architecture
The core execution unit implements the MIPS32 architecture, which includes the following instructions:
–
CLO – Count Leading Ones
–
CLZ – Count Leading Zeros
–
MADD – Multiply and Add Word
–
MADDU – Multiply and Add Unsigned Word
–
MSUB – Multiply and Subtract Word
–
MSUBU – Multiply and Subtract Unsigned Word
–
MUL – Multiply Word to Register
–
SSNOP – Superscalar Inhibit NOP.
CLO - Count Leading Ones
The CLO instruction counts the number of leading ones in a word. The 32-bit word in the GPR rs is
scanned from most-significant to least-significant bit. The number of leading ones is counted and the result
is written to the GPR rd. If all 32 bits are set in the GPR rs, the result written to the GPR rd is 32.
CLZ - Count Leading Zeros
The CLZ instruction counts the number of leading zeros in a word. The 32-bit word in the GPR rs is
scanned from most-significant to least-significant bit. The number of leading zeros is counted and the result
is written to the GPR rd. If all 32 bits are cleared in the GPR rs, the result written to the GPR rd is 32.