fcmpu
Floating Compare Unordered
Compares two floating-point registers and sets the Condition Register (CR) field. Does not trap on NaNs.
Details
The fcmpu instruction compares the contents of two floating-point registers, FRA and FRB. It sets one bit in the designated CR field to 1 and the other three to 0, and updates the FPCC accordingly. The comparison is unordered, meaning it does not consider the sign of zero.
Pseudocode Operation
Programming Note
The fcmpu instruction is commonly used for unordered floating-point comparisons, which are useful in scenarios where NaN values need to be handled gracefully. Be cautious with signaling NaNs (SNaNs), as they can trigger exceptions and set the VXSNAN flag. Ensure that the FPSCR and CR registers are properly managed to handle comparison results and exceptions correctly.
Example
Encoding
Operands
-
BF
CR Field -
FRA
Source A -
FRB
Source B -
CRb
Condition Register Field -
FRa
Floating-Point Register Source -
FRc
Floating-Point Register Source