Hacker News new | ask | show | jobs
by zerr 2329 days ago
CMOV aside, I remember it was proved MOV itself is turing-complete.
2 comments

slightly related, does embedding arithmetic in mov instructions go faster than explicit ALU operations ?
Depending on the arithmetic, it seems that yes it can! I've noticed gcc using LEA instructions for arithmetic of the form (x * a + b), where 'a' and 'b' fit with the instruction.
Using LEA (load effective address) for calculation seems to be pretty common in most programs for both gcc and llvm. You basically get smaller code, and it used to schedule them better across more execution ports. Not sure if the CPU can fuse the ADD+MUL now.