x ← y-˙z = max (0,y - z)
Here x,y,z are corresponding elements of the vectors $X, $Y, and $Z.
Timing:
1υ
Description:
Saturated Difference. An Octa byte is regarded as a vector of
eight byte, four Wyde, or two Tetra respectively.
BDIF | WDIF | TDIF | ODIF
For each (byte | wyde | tetra | octa) position j, the jth (byte | wyde | tetra | octa) register $X is set to (byte | wyde | tetra | octa) j of register $Y minus (byte | wyde | tetra | octa) j of the other
operand $Z or Z, unless that difference is negative; in the latter case, (byte | wyde | tetra | octa) j of $X is set to zero.
The BDIF and WDIF commands are useful in applications to graphics or video; TDIF and ODIF are also
present for reasons of consistency. For example, if a and b are registers containing 8-byte quantities, their
bytewise maxima c and bytewise minima d are computed by
To add individual bytes of a and b while clipping all sums to 255 if they don't fit in a single byte, one can
say
NOR acomp,a,0; BDIF x,acomp,b; NOR clippedsums,x,0;
in other words, complement a, apply BDIF, and complement the result. The operations can also be used to
construct efficient operations on strings of bytes or wydes.
Please help to keep this site up to date!
If you want to point out important material or projects
that are not listed here, if you find errors or want to suggest improvements,
please send email to