Revision 1.0
VU Select Instructions
73
Note:
For single precision
vch
not followed by a
vcl
,
VCO
must be set
before another compare (by a move, add, or compare whose results are
not meaningful).
The
vcr
instruction is similar to
vcl
, except that
vt
is a 1’s complement
instead of 2’s complement number, such as for clamping to a power of 2.
vcr
is only single precision and ignores the contents of
VCO
for input.
Vector Select Examples
The following code fragments illustrate various vector selects.
This code demonstrates a sort of the parallel elements within three vectors
(finding the
min
,
mid
, and
max
of 8 triples). After executing this code,
min
will contain the smallest elements,
max
will contain the largest, and
mid
will
contain the intermediate elements:
vge tmp1, min, mid
vlt min, min, mid
vge tmp2, min, max
vlt min, min, max
vge max, tmp1, tmp2
vlt mid, tmp1, tmp2
This code demonstrates the generation of 3D clip codes for trivial rejection,
testing each
x,y,z
component against
w
. It also uses vector halves,
clip-testing two vertices at the same time (the first vertex is in elements 0-3,
the second in elements 4-7):
vch vtmp, vout_int, vout_int[3h] # compare with w
vcl vtmp, vout_frac, vout_frac[3h]
cfc2 $1, $vcc # get clip codes
Other combinations are left as an exercise to the reader.
Содержание Ultra64
Страница 2: ...2 ...
Страница 10: ...10 ...
Страница 12: ...12 Figure 6 2 buildtask Operation 137 ...
Страница 14: ...14 ...
Страница 80: ...80 Vector Unit Instructions vmadm dres_int dres_int vconst 3 vmadn dres_frac vconst vconst 0 ...
Страница 104: ...104 RSP Coprocessor 0 ...
Страница 150: ...150 Advanced Information ...
Страница 155: ...Revision 1 0 155 ...
Страница 248: ...248 Exceptions None ...
Страница 251: ...Revision 1 0 251 Exceptions None ...
Страница 254: ...254 Exceptions None ...
Страница 257: ...Revision 1 0 257 Exceptions None ...
Страница 293: ...Revision 1 0 293 Exceptions None ...
Страница 316: ...316 Exceptions None ...