Encoding:

COP1

010001

MTH

00111

rt

fs

0

000 0000 0000

6

5

5

5

11

Format:

MTHC1 rt, fs

MIPS32 Release 2

Move Word to High Half of Floating Point Register

Purpose:

Move Word to High Half of Floating Point Register

To copy a word from a GPR to the high half of an FPU (CP1) general register.

Description:

 FPR[fs]63..32 = GPR[rt]31..0

The low word in GPR rt is placed into the high word of FPR fs. This instruction is primarily intended to support 64bit floating point units on a 32-bit CPU, but the semantics of the instruction are defined for all cases.

Restrictions:

In implementations prior to Release 2 of the architecture, this instruction resulted in a Reserved Instruction exception.

The results are UNPREDICTABLE if StatusFR = 0 and fs is odd.

Operation:

newdata = GPR[rt]31..0
      olddata = ValueFPR(fs, UNINTERPRETED_DOUBLEWORD)31..0
StoreFPR(fs, UNINTERPRETED_DOUBLEWORD, newdata || olddata)

Exceptions:

Coprocessor Unusable, Reserved Instruction

Programming Notes

When paired with MTC1 to write a value to a 64-bit FPR, the MTC1 must be executed first, followed by the MTHC1.

This is because of the semantic definition of MTC1, which is not aware that software is using an MTHC1 instruction to complete the operation, and sets the upper half of the 64-bit FPR to an UNPREDICTABLE value.