intx icon indicating copy to clipboard operation
intx copied to clipboard

Optimize uint256 multiplication

Open chfast opened this issue 4 years ago • 3 comments

  1. We want to use the "loop" procedure as in mul_loop_opt().
  2. There, it may be good to separate first iteration which does not need to load p[] values as they are zeros. Compilers are not always able to figure it out.
  3. The best score was 60 instructions.
  4. Some experimentation: https://godbolt.org/z/915aeG.

chfast avatar Feb 25 '21 10:02 chfast

https://godbolt.org/z/GhfKv31vT

chfast avatar Feb 15 '24 22:02 chfast

Prototype of u192 multiplication with mulx,adox,adcx: https://godbolt.org/z/6nbc3aafE

chfast avatar Apr 13 '24 05:04 chfast