x86_64 cas references unsigned int rather than StgWord
Ryan Newton pointed out on the mailing list that CAS wasn't behaving correctly in his heavy concurrency benchmarks. http://www.haskell.org/pipermail/ghc-devs/2014-February/003944.html
upon looking at the inline ASM, it looks like both CAS and Xchng were probably using the 32bit versions of their asm operations, or at least thats my strawman interpretation.
https://github.com/cartazio/ghc/compare/ghc:ghc-7.8...fix_64bit_intel_cas is the patch, which should be tested and confirmed to resolve this issue before getting merged in.
This patch makes the 64 bit versions of CAS and xchg use the quad word instructions