Path: utzoo!attcan!uunet!cs.utexas.edu!rice!sun-spots-request From: dupuy@cs.columbia.edu Newsgroups: comp.sys.sun Subject: Re: Integer math on SPARCs Keywords: Miscellaneous Message-ID: <8149@brazos.Rice.edu> Date: 24 May 90 20:12:57 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 14 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n178 X-Sun-Spots-Digest: Volume 9, Issue 182, message 5 There is no multiply instruction on a SPARC - it's a RISC architecture. Instead of providing multiply in hardware, which would take up chip area that could better be used for registers or other things that "make it go fast", a multiply step (MULScc) operation is provided, and .mul is a routine with a lot of mulscc instructions and a little logic at the beginning and end to deal with overflow, etc. Since it's a RISC machine, mulscc's execute fast, and there's an overall performance win. You could inline .mul, but the call overhead is minimal (two jumps) since it doesn't save or restore any registers. See Appendix E of the SPARC Architecture Manual, pp. 165-181 for multiplication and division routines. @alex