You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggested by Torbjörn Granlund (personal communication):
"
Division:
The DIVQ instruction is terrible. Don't ever use it. You might
want to take a look at "Improved Division by Invariant Integers" by
me and a collegue of mine. Your loop will become about 10 times
faster. You need to apply this also to generic division (not just the
one-divisor-word case.
"
Ok, good to know. Note that Torbjörn's paper suggests that even for a non-constant divisor, division via mutiplication by inverse is faster:
"Somewhat surprisingly, a well-tuned Newton reciprocal followed by multiplication and adjustments wins over the hardware division instructions even for a single non-invariant division on modern 64-bit PC processors."
Suggested by Torbjörn Granlund (personal communication):
"
Division:
The DIVQ instruction is terrible. Don't ever use it. You might
want to take a look at "Improved Division by Invariant Integers" by
me and a collegue of mine. Your loop will become about 10 times
faster. You need to apply this also to generic division (not just the
one-divisor-word case.
"
(paper reference: https://gmplib.org/~tege/division-paper.pdf)
The text was updated successfully, but these errors were encountered: