Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!wuarchive!julius.cs.uiuc.edu!apple!snorkelwacker!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!tcdcs!swift.cs.tcd.ie!vax1.tcd.ie!rwallace From: rwallace@vax1.tcd.ie Newsgroups: comp.arch Subject: Re: F.P. vs. arbitrary-precision Message-ID: <6837.26e7ee92@vax1.tcd.ie> Date: 7 Sep 90 19:01:37 GMT References: <3755@osc.COM> <4513@taux01.nsc.com> <119244@linus.mitre.org> Organization: Computer Laboratory, Trinity College Dublin Lines: 32 > :If they have a good FPU, using it for integer multiplication *is* a "reasonable > :way". Besides, a bad implementation doesn't prove anything about the basic > :idea of FP. > > Having a good FPU just isn't good enough. Even with IEEE 64-bit, there are > only 53 bits of a mantissa. So just how does one multiply two 32 bit integers > together using floating point? The answer is: one can't without losing bits. > (or by doing several multiplies on the low/high halves and combining things) > Futhermore, if I should need to multiply integers in this way, they must > first be converted to floating point, then the product must be converted back. > Can you say expensive??? > > The four basic operations of arithmetic are +, -, x, /. Any computer that > can't perform them on its atomic data units [whatever the word size is] > is a joke. First, why do you need 32 x 32 -> 64? OK in principle 32 x 32 can give a 64 bit answer but in practice 99% of the time you're going to be working in 32 bits all the way and you don't want 64 bit answers (which is why C has int x int -> int not int x int -> long). Second, there is a huge amount of processing done which depends on integer + and - and fp +, -, * and / being fast, so there is hardware support for these. There is practically no processing done which depends on integer * and / being fast (accessing an array of structures doesn't count because a smart compiler can use shifts and adds), and don't bother giving anecdotal cases because it's still less than 1% of the total. Therefore chip space was not wasted on making these fast. -- "To summarize the summary of the summary: people are a problem" Russell Wallace, Trinity College, Dublin rwallace@vax1.tcd.ie