From: Alex Queiroz <[email protected]> Subject: Re: [r6rs-discuss] Proposed NON-features for small Scheme, part 4D: inexact precisions Date: Wed, 23 Sep 2009 19:54:32 +0000
> Hallo, > > On 9/23/09, Shiro Kawai <[email protected]> wrote: > > > > An interesting approach is taken by a Ruby implementor > > (Koichi Sasada): Taking one tag bit from exponent (instead of > > mantissa) of IEEE double floats. That is, if the exponent is > > within a certain range, IEEE double is represented as an > > immediate value on 64bit architecture. If the exponent is too > > small or too large, it fallbacks to boxed double automatically. > > Empirically, he reported almost all doubles appeared during > > computation fell into the range representable in immediate doubles. > > Same technique may be applicable to represent single floats on > > 32bit architecture. > > > > Interesting. I wonder how he did that, because the bits which are > zero in a pointer are the least significant ones, and the exponent of > a IEEE float is in the most significant bits. He used bitwise rotate. The paper is here, though it is in Japanese: http://www.nue.riec.tohoku.ac.jp/ppl2008/proceedings/1-17.pdf In short, when the exponent falls in "middle range", i.e. 512<e<1535, (b62 xor b61) == 1. If you rotate the word 3 bits to left, these two bits comes to LSB. He uses LSB==1 to mark this rotated double representation. See the code on the page 5. --shiro _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
