SPA 5.0:
{@{!}Pg}
VMNMX{.dfmt}{.safmt.sbfmt}{.mn}{.SAT}{.op2}
Rd{.CC}, Ra{.partselA}, Rb{.partselB}, Rc
{&req_6}
{?sched}
;
.dfmt: { .UD, .SD* } Destination format (unsigned or signed) .safmt: { .U32, .S32*, .U16, .S16, .U8, .S8} .sbfmt: { .U32, .S32*, .U16, .S16, .U8, .S8} .ifmt: { .U16, .S16* } Source formats .mn: { .MN*, .MX} Select between minimum (.MN) or maximum (.MX) .SAT: Saturate destination based on .op2 and final sign .op2: { .PASS*, .MRG_16H, .MRG_16L, .MRG_8B0, .MRG_8B2, .ACC, .MIN, .MAX} .partselA: if (.U8|.S8) { .B0*, .B1, .B2, .B3} if (.U16|.S16) { .H0*, .H1} .partselB: if (.U8|.S8) { .B0*, .B1, .B2, .B3} if (.U16|.S16) { .H0*, .H1}
{@{!}Pg}
VMNMX{.dfmt}{.safmt.ifmt}{.mn}{.SAT}{.op2}
Rd{.CC}, Ra{.partselA}, #imm16, Rc
{&req_6}
{?sched}
;
Miminum or maximum of sources into destination with optional second stage operation and optional saturate.
Both inputs are are first promoted to S33 (based on their individual .S or .U format), then the minumum/maximum is done, producing a S33 result. The intermediate result is promoted to S34 for subsequent processing.
VMNMX.MN R0, R1, R2, RZ; # MIN VMNMX.UD.U16.U16.MX R0, R1, R2, RZ; # MAX VMNMX.U32.U16.MN.ACC R0, R1, 5, R3; # R0 = min(R1, 5) + R3