>>>> "William" == William
Donzelli <aw288(a)osfn.org> writes:
> Then there are special cases: the Cray and Alpha
integer units,
> which don't offer divide at all. Instead, you're supposed to
> multiply by the reciprocal of the divisor. This works well,
> because you can actually do that faster than the straightforward
> one bit at a time division even if you have to calculate the
> reciprocal at runtime.
William> Do you know how this is done (at least the fancy ways of
William> doing it)? I assume there are shortcuts, as the Cray 1/x
William> pipes were not hugely long compared with the other pipes
William> (there has to be some magic somewhere).
Only in outline. The instruction is called "reciprocal approximation"
-- I believe it's a Newton's method iterative method for finding the
reciprocal of a given number. Apparently Newton's method converges
faster (when you throw the right number of gates at the inner loop)
than a divide would for the Cray's 64 bit word length.
paul