-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dec/arith: boost shl10VU/shr10VU performance
These functions now use the "constant division by multiplication" algorithm. This is made possible by the small range of possible values for the shift count (18 at most) and a precoomputed table of magic numbers (uses the same algorithm as the Go compiler). The amd64 assembler version of shl10VU now has a slight performance gain over the go version (about 5% less time per op). The performance boost is significative: name old time/op new time/op delta Shl10VU 9.06µs ± 0% 3.32µs ± 2% -63.36% (p=0.008 n=5+5) This improves (*Decimal).Add/Sub performance as well (when the mantissae of the operands need to be aligned) and Decimal -> Int(64) conversions.
- Loading branch information
Showing
4 changed files
with
124 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters