Actually bit addition in ALU is usually implemented using an XOR gate (with an AND gate to compute carry)...But as "diff" is essentially addition (over complement numbers), they mean the same thing...
Also note that XOR is associative -- that's the key to prove the XOR swapping...
For those who are interested in binary tricks, there are several good resources:
XOR is fascinating. It can be understood as binary addition, discarding the carry (the higher bit of the result). It is also useful for drawing a cursor pixmap: XOR the screen with the cursor, XOR again to remove the cursor, without ever copying the area below the cursor.
Also note that XOR is associative -- that's the key to prove the XOR swapping...
For those who are interested in binary tricks, there are several good resources:
* HAKMEM, http://goo.gl/F6sBjt
* Hacker's Delight, http://goo.gl/llQumw