Skip to main content

New answers tagged

-1 votes

Can computers only add?

you can get the min and the max by adding, you can also multiply by adding, a computer that just uses add and take is a really good one, because its atune to what voltage does when you add it to a ...
Magnus Wootton's user avatar
0 votes

On a micro-architectural level, why is using a temporary variable faster than using XOR to swap two variables?

It may be because we can extract ILP from instructions with temp variable as there are false dependencies. The one with xor has RAW dependencies.
Abhishek's user avatar
1 vote

On a micro-architectural level, why is using a temporary variable faster than using XOR to swap two variables?

Every version of your code invokes undefined behaviour, therefore the compiler is free to produce any code it wants. No conclusions can be drawn.
gnasher729's user avatar
  • 32.6k

Top 50 recent answers are included