Thanks very much for that code! I think there's a small bug in the subtract case. They reuse the add_overflow code, apparently assuming I'll pass -B, but B might be the most negative integer which can't be negated. Also the multiply code is going to be very slow. The idea behind the gcc/clang __builtins is that they can often use hardware support -- "conditional jump on overflow" -- and the check will not affect the speed of the multiply very much. I haven't re-run the timing tests in a long time, but my recollection is that the slowdown was not noticeable in s7's context. I'll try those tests again both with and without the checks (and with these laborious MSVC checks) and see how bad it is. My preference would be to omit the tests if they affect the timings too much -- anyone using ints in the 2^63 range (or 2^32 for *) ought to have some idea of what they are doing.
_______________________________________________ Cmdist mailing list [email protected] https://cm-mail.stanford.edu/mailman/listinfo/cmdist
