Revision 1.0
VU Divide Instructions
79
•
_frac
is a named vector register holding an unsigned 16 bit
fraction.
•
dev_null
is a named vector register containing all zeros.
A single precision reciprocal:
vrcp sres_frac[0], s_int[0]
vrcph sres_int[0], dev_null[0]
A double precision reciprocal:
vrcph sres_int[0], s_int[0]
vrcpl sres_frac[0], s_frac[0]
vrcph sres_int[0], dev_null[0]
Multiple calculations can be chained together:
vrcph sres_int[0], s_int[0]
vrcpl sres_frac[0], s_frac[0]
vrcph sres_int[0], t_int[0]
vrcpl tres_frac[0], t_frac[0]
vrcph tres_int[0], dev_null[0]
In the above cases, the input format was S15.16, so after the reciprocal the
radix point moves to the right, so we must shift by 1 (multiply by 2.0) in
order to correct the result:
vmudn sres_frac, sres_frac, vconst[2] # constant of 2
vmadm sres_int, sres_int, vconst[2]
vmadn sres_frac, dev_null, dev_null[0]
Square root reciprocals are similar. Note the adjustment of the radix point
after the reciprocal calculation:
# double precision:
vrsqh
dres_int[0], t_int[0]
vrsql
dres_frac[0], t_frac[0]
vrsqh
dres_int[0], vconst[0]
# generate constant to shift radix point:
addi
$1, $0, 0x200
mtc2
$1, vconst[6]
# shift right by 8 bits.
vmudl
dres_frac, dres_frac, vconst[3]
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 ...