Re:Does a compiler use all x86 instructions? (2010)
by dibanez on Wednesday August 24, 2016 @12:48PM
(#12353354)
Yea, I've seen compilers use lea for some integer math in C/C++, because it is handled by a different part of the CPU and so can happen in parallel with other integer math ops.
[ Parent
| on HN ]
Re:Does a compiler use all x86 instructions? (2010)
by rwmj on Wednesday August 24, 2016 @12:52PM
(#12353377)
People might say this, but it's not really true. All these instructions are decomposed into micro-ops, and then the micro-ops are run in parallel - if data dependencies allow that - on a common pool of integer ALUs. The reason to use lea is for code compression - it allows you to express two or three operations in a single instruction.