68
Vector Unit Instructions
The VU adds are short (16 bit) add operations; they clear
VCO
and clamp to
16 bit signed values.
vadd
uses
VCO
as carry in,
vsub
uses
VCO
as borrow in,
and
vabs
ignores
VCO
:
vadd
:
VD = VS + VT
vsub
:
VD = VS - VT.
vabs
: conditional negation of
vt
by the sign of
vs
. Also performs
sign()
.
if (VS < 0)
VD = -VT;
else if (VS == 0)
VD = VS;
else
VD = VT;
Add operations for double precision, no clamping:
vaddc
:
VD = VS + VT
, set
VCO
with carry out and not
equal.
vsubc
:
VD = VS - VT
, set
VCO
with borrow out and not
equal.
vsar
: read the accumulator and write to
vd
, and write the accumulator with
the contents of
vs
.
vt
is ignored. The high, middle, or low 16 bits of the
accumulator are selected by the e
lement
(corresponding to element values of
0, 1, and 2, respectively). No clamping is performed.
vsar
is useful for
diagnostics and extended precision.
Vector Add Examples
The following code fragments illustrate various adds. In this section, the
following notation is used:
1 1 0 1
vsar
1 1 1 0
reserved
1 1 1 1
reserved
Type
Instruction
Summary of Contents for Ultra64
Page 2: ...2 ...
Page 10: ...10 ...
Page 12: ...12 Figure 6 2 buildtask Operation 137 ...
Page 14: ...14 ...
Page 80: ...80 Vector Unit Instructions vmadm dres_int dres_int vconst 3 vmadn dres_frac vconst vconst 0 ...
Page 104: ...104 RSP Coprocessor 0 ...
Page 150: ...150 Advanced Information ...
Page 155: ...Revision 1 0 155 ...
Page 248: ...248 Exceptions None ...
Page 251: ...Revision 1 0 251 Exceptions None ...
Page 254: ...254 Exceptions None ...
Page 257: ...Revision 1 0 257 Exceptions None ...
Page 293: ...Revision 1 0 293 Exceptions None ...
Page 316: ...316 Exceptions None ...