3 ms·
An oldie but a goodie. Mandatory warning: please don't use those unless you really know what you're doing. Most modern CPUs have instructions for computing all
by simias 14y ago
An oldie but a goodie.
Mandatory warning: please don't use those unless you really know what you're doing. Most modern CPUs have instructions for computing all of that stuff and the compiler will try to use them. Those clever hacks might actually hurt both readability and performance if they're misused.
Typically on PC architectures (and even on most modern embedded systems) you shouldn't have to use those hacks.
- deleted 14y ago[deleted]
- nitrogen 14y agoI've used similar techniques (such as reciprocal multiplication, which is not mentioned on this page) to provide a significant speed advantage for some code on ARM systems. Actual performance-sensitive code, such as the core routines video codecs, is still written in assembly language or with intrinsics.