How do I tell whether AMOCAS.H succeeded?
After normal completion with nonzero rd, compare the low 16 bits of the value returned in rd with the low 16 bits of the expected value saved before execution; equality indicates that the swap store occurred. The returned halfword is sign-extended in rd.