]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/gcc/extensions-to-the-c-language-family/target-builtins/powerpc-atomic-memory-operation-functions.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gcc / extensions-to-the-c-language-family / target-builtins / powerpc-atomic-memory-operation-functions.rst
CommitLineData
c63539ff
ML
1..
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.
5
6.. _powerpc-atomic-memory-operation-functions:
7
8PowerPC Atomic Memory Operation Functions
9^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
11ISA 3.0 of the PowerPC added new atomic memory operation (amo)
12instructions. GCC provides support for these instructions in 64-bit
13environments. All of the functions are declared in the include file
14``amo.h``.
15
16The functions supported are:
17
18.. code-block:: c++
19
20 #include <amo.h>
21
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);
29
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);
34
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);
42
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);
47
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);
54
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);
58
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);
65
66 void amo_stdat_sadd (int64_t *, int64_t);
67 void amo_stdat_smax (int64_t *, int64_t);
3ed1b4ce 68 void amo_stdat_smin (int64_t *, int64_t);