MMIX LOGO

MMIX Instruction Set

Table of Content

Content

CSWAP

Name:

CSWAP $X,$Y,$Z

Specification:

If u(M8[$Y + $Z]) = rP
then u(M8[$Y + $Z]) ← $X and $X ← 1
otherwise rP ← u(M8[$Y + $Z]) and $X ← 0

Timing:

2υ + 2μ

Description:

Compare and Swap. Compare the octabyte at the address $Y+$Z (or $Y+Z) with the content of the prediction register rP. If both are equal, store $X at the given address and set $X to 1, otherwise load the value from the given address into rP and set $X to 0.

This is an atomic operation, and therefore suitable to synchronize processes using memory locations.

Please help to keep this site up to date! If you want to point out important material or projects that are not listed here, if you find errors or want to suggest improvements, please send email to email