Xref: utzoo comp.arch:10494 comp.lang.misc:3037 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!purdue!mentor.cc.purdue.edu!l.cc.purdue.edu!cik From: cik@l.cc.purdue.edu (Herman Rubin) Newsgroups: comp.arch,comp.lang.misc Subject: Re: Double Width Integer Multiplication and Division Summary: Double precision depends, as does everything else, on the hardware Message-ID: <1387@l.cc.purdue.edu> Date: 5 Jul 89 15:38:58 GMT References: <57125@linus.UUCP> <1989Jun24.230056.27774@utzoo.uucp> <255@obs.unige.ch> Followup-To: comp.arch,comp.lang.misc Organization: Purdue University Statistics Department Lines: 51 In article <255@obs.unige.ch>, bartho@obs.unige.ch (PAUL BARTHOLDI) writes: > In article <1989Jun26.195044.4197@cs.rochester.edu>, crowl@cs.rochester.edu (Lawrence Crowl) writes: > >>When we were [designing integer division support on the MIPS processors], we > >>couldn't think of any languages whose natural implementation on a 32-bit > >>machine would expect generation of a 64 by 32 bit divide as the expected > >>operation. Does anybody know of any such, or is this strictly something one > >>would use in handcoded routines? > > > > Languages which support fixed-point arithmetic, e.g. PL/I and Ada, could use > > such a feature to substantially improve fixed-point performance ... [There follows a discussion of how this happens in FORTH] The language designers did not put something in the language, therefore the hardware people do not put it on the machine, therefore the new language designers do not put it in the language, and the recursion continues. Despite the claims of the Algolniks, there has been no language which comes close to treating what I consider the hardware-natural operations which I would find useful. Many of them were present 35 years ago on a larger proportion of machines than now. What languages, other than Lisp and some similar ones, have the idea that an operation or function can return a string of values? What languages allow the user to introduce addition operator symbols? A few allow additional types. Now these deficiencies in languages go back to day 1. What is double precision? We first need to know what single precision is. And (no surprise) it is different on different machines, and can even be different for addition and multiplication on the same machine. On the CRAY, for integer addition one can use 64-bit 2's complement numbers. But for multiplication, only 48-bit sign-magnitude mantissas. However, the best integer multiplication possible is 24x24->48. And all division has to be programmed. The CYBER 205 has only 48-bit 2's complement numbers for arithmetic. There are even problems in integer addition. But a double length product can be produced with two multiplies, with minor problems. Floating point division is present, but fixed point must be programmed. Interesting things can be done with vectors, and a programmed 32x32->64 inner product might be a good idea. Now if you define single precision as 16 bits, a 32-bit machine is automatically double-precision. If you define it as 256 bits, you would need 256x256->512 and 512/256 giving a 256-bit quotient and remainder to have double precision. For those needing good integer arithmetic, the bigger the better. And a few machine operations make a big difference. -- Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907 Phone: (317)494-6054 hrubin@l.cc.purdue.edu (Internet, bitnet, UUCP)