Commit Graph

9 Commits

Author SHA1 Message Date
mratsim b3dedf7824 Split initialization and conversion proc 2018-04-25 14:43:24 +02:00
mratsim 40c2215804 Add the IntImpl type. Rename uint_type to datatypes 2018-04-25 14:27:55 +02:00
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 24bd2fc986
Recursive init + bitwise as test + fix shr (#9)
* Recursive init compiles

* fix bitshift. Missing rolling over

* Strange shift required

* debug msg leftover
2018-03-28 20:45:39 +02:00
Mamy Ratsimbazafy c8190df152
Faster division algorithm (#8)
* cosmetic changes

* fix zero conversion

* Div using divided and conquer algorithm. (Compiles but doesn't work)

* Passes test with production flag
2018-03-28 17:15:36 +02:00
mratsim c65ab16512 Conversion fixes for <uint64. Also closes #4 and #5 2018-03-26 12:45:10 +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