Tomorrow your unsafely implemented xor-trick might get miscompiled as well thanks to undefined behaviorbob wrote:Yes, if somewhat unsafely. Today 8 byte-aligned writes of size 8 are done atomically. Who knows about tomorrow? And there are other architectures with a more relaxed memory model (the Alpha was probably the most aggressive) where such an assumption might blow up.

The Alpha already might have misexecuted it.
I think Evert proposes a 16-byte entry with hash move and 32-bit hash key in the same 8-byte word. So if the 32-bit hash key matches, then the hash move will be unaffected by SMP corruption provided that access to the 8-byte word is atomic.However, 8 byte hash entries are really problematic in terms of collisions, which means to get rid of the lockless code, you still have to vet the move to be sure it is OK to make, assuming you have potential crash conditions (such as castling with no king on e1, which would produce a second one, etc... I have an 8 byte version but I was not happy with the number of collisions.