is it possible to code, say, an ADD that's faster than the actual instruction for ADD, only using other CPU functions (no physical access to the chip)? or are all CPU instructions always perfectly optimized?
All CPU instructions are made of NOR gates. And yes, they are perfectly optimized. However, you can sometimes use LEA in place of ADD to get a ``free'' addition executed in parallel to other code. See some explanation here http://stackoverflow.com/a/6328441/1116279 and also check the comments.
Name:
Anonymous2013-10-07 16:35
>>2 All CPU instructions are made of NOR gates.
Really? In every architecture? Is using only NOR the optimal choice, or is it just a matter of convenience using the same gate over and over, knowing it's Turing-complete? Is NOR better than NAND?
>>14
Not that much faster (in my experience, the low values for FPU instructions are very rare in practice, and only occur on "round" numbers and special cases like 0/1.)