2 ms·
"The speed gap between multiplication and addition has narrowed considerably over the past 20 years to the point where multiplication can be even faster than ad
by kristianp 8y ago
"The speed gap between multiplication and addition has narrowed considerably over the past 20 years to the point where multiplication can be even faster than addition in some chip architectures."
Does anyone have an example of hardware where multiplication is actually faster than addition? That's not an intuitive result unless they're talking about floating point numbers, and even then...
- a1369209993 8y agoI don't know of a architechure that actually does this, but I suspect they're comparing a N->N->N truncating multiply with a N->N->N+1 addition that sets the carry flag. In addition to forcing the compiler to reorder test-fiddle-branch sequences in a potentially suboptimal way, you'd also introduce speculation hazards for any instructions that depend on the flags. I'd be interested to see any hardware where that's enough to make addition slower, though, since usually you can make up for it by dumping a extra (very cheap) adder into the execution system.