UMIN : Unsigned MINimum

Short form : The unsigned value of the destination register (src1) is compared with the unsigned value of the source register (src2). If src2<src1, then the value of src2 is written to src1. Otherwise, src1 is written with its original value.

Long form : The immediate field (sign-extended Imm16) is treated as a 32-bit unsigned value. It is compared with the unsigned value of the source register (src2). If src2>Imm16, then the value of Imm16 is written to src1. Otherwise, the value of src2 is written to scr1.

The Unsigned MAXimum instruction is identical but with a reversed condition.

The Signed MINimum instruction is identical but with a signed comparison.

The SMAX, SMIN, UMAX and UMIN instructions are useful when clipping coordinates or samples, or as an alternative to the CLR, CO, CNO, CZ, CNZ, CS and CNS instructions.

; Signed version :
 SMAX R1 R2       ; If R1>R2    then R1->R2
 SMAX R1 1234h R2 ; If R1>1234h then R1->R2 else 1234h->R2
 SMIN R1 R2       ; If R1<R2    then R1->R2
 SMIN R1 1234h R2 ; If R1<1234h then R1->R2 else 1234h->R2
; Unsigned version :
 UMAX R1 R2       ; If R1>R2    then R1->R2
 UMAX R1 1234h R2 ; If R1>1234h then R1->R2 else 1234h->R2
 UMIN R1 R2       ; If R1<R2    then R1->R2
 UMIN R1 1234h R2 ; If R1<1234h then R1->R2 else 1234h->R2