On Sun, Nov 13, 2011 at 1:41 PM, Scott L. Burson <Scott@sympoiesis.com> wrote:
On Sun, Nov 6, 2011 at 2:33 PM, Juho Snellman <email@example.com> wrote:
> changes in sbcl-1.0.53 relative to sbcl-1.0.52:
> * enhancement: on 64-bit targets, in src/compiler/generic/early-vm.lisp,
> the parameter n-fixnum-tag-bits may now vary from 1 (fixnum =
> (signed-byte 63)) to 3 (fixnum = (signed-byte 61)) at build-time.
> * minor(?) incompatible(?) change: The default fixnum width on 64-bit
> targets is now 63 bits (up from 61).
reminded me of something I've been meaning to ask about.
For numeric work I've sometimes wished for immediate 61-bit
double-floats (obviously I wouldn't mind another bit or two if it
could be squeezed in, but I'm guessing 61 is the likely value).
Clearly this would break exact IEEE compatibility, but for anything I
do, it would be more than worth giving that up for much better
I'm not sure how much work it would be to implement, either. Could it
be as simple as adding a little rounding code after each FP operation?
I know floating point has subtleties that I'm not up on, but seeing
as how the whole point of this exercise is to trade a little accuracy
for performance, maybe it's not necessary to worry about those too
I thought about whether it would make sense to add a fifth float type
("almost-double-float"???), but the nonstandardness would probably
vitiate its usefulness. Probably better just to make this a
build-time option for double-floats. I guess long-float would still
be 64 bits anyway.
What do you thnk?
Doesn't most hardware only define floats of a few sizes, 32, 64, and for Intel, 80 bits? In that case I would think you pay a large price for not having one of these sizes, because everything would have to be emulated in software. On the other hand, I've thought it would be nice to be able to select at SBCL build time short-float, single-float, double-float, long-float as any of these that are available on the hardware, as long as they were non-decreasing in size in that order. So I might like to have single-float as 64 or 80 bits; I would like to always use full precision and setting read-default-float-format doesn't quite do it for me.