4 ms·
I wonder how much arithmetic is done with integers that can't fit in a 32-bit int? Might it be better to have a tagged 64-bit type where, if the type is an int
by Karellen 3y ago
I wonder how much arithmetic is done with integers that can't fit in a 32-bit int?
Might it be better to have a tagged 64-bit type where, if the type is an int, one half of the value is a 32-bit int? You could then do arithmetic with 32-bit values just with bit-masking, or by using instructions that operate on half of a register, rather than having to shift. If the result of a calculation exceeds 32-bits (checked with carry flag) then you can box that into a 64-bit (or bignum?) int instead?