2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
6 .. _powerpc-atomic-memory-operation-functions:
8 PowerPC Atomic Memory Operation Functions
9 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 ISA 3.0 of the PowerPC added new atomic memory operation (amo)
12 instructions. GCC provides support for these instructions in 64-bit
13 environments. All of the functions are declared in the include file
16 The functions supported are:
22 uint32_t amo_lwat_add (uint32_t *, uint32_t);
23 uint32_t amo_lwat_xor (uint32_t *, uint32_t);
24 uint32_t amo_lwat_ior (uint32_t *, uint32_t);
25 uint32_t amo_lwat_and (uint32_t *, uint32_t);
26 uint32_t amo_lwat_umax (uint32_t *, uint32_t);
27 uint32_t amo_lwat_umin (uint32_t *, uint32_t);
28 uint32_t amo_lwat_swap (uint32_t *, uint32_t);
30 int32_t amo_lwat_sadd (int32_t *, int32_t);
31 int32_t amo_lwat_smax (int32_t *, int32_t);
32 int32_t amo_lwat_smin (int32_t *, int32_t);
33 int32_t amo_lwat_sswap (int32_t *, int32_t);
35 uint64_t amo_ldat_add (uint64_t *, uint64_t);
36 uint64_t amo_ldat_xor (uint64_t *, uint64_t);
37 uint64_t amo_ldat_ior (uint64_t *, uint64_t);
38 uint64_t amo_ldat_and (uint64_t *, uint64_t);
39 uint64_t amo_ldat_umax (uint64_t *, uint64_t);
40 uint64_t amo_ldat_umin (uint64_t *, uint64_t);
41 uint64_t amo_ldat_swap (uint64_t *, uint64_t);
43 int64_t amo_ldat_sadd (int64_t *, int64_t);
44 int64_t amo_ldat_smax (int64_t *, int64_t);
45 int64_t amo_ldat_smin (int64_t *, int64_t);
46 int64_t amo_ldat_sswap (int64_t *, int64_t);
48 void amo_stwat_add (uint32_t *, uint32_t);
49 void amo_stwat_xor (uint32_t *, uint32_t);
50 void amo_stwat_ior (uint32_t *, uint32_t);
51 void amo_stwat_and (uint32_t *, uint32_t);
52 void amo_stwat_umax (uint32_t *, uint32_t);
53 void amo_stwat_umin (uint32_t *, uint32_t);
55 void amo_stwat_sadd (int32_t *, int32_t);
56 void amo_stwat_smax (int32_t *, int32_t);
57 void amo_stwat_smin (int32_t *, int32_t);
59 void amo_stdat_add (uint64_t *, uint64_t);
60 void amo_stdat_xor (uint64_t *, uint64_t);
61 void amo_stdat_ior (uint64_t *, uint64_t);
62 void amo_stdat_and (uint64_t *, uint64_t);
63 void amo_stdat_umax (uint64_t *, uint64_t);
64 void amo_stdat_umin (uint64_t *, uint64_t);
66 void amo_stdat_sadd (int64_t *, int64_t);
67 void amo_stdat_smax (int64_t *, int64_t);
68 void amo_stdat_smin (int64_t *, int64_t);