mtfsfi

Move To FPSCR Field Immediate

mtfsfi BF, U

Writes a 4-bit immediate to a specific FPSCR field.

Details

Writes a 4-bit immediate value U into a 4-bit field of the FPSCR selected by BF. The target FPSCR field is at bits [4×BF : 4×BF+3]. This instruction directly modifies FPSCR state and may affect subsequent floating-point operations.

Pseudocode Operation

FPSCR[4*BF : 4*BF+3] ← U

Programming Note

Use mtfsfi to directly manipulate specific fields in the FPSCR, such as enabling or disabling exceptions. Ensure the immediate value fits within the specified field size to avoid undefined behavior. This instruction operates at user privilege level and does not generate exceptions for valid immediate values.

Example

mtfsfi cr0, 0

Encoding

Binary Layout
63
0
BF
6
/
11
U
16
134
21
/
31
 
Format X-form
Opcode 0xFC00010C
Extension Floating-Point
Registers Altered FPSCR

Operands

  • BF
    Field Index
  • U
    Immediate