]>
Commit | Line | Data |
---|---|---|
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 | .. index:: ATOMIC_XOR, Atomic subroutine, XOR | |
7 | ||
8 | .. _atomic_xor: | |
9 | ||
10 | ATOMIC_XOR --- Atomic bitwise OR operation | |
11 | ****************************************** | |
12 | ||
13 | .. function:: ATOMIC_XOR (ATOM, VALUE , STAT) | |
14 | ||
15 | ``ATOMIC_AND(ATOM, VALUE)`` atomically defines :samp:`{ATOM}` with the bitwise | |
16 | XOR between the values of :samp:`{ATOM}` and :samp:`{VALUE}`. When :samp:`{STAT}` is present | |
17 | and the invocation was successful, it is assigned the value 0. If it is present | |
18 | and the invocation has failed, it is assigned a positive value; in particular, | |
19 | for a coindexed :samp:`{ATOM}`, if the remote image has stopped, it is assigned the | |
20 | value of ``ISO_FORTRAN_ENV`` 's ``STAT_STOPPED_IMAGE`` and if the remote | |
21 | image has failed, the value ``STAT_FAILED_IMAGE``. | |
22 | ||
23 | :param ATOM: | |
24 | Scalar coarray or coindexed variable of integer | |
25 | type with ``ATOMIC_INT_KIND`` kind. | |
26 | ||
27 | :param VALUE: | |
28 | Scalar of the same type as :samp:`{ATOM}`. If the kind | |
29 | is different, the value is converted to the kind of :samp:`{ATOM}`. | |
30 | ||
31 | :param STAT: | |
32 | (optional) Scalar default-kind integer variable. | |
33 | ||
34 | Standard: | |
35 | TS 18508 or later | |
36 | ||
37 | Class: | |
38 | Atomic subroutine | |
39 | ||
40 | Syntax: | |
41 | .. code-block:: fortran | |
42 | ||
43 | CALL ATOMIC_XOR (ATOM, VALUE [, STAT]) | |
44 | ||
45 | Example: | |
46 | .. code-block:: fortran | |
47 | ||
48 | program atomic | |
49 | use iso_fortran_env | |
50 | integer(atomic_int_kind) :: atom[*] | |
51 | call atomic_xor (atom[1], int(b'10100011101')) | |
52 | end program atomic | |
53 | ||
54 | See also: | |
55 | :ref:`ATOMIC_DEFINE`, | |
56 | :ref:`ATOMIC_FETCH_XOR`, | |
57 | :ref:`ISO_FORTRAN_ENV`, | |
58 | :ref:`ATOMIC_ADD`, | |
59 | :ref:`ATOMIC_OR`, | |
3ed1b4ce | 60 | :ref:`ATOMIC_XOR` |