Fast long overflow detection?
Mark Roos
mroos at roos.com
Tue Feb 7 11:28:09 PST 2012
So I thought I could get away with 64bit ints and not implement the
Smalltalk automatic conversion
to BigIntegers. Bad plan.
So I went ahead and did it while I waited for the super bowl to start. Not
too difficult. Just wrappered
java BigInteger and added some simple overflow detection.
But I am concerned about the impact on integer ops by adding a pretty
complex precalc overflow detection.
To help I decided to limit small ints to 62 bits and defer some checking
until after the op and cache lookup.
Any suggestions on approaches that offer superior techniques?
Seems like a methodHandle of guardOverflow would be handy someday.
regards
mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20120207/fd5ae63f/attachment.html
More information about the mlvm-dev
mailing list