Xref: utzoo comp.arch:14426 comp.lang.lisp:2870 comp.lang.misc:4344 comp.lang.smalltalk:1738 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!cdr.utah.edu!moore From: moore%cdr.utah.edu@cs.utah.edu (Tim Moore) Newsgroups: comp.arch,comp.lang.lisp,comp.lang.misc,comp.lang.smalltalk Subject: Re: CORRECTION to: heaps of numbers (tagged immediate floats) Keywords: floating point, garbage collection, tags, IEEE floats, whoops Message-ID: <1990Mar5.221226.4841@hellgate.utah.edu> Date: 6 Mar 90 05:12:25 GMT References: <1990Mar5.220724.3718@Neon.Stanford.EDU> <14261@lambda.UUCP> <1990Mar6.015230.20068@Neon.Stanford.EDU> Organization: University of Utah CS Dept Lines: 37 In article <1990Mar6.015230.20068@Neon.Stanford.EDU> wilson@carcoar.Stanford.EDU (Paul Wilson) writes: >So it looks like each marginal bit would be more important than I thought, >favoring stealing _very_few_ bits from the exponent. 2**(2**4) would >only give you a range of 1/32K to 32K. But 2**(2**5) would give you >a range from 1/2nano- to 2giga- which seems pretty reasonable. And 2**(2**6) >goes from pretty seriously small to pretty seriously big (by my standards). > >I interpret this to mean that I can steal 2 bits from the 8-bit exponent, >leaving 6, or maybe 3, leaving 5. > >It would be awkward to use less than two bits for primary tags, given that >you probably want separate tags for pointers, immediate ints, and other >immediates. So it looks like the question comes down to this: is the >1/2nano- to 2giga- range enough for the large majority of floats that >get stored into memory, or should I go with the less convenient scheme >of only stealing 2 bits? In the latter case I'd have to use up one of our >four primary (2-bit low-) tags, but we could live with it. > I've been thinking about implementing short floats for Utah Common Lisp. I think it would be better to steal bits from the mantissa than the exponent. With our low tags scheme, a simple mask operation would restore a short float to an IEEE 32-bit float with the least significant bits of the mantissa zeroed, allowing the floating point hardware to do its thing. The original post by Paul Wilson discussed the problem of deciding when to use short floats vs. when to use long floats to avoid losing precision. This isn't an issue in Common Lisp (I'm reading this in comp.lang.lisp); the rules of floating point contagion (promotion) are defined by the language, and the user can chose the reader's default float type. Tim Moore moore@cs.utah.edu {bellcore,hplabs}!utah-cs!moore "Ah, youth. Ah, statute of limitations." -John Waters