mirror of
https://github.com/MacosPorters/betterxen.git
synced 2026-11-26 20:10:44 +00:00
Declare XADD and CMPXCHG in the instruction registry for 8- to 64-bit register and memory destinations. The LOCK prefix is accepted on the forms the registry marks lockable and only with a memory destination; every other use stays an illegal instruction. Both engines run the new forms on the shared semantics. A failed CMPXCHG still writes its destination, so it faults on memory that cannot be written, and a fault changes nothing. The registry document states the ordering, alignment, compare-failure and fault rules a guest scheduler has to preserve. Nothing is lowered to ARM64 atomics. Fourteen SDM-derived cases already in cpu_known_answers.rs move from refused to verified. Adds 62 LLVM-assembled fixtures with reference arms, generator checks for the lock key and tests/x86_atomic.rs. Signed-off-by: zachdoxsee <zachdoxsee36@gmail.com>