[rust-dev] Appeal for CORRECT, capable, future-proof math, pre-1.0

Daniel Micay danielmicay at gmail.com
Fri Jan 10 22:23:29 PST 2014


On Sat, Jan 11, 2014 at 12:41 AM, Corey Richardson <corey at octayn.net> wrote:
>
> We need to perform at least as well as GMP for me to even consider it.

The only realistic way to accomplish this is using GMP. Lots of other
big integer implementations exist with lots of work put into them and
the performance is not even in the same ballpark. It's difficult just
to implement all of the required algorithms:

https://gmplib.org/manual/Division-Algorithms.html#Division-Algorithms

Then, consider that you're going to need to write the low-level code
by hand in assembly so you're going to need domain experts for several
architectures. Processors and compilers are terrible at dealing with
the side effects like carry/overflow flags and can't deal with this
kind of code well.

You'll need versions for different revisions of the CPU instruction
set too, since useful features are added all of the time. For example,
Haswell introduces the `MULX` instruction (among others) and Broadwell
will introduce `ADCX` and `ADOX`.


More information about the Rust-dev mailing list