SPA 5.0:
{@{!}Pg}
IMNMX{.signedAB}{.xmode}
Rd{.CC},Ra,Sb,{!}SPa
{&req_6}
{?sched}
;
.signedAB {.U32, .S32*}
Specifies whether Ra and Sb are signed or unsigned for
the comparison
.xmode {.XLO,.XMED,.XHI}
Extended precision modes to allow comparison of >32bit
values.
.CC: Write condition codes
IMNMX allows the following source Sb:
Sb(register)
Sb(constant with immediate address)
Sb(#IMM20)
Miminum or maximum of sources into destination. Minimum chosen if source predicate is TRUE, maximum chosen if source predicate is FALSE. Source predicate has optional complement. Supports unsigned/signed minimum and maximum.
.XLO,.XMED,.XHI are for extended-precision support. In extended-precision mode, values are processed one word at a time, starting with the most-significant word. As soon as the overall ordering is determined, the remaining IMNMX instructions simply select the correct input based on the ordering. .XHI is used to process the high-order word, .XLO is used to process the low-order word, and .XMED is used to process any words in the middle (e.g., for 128-bit values). For signed minimum and maximum, only the high-order word should be processed as signed number. The lower-order words should be processed as unsigned number for correctness of the operation.
In extended-precision mode, the Zero Flag and Sign Flag have their usual meaning. The Zero Flag is accumulated across all words of the extended-precision result. The Sign Flag is set based on the result of the first IMNMX instruction in a sequence, so that it correctly represents the sign of the extended-precision result. The Carry Flag is used to indicate whether the overall order has been determined. The Overflow Flag is used to indicate this order once it has been determined, so that subsequent IMNMX instructions can select the appropriate source operand to copy to the destination. The final IMNMX instruction clears CF and OF, so the Condition Code represents the correct flags for the extended-precision result.
IMNMX R0,R1,R2,PT; // MIN IMNMX R0,R1,R2,!PT; // MAX