cmpxchg Operation Font Conventions
if
(PR[qp]) { ;
if (GR[r3].nat || GR[r2].nat)
register_nat_consumption_fault(SEMAPHORE);
paddr = (GR[r3], sz, SEMAPHORE,
PSR.cpl, &mattr, &tmp_unused);
if (!ma_supports_semaphores(mattr))
unsupported_data_reference_fault(GR[r3]);
if (sem == ‘acq') {
val = (AR[CCV], GR[r2], paddr, sz,
UM.be, mattr, ACQUIRE,
ldhint);
} else { // ‘rel'
val = mem_xchg_cond(AR[CCV], GR[r2], paddr, sz, UM.be, mattr,
RELEASE,
ldhint);
}
val = zero_ext(val, sz * 8);
if (AR[CCV] == val) (paddr, sz);
GR[r1] = val;
GR[r1].nat = 0;
}