![](http://datasheet.mmic.net.cn/380000/-PD98501_datasheet_16745028/-PD98501_557.png)
APPENDIX A MIPS III INSTRUCTION SET DETAILS
Preliminary User’s Manual S14767EJ1V0UM00
557
MACC
Multiply and Accumulate (2/5)
MACC
When saturation processing is not executed (sat = 0): MACC, MACCU, MACCHI, MACCHIU instructions
The contents of general register rsis multiplied to the contents of general register rt If both operands are set
as "us = 1" (MACCU, MACCHIU instructions), the contents are handled as 32 bit unsigned data. If they are set
as "us = 0" (MACC, MACCHI instructions), the contents are handled as 32 bit signed integers. Sign/zero
expansion by software is required for any bits exceeding 32 bits in the operands. The product of this multiply
operation is added to a 64-bit value that is linked to the HI and LO special registers. If us = 1, this add
operation handles the values being added as 64 bit unsigned data. If us = 0, the values are handled as 64 bit
signed integers.
The low-order word from the 64-bit sum from this add operation is loaded to the LO special register and the
high-order word is loaded to the HI special register. When hi = 1 (MACCHI, MACCHIU instructions), data that
is the same as the data loaded to the HI special register is also loaded to the rd general register. When hi = 0
(MACC, MACCU instructions), data that is the same as the data loaded to the LO special register is also
loaded to the rd general register. Overflow exceptions do not occur.
The correspondence of us and sat settings and values stored during saturation processing is shown below, along
with the hazard cycles required between execution of the instruction for manipulating the HI and LO registers and
execution of the MACC instruction.
Values Stored during Saturation Processing
Hazard Cycle Counts
us
sat
Overflow
Underflow
Instruction
Cycle Count
0
0
Store calculation result as is
Store calculation result as is
1
0
Store calculation result as is
Store calculation result as is
0
1
0x0000 0000 7FFF FFFF
0xFFFF FFFF 8000 0000
1
1
0xFFFF FFFF FFFF FFFF
None
MULT,
DMULT, DMULTU
DIV,
DDIV,
MFHI,
MTHI,
MACC
DMACC
MULTU
DIVU
DDIVU
MFLO
MTLO
1
3
36
68
2
0
0
0