dcmpu
Decimal Compare Unordered
Compares two DFP operands and sets the CR field to indicate the result.
Details
Compares two decimal floating-point numbers and updates the specified condition register field. The comparison treats quiet NaNs as unordered (unlike ordered compare). The result sets the Less Than, Greater Than, Equal, or Unordered bits in the target CR field. No other status flags are affected.
Pseudocode Operation
if FRA is NaN or FRB is NaN then
CR[BF] ← 0b0001 (Unordered)
else if FRA < FRB then
CR[BF] ← 0b1000 (Less Than)
else if FRA > FRB then
CR[BF] ← 0b0100 (Greater Than)
else
CR[BF] ← 0b0010 (Equal)
Programming Note
The dcmpu instruction is used to compare two decimal floating-point numbers. It sets the condition register field BF based on the comparison result, which can be less than (FL), greater than (FG), equal to (FE), or unordered (FU) if either operand is NaN. Ensure that both operands are properly aligned and valid DFP values to avoid undefined behavior.
Example
Encoding
Operands
-
BF
CR Field -
FRA
Src A -
FRB
Src B