News for hackers. Stuff that matters.
Re:Fastest sort of fixed length 6 int array by rpearl on Wednesday August 24, 2011 @11:17AM (#2921019)
If you do the naive implementation: int temp = x; x = y; y = temp;

Then a sufficiently smart compiler can decide to assign, say, %eax to x and %ebx to y, and then just rename its notion of registers, and after the swap just begin using %ebx for x and %eax for y. A swap with no copies at all!

(It won't do this in every case, and it depends on context, but such an optimization is possible... but not with xor swaps.)

Re:Fastest sort of fixed length 6 int array by eru on Thursday August 25, 2011 @05:03PM (#2926422)
At least xor swaps would need an even smarter compiler.