Minimum and Maximum Functions

The FPU module supports all minimum and maximum operations defined in the IEEE 754-2019 standard. The IEEE 754-2008 minNum(x,y) and maxNum(x,y) operations are not directly supported.

  • FMINNUM, FMAXNUM: IEEE 754-2019 minimumNumber(x,y)/maximumNumber(x,y) functions. When one of the input operands is a NaN and the other input is a floating-point number (that is not a NaN), the instructions will return the floating-point number. If both input operands are a NaN, the instructions will return a qNaN.
  • FMIN, FMAX: IEEE 754-2019 minimum(x,y)/maximum(x,y) functions. When one (or both) of the input operands is a NaN, the instructions will return a qNaN.

Refer to the truth table shown in Table 6-36 for a definition of how NaN operands are handled.

For all minimum and maximum operations, any finite operand value will compare as less than +infinity, or greater than -infinity. Operand value of -0 compares to less than +0.

Table 6-36. FMINNUM/FMAXNUM/FMIN/FMAX Operation
OpSource OperandsInvalid Exception MaskResult FdFSR.INVALInvalid Exception Taken?
FbFs
FMINNUM FMAXNUM FMIN FMAXFPN1FPN2Don’t careFPN1 or FPN2(1,2,3,4)0No
qNaN1qNaN2Don’t careqNaN1 or qNaN2 (5)0No
sNaNqNaN1qNaN (Fs) (6)1No
0Yes
qNaNsNaN1qNaN (Fb) (6)1No
0Yes
sNaN1sNaN21Quieted sNaN1 or sNaN2 (5)1No
0Yes
FMINNUM FMAXNUMFPN1qNaNDon’t careFPN10No
qNaNFPN2Don’t careFPN20No
FPN1sNaN1FPN11No
0Yes
sNaNFPN21FPN21No
0Yes
FMIN FMAXFPN1qNaNDon’t careqNaN (Fs)0No
qNaNFPN2Don’t careqNaN (Fb)0No
FPN1sNaN1Quieted sNaN (Fs)1No
0Yes
sNaNFPN21Quieted sNaN (Fb)1No
0Yes
Note:
  1. FPN1 and FPN2 are floating-point numbers that are not a NaN (i.e., normal, zero, infinity or sub-normal).
  2. Result determined by FMINNUM/FMIN or FMAXNUM/FMAX operation.
  3. Operand value of -0 compares to less than +0.
  4. If Fb = Fs (and of the same sign, including infinities), result (Fd) will be loaded with Fb.
  5. NaN with largest significand will be passed to result (Fd), quieted if an sNaN.
  6. qNaN values have priority over sNaN values (see Table 6-38).