mfocrf
Move From One Condition Register Field
Moves a single CR field to a GPR.
Details
The mfocrf instruction moves the contents of a single field from the Condition Register (CR) to a general-purpose register (RT). If exactly one bit in the FXM field is set, it copies the corresponding CR field into RT, setting other bits of RT to zero. Otherwise, the contents of RT are undefined.
Pseudocode Operation
count ←0
RT ←undefined
do i = 0 to 7
if FXMi = 1 then
n ←i
count ←count + 1
if count = 1 then
RT ←640
RT4×n+32:4×n+35 ←CR4×n+32:4×n+35
Programming Note
The mfocrf instruction is used to extract a specific condition register field into a general-purpose register. Ensure that exactly one bit in the FXM field is set to avoid undefined behavior. This instruction operates at user privilege level and does not generate exceptions under normal conditions.
Example
Encoding
Operands
-
RT
Target -
FXM
Mask