【24h】

Division by invariant integers using multiplication

机译:使用乘法除以不变整数

获取原文

摘要

Integer division remains expensive on today's processors as thecost of integer multiplication declines. We present code sequences fordivision by arbitrary nonzero integer constants and run-time invariantsusing integer multiplication. The algorithms assume a two's complementarchitecture. Most also require that the upper half of an integerproduct be quickly accessible. We treat unsigned division, signeddivision where the quotient rounds towards zero, signed division wherethe quotient rounds towards -∞, and division where the result is knowna priori to be exact. We give someimplementation results using the C compiler GCC.

机译:

由于整数乘法的成本下降,在当今的处理器上整数除法仍然很昂贵。我们给出了使用任意非零整数常量和运行时不变量使用整数乘法进行划分的代码序列。该算法采用二进制补码结构。大多数还要求整数乘积的上半部分必须能够快速访问。我们处理无符号除法,有符号除法(商向零舍入),有符号除法(商商向 -∞ <?Pub Caret> 舍入)和除法结果确切地说,已知<?Pub Fmt italic>先验<?Pub Fmt / italic>。我们使用C编译器GCC给出了一些实现结果。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号