Many CPUs only have 4-byte cmpxchg, and not 1/2-byte instructions. For
those, you need to mask and shift appropriately and use a 4-byte
cmpxchg.
This change adds support for cmpxchg-based instruction sets (only SPARC,
in LLVM). The support can be extended for LL/SC-based instruction
sets (e.g. PPC and MIPS) in the future, supplanting the ISel expansions
those architectures currently use.
Tests added for SPARCv9.