[Q] Project: Better performance for LargeIntegers

Andrew C. Greenberg werdna at gate.net
Sat Oct 30 04:15:20 UTC 1999


> >>I have changed my mind a little bit after studying some Squeak sources.
> >>
> >>Now I plan to implement LargeInteger primitives (20-39) _without_ changing
> >>the representation of LargeIntegers by extending the Interpreter arithmetic
> >>primitives using the CCodeGenerator.
> >>This avoids some problems dealing with different platforms.
> >>
> >>In a later step changing the representation to bigger 'digits' (16,32,..
> >>bits?) _could_ be interesting.
> >
> >Perhaps 16 bits, but unlikely 32.  How, for example, would you handle
> >integer overflow when doing, say, the LargeInteger add?  And how
> >could you do the multiply without bit munging?  Is it possible that a
> >straight loop with carry would be much faster than all the masking
> >and shifting necessary to do a carry written in C?
>
>Well, since we're talking hackery here, Squeak's long Floats can 
>probably help a lot.
>Yeh jes' load 'em into da mantissa an' press 'start'  (hey, it's 
>Friday night ;-).

That should work for the adding of the 32 bitters.  How would you do 
a multiply?





More information about the Squeak-dev mailing list