# libsst-atomic

Cross-platform atomic operations implemented in hand-written assembly for
lock-free programming.

## API

All functions operate on `volatile int*` or `volatile void**`:

- **Add / AddPtr** -- atomic add (with optional return of new value)
- **And / Or / Xor / Not** -- atomic bitwise ops (with optional return)
- **Exchange / ExchangePtr** -- swap value, return old
- **ExchangeAdd / ExchangeAddPtr** -- add, return old value
- **CAS / CASPtr** -- compare-and-swap, return old value
- **LoadAcquire / LoadAcquirePtr** -- load with acquire semantics
- **StoreRelease / StoreReleasePtr** -- store with release semantics

## Architecture support

Each backend is a standalone `.asm` file:

| File | Architecture | ABI |
|---|---|---|
| SST_Atomic_x86.asm | x86 (32-bit) | cdecl |
| SST_Atomic_x86-64.asm | x86-64 | System V |
| SST_Atomic_x86-64-win64.asm | x86-64 | Microsoft x64 |
| SST_Atomic_arm.asm | ARMv6+ | ARM EABI |
| SST_Atomic_ia64.asm | Itanium | IA-64 |
| SST_Atomic_mips.asm | MIPS32R2+ | o32 |
| SST_Atomic_mips64.asm | MIPS64R2+ | n64 |
| SST_Atomic_ppc.asm | PowerPC 32 | SysV |
| SST_Atomic_sparc.asm | SPARCv9 32 | SPARC |
| SST_Atomic_sparc64.asm | SPARCv9 64 | SPARC |
