# compiler_rt: cmpxchg-based atomic fetch/exchange for small types · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9006cd9d09da083e89b58e19c0091924e1e4849f)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9006cd9d09da083e89b58e19c0091924e1e4849f

Requested commit: 9006cd9d09da083e89b58e19c0091924e1e4849f

Commit: 9006cd9d09da083e89b58e19c0091924e1e4849f

Tree: 5f268055e142c85b72a57480ba56d1c5d81817b9

Author: Robin Voetter

Committer: Robin Voetter

## Message

```
compiler_rt: cmpxchg-based atomic fetch/exchange for small types

Some architectures (AMDGPU) do not support atomic exchange/fetch for
small types (for AMDGPU: 8- and 16-bit ints). For these types
atomic fetch and atomic exchange needs to be implemeted using atomic
operations on a wider type using cmpxchg.

```

## Parents

- [8894d1c45eb01fa3fbcc9173bac729e5812307ed](https://git.cafe/gitcafe/zig/commit/8894d1c45eb01fa3fbcc9173bac729e5812307ed?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9006cd9d09da083e89b58e19c0091924e1e4849f?format=markdown)
