个性化文献订阅>期刊> IEEE Transactions on Computers
 

Improved Division by Invariant Integers

  作者 Moller, N; Granlund, T  
  选自 期刊  IEEE Transactions on Computers;  卷期  2011年60-2;  页码  165-175  
  关联知识点  
 

[摘要]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 that 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 that we also get some additional savings from simpler adjustment conditions. The algorithm has been implemented in version 4.3 of the GMP library. When applied to the problem of dividing a large integer by a single word, the new algorithm gives a speedup of roughly 30 percent, benchmarked on AMD and Intel processors in the x86_64 family.

 
      被申请数(0)  
 

[全文传递流程]

一般上传文献全文的时限在1个工作日内