Integer Multiply/Divide on Sparc
Robert D. Silverman
bs at linus.UUCP
Sat Dec 23 06:14:47 AEST 1989
Does any have, of know of software for the SPARC [SUN-4] that will
perform the following:
(1) Multiply two unsigned 32-bit integers, yielding a 64 bit product
stored in two registers?
(2) Take a 64 bit product and divide it by a 32 bit (unsigned) integer
yielding a 32-bit quotient and remainder?
or (3) Compute A*B Mod C directly?
The SPARC is brain dead [as were its designers] when it comes to doing
integer arithmetic. It can't multiply and it can't divide.
Trying to convert to floating point, do the arithmetic, then convert
back is far too slow. (I've already tried).
--
Bob Silverman
#include <std.disclaimer>
Internet: bs at linus.mitre.org; UUCP: {decvax,philabs}!linus!bs
Mitre Corporation, Bedford, MA 01730
More information about the Comp.lang.c
mailing list