Encoding:

P32A

001000

x

rs

ac

10

000

001

111

111

6

5

5

2

2

3

3

3

3

Format:

MTHI rs, ac

DSP

Move to HI register

Purpose:

Move to HI register

To copy a GPR to the special purpose HI part of the specified accumulator register.

Description:

HI[ac] = GPR[rs]

The source register rs is copied to the HI part of accumulator ac. The HI part of the accumulator is defined to be bits

32 to 63 of the DSP Module accumulator register.

The value of ac can range from 0 to 3. When ac=0, this refers to the original HI/LO register pair of the MIPS32 architecture.

In Release 6 of the MIPS Architecture, accumulators are eliminated from MIPS32.

Restrictions:

A computed result written to the HI/LO pair by DIV, DIVU, DDIV, DDIVU, DMULT, DMULTU, MULT, or MULTU must be read by MF HI or MFLO before a new result can be written into either HI or LO. Note that this restriction only applies to the original HI/LO accumulator pair, and does not apply to the new accumulators, ac1, ac2, and ac3.

If an MTHI instruction is executed following one of these arithmetic instructions, but before an M FLO or MFHI instruction, the contents of LO are UNPREDICTABLE. The following example shows this illegal situation:

MULT r2,r4 # start operation that will eventually write to HI,LO
...        # code not containing mfhi or mflo
MTHI r6
...        # code not containing mflo
MFLO r3    # this mflo would get an UNPREDICTABLE value

Operation:

if (( ac != 0 ) or (ConfigAR >= )) then 
   ValidateAccessToDSPResources()
endif
HI[ac]31..0 = GPR[rs]31..0

Exceptions:

Reserved Instruction, DSP Disabled