Commit Graph

6 Commits

Author SHA1 Message Date
Mamy Ratsimbazafy 102a1b0f0c
Rename the library to Stint (#26) 2018-04-25 12:52:00 +02:00
Mamy Ratsimbazafy d5794ffbe1
Use word iteration for bitwise op (#22) + 10% perf improvement.
* Try with iterator (failing)

* Type resolution in macro for generic return values in iterators is broken ...

* Use iterators for bit operations. Optimize MpUint initialization

* Fix add_sub
2018-04-21 17:21:14 +02:00
Mamy Ratsimbazafy 1749e0e575
[WIP] Division and multiplication optimization (#21)
* Clean-up code, part 1

* Managed to get best borrow code for the not inlined substraction #10

* Implement in place substraction in terms of substraction #10

* Another unneed proc removal/temporary step

* more cleanup

* Upgrade benchmark to Uint256

* Special case when divisor is less than halfSize x2 speed 🔥 (still 4x slower than ttmath on Uint256)

* Division: special case if dividend can overflow. 10% improvement.

* forgot to undo normalization (why did the test pass :??)

* 1st part, special cases of fast division

* Change bitops, simplify bithacks to detect new fast division cases

* 25% speed increase. Within 3x of ttmath

* Reimplement multiplication with minimum allocation

* Fix call. Now only 2x slower than ttmath

* Prepare for optimizing comparison operators

* Comparison inlining and optimization. 25% speed increase. 50% slower than ttmath now 🔥

* Fix comparison, optimize one()

* inline initMpUintImpl for another 20% speed. Only 20% slower than ttmath without ASM
2018-04-21 12:12:05 +02:00
Mamy Ratsimbazafy 3a1e5b1151
Make bits part of type (#6)
* Small reorg of conversion proc

* Rework with bits as type. Pass endianess test

* tests_comparison compiles and succeed

* Fix init with int for mpint_test compilation flag

* All tests green 🔥
2018-03-26 11:46:24 +02:00
mratsim 8b8f2a55c4 Relicense under dual Apache/MIT 2018-03-02 11:48:08 +01:00
mratsim 834ff19a25 Add comparison operators + tests + fix shr forward declaration 2018-02-16 17:48:54 +01:00