Improved Division by Invariant Integers

13 years 1 months ago
Improved Division by Invariant Integers
—This paper considers the problem of dividing a two-word integer by a single-word integer, together with a few extensions and applications. Due to lack of efficient division instructions in current processors, the division is performed as a multiplication using a precomputed single-word approximation of the reciprocal of the divisor, followed by a couple of adjustment steps. There are three common types of unsigned multiplication instructions; we define full word multiplication (umul) which produces the two-word product of two single-word integers, low multiplication (umullo) which produces only the least significant word of the product, and high multiplication (umulhi), which produces only the most significant word. We describe an algorithm which produces a quotient and remainder using one umul and one umullo. This is an improvement over earlier methods, since the new method uses cheaper multiplication operations. It turns out we also get some additional savings from simpler adj...
Niels Moller, Torbjörn Granlund
Added 15 May 2011
Updated 15 May 2011
Type Journal
Year 2011
Where TC
Authors Niels Moller, Torbjörn Granlund
Comments (0)