On 2011-03-23, at 5:27 PM, chevalma@iro.umontreal.ca wrote:
No. But I can show you the 3 or 4 pages of Scheme code which implements the algorithm. If this is not a top priority then we can ask Olivier to work on that.
Can't you scheme-to-js it all ;)
I don't think so... trampolines and all that stuff.
My guess is that you are trying to divide by 2^12... perhaps you could right shift by 12.
No, I'm actually doing division/modulo of unboxed integers during constant propagation. It's not really practical to do it on boxed integers directly with the current IR.
OK.
Also, on machine with 64 bit words, the radix can be 2^30, and that might be big enough to make the divisions doable with a single digit divisor.
One limiting factor is that JS only allows bitwise operations on 32 bit values. Was this one of the factors in your decision to limit the precision of big digits?
That is not relevant if we are bootstrapping on Tachyon which has wider integers (if we want to).
Also, if we have only 52 bits available in our boxed integers, can the radix really be 2^30?
Ha! I hadn't thought of that! Indeed if fixnums are artificially limited to only have 52 significant bits as you are doing, then the radix must be <= 2^26.
Marc