[elephant-devel] 64 bit issues

Robert L. Read read at robertlread.net
Thu Aug 24 18:28:38 UTC 2006


On Thu, 2006-08-24 at 12:32 +0200, Petter Egesund wrote:

> Some thoughts;
> 
> I am getting a little closer, passing all 110 test except 6. Storing of
> stings seems to work now. What does not work is storing of integers, and
> thereby rationals, bignums, and so on.

Thank you!

> 
> This will not work without some larger rewriting. As far as I can see
> there are two options:
> 
> 1. Force serializing of integers to 32-bit, not dependent on the
> underlying OS. This seems to be the easy way out. What must be rewritten
> is:
> 
> - storing of fixnums (which can be larger then 32-bit on 64-bit os).
> Fixnums must be stored the same way as integers are stored today.
> - storing of bignums, as reading directly from the bignum using
> %bignum-ref can return 32-bit or 64-bit on different platsforms. A
> rewrite of storing bignums can be done on two ways, either by testing on
> platform, or by doing the work ourself, by doing some bitwise operations
> (something like shifting bytes doing some bitwise and, and then repeat
> until 0) I would wote for the last option, as this makes the codebase
> less platform-dependent (might be a small speed-penalty though (I don't
> know)).
> 
> 2. We can start storing integers as 64-bits on 64-bits platform.
> Probably means a lot of rewring? This will probably give the fastest
> benchmark-results?
> 
> I would personally go for suggestion 1, I do not think the differnce in
> speed will visible at all? Any opinions?

IMHO, your solution #1 is an OK patch as a stopgap.  However, we
definitely eventually want 
to take full advantage of a 64 bit architecture --- this will be the
wave of the future, and there is 
no serious reason why we can't rewrite it.  Having said that, I'm in no
position to do it for a while,
so unless you or someone else wants to rewrite it, I propose the
following:

Let's produce a patch that works as much as possible on the 64 bit
architecture, and document
the defficiency that on that architecture, for example, fixnums don't
work.  As long as this 
continues to pass all tests on 32-bit architectures, we can release it
as 0.6.1, for example.

When Ian and I work on 0.7.0, if you or someone else will help us test
on a 64-bit architecture, then
we will try to make sure that we fully support things in that release.

I'll write up the documentation based on what we decide.


> 
> Cheers,
> 
> Petter Egesund
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20060824/3aad4124/attachment.html>


More information about the elephant-devel mailing list