3 ms·
If the "x, y = y, x" is implemented using the x86 "swap" instruction then the CPU could implement the swap using register renaming, I think - with no execution
by brucedawson 8y ago
If the "x, y = y, x" is implemented using the x86 "swap" instruction then the CPU could implement the swap using register renaming, I think - with no execution unit activity required. I don't know if it does.
But everything that golang (or C or C++ or whatever) does has to be expressed in assembly language, and assembly language doesn't directly control register renaming - it's a hidden implementation detail.
- stcredzero 8y agoThanks. That clarifies things.