4 ms·
According to the Intel IA-32 Optimization Reference Manual, integer multiplication has a 3 cycle latency. What's "hopelessly inefficient" about 3 cycles? ( Sou
by fh 18y ago
According to the Intel IA-32 Optimization Reference Manual, integer multiplication has a 3 cycle latency. What's "hopelessly inefficient" about 3 cycles?
( Source: http://download.intel.com/design/processor/manuals/248966.pdf http://download.intel.com/design/processor/manuals/248966.pd... )
- jcl 18y agoOn earlier-model processors, it could be as bad as 40 cycles. You really didn't want to touch multiplication (or division!) back then. I recall programmers went as far as calculating memory offsets for a 320x200 screen as (x + (y << 8) + (y << 6)) instead of (x + y * 320). http://home.comcast.net/~fbui/intel_i.html#imul http://home.comcast.net/~fbui/intel_i.html#imul