File: list_atomic.template

package info (click to toggle)
libatomic-ops 7.6.6-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,012 kB
  • sloc: ansic: 23,213; sh: 4,185; makefile: 366; asm: 8
file content (121 lines) | stat: -rw-r--r-- 3,717 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/*
 * Copyright (c) 2003 by Hewlett-Packard Company.  All rights reserved.
 *
 * This file is covered by the GNU general public license, version 2.
 * see COPYING for details.
 */

/* This generates a compilable program.  But it is really meant to be   */
/* be used only with cc -E, to inspect the expensions generated by      */
/* primitives.                                                          */

/* The result will not link or run.                                     */

#include <stdlib.h> /* for exit() */

void XSIZE_list_atomicXX(void)
{
# if defined(AO_HAVE_XSIZE_loadXX) || defined(AO_HAVE_XSIZE_storeXX) \
     || defined(AO_HAVE_XSIZE_fetch_and_addXX) \
     || defined(AO_HAVE_XSIZE_fetch_and_add1XX) \
     || defined(AO_HAVE_XSIZE_andXX) \
     || defined(AO_HAVE_XSIZE_compare_and_swapXX) \
     || defined(AO_HAVE_XSIZE_fetch_compare_and_swapXX)
    static volatile XCTYPE val /* = 0 */;
# endif
# if defined(AO_HAVE_XSIZE_compare_and_swapXX) \
     || defined(AO_HAVE_XSIZE_fetch_compare_and_swapXX)
    static XCTYPE oldval /* = 0 */;
# endif
# if defined(AO_HAVE_XSIZE_storeXX) \
     || defined(AO_HAVE_XSIZE_compare_and_swapXX) \
     || defined(AO_HAVE_XSIZE_fetch_compare_and_swapXX)
    static XCTYPE newval /* = 0 */;
# endif
# if defined(AO_HAVE_test_and_setXX)
    AO_TS_t ts = AO_TS_INITIALIZER;
# endif
# if defined(AO_HAVE_XSIZE_fetch_and_addXX) || defined(AO_HAVE_XSIZE_andXX) \
     || defined(AO_HAVE_XSIZE_orXX) || defined(AO_HAVE_XSIZE_xorXX)
    static XCTYPE incr /* = 0 */;
# endif

# if defined(AO_HAVE_nopXX)
    (void)"AO_nopXX(): ";
    AO_nopXX();
# else
    (void)"No AO_nopXX";
# endif

# ifdef AO_HAVE_XSIZE_loadXX
    (void)"AO_XSIZE_loadXX(&val):";
    (void)AO_XSIZE_loadXX(&val);
# else
    (void)"No AO_XSIZE_loadXX";
# endif
# ifdef AO_HAVE_XSIZE_storeXX
    (void)"AO_XSIZE_storeXX(&val, newval):";
    AO_XSIZE_storeXX(&val, newval);
# else
    (void)"No AO_XSIZE_storeXX";
# endif
# ifdef AO_HAVE_XSIZE_fetch_and_addXX
    (void)"AO_XSIZE_fetch_and_addXX(&val, incr):";
    (void)AO_XSIZE_fetch_and_addXX(&val, incr);
# else
    (void)"No AO_XSIZE_fetch_and_addXX";
# endif
# ifdef AO_HAVE_XSIZE_fetch_and_add1XX
    (void)"AO_XSIZE_fetch_and_add1XX(&val):";
    (void)AO_XSIZE_fetch_and_add1XX(&val);
# else
    (void)"No AO_XSIZE_fetch_and_add1XX";
# endif
# ifdef AO_HAVE_XSIZE_fetch_and_sub1XX
    (void)"AO_XSIZE_fetch_and_sub1XX(&val):";
    (void)AO_XSIZE_fetch_and_sub1XX(&val);
# else
    (void)"No AO_XSIZE_fetch_and_sub1XX";
# endif
# ifdef AO_HAVE_XSIZE_andXX
    (void)"AO_XSIZE_andXX(&val, incr):";
    AO_XSIZE_andXX(&val, incr);
# else
    (void)"No AO_XSIZE_andXX";
# endif
# ifdef AO_HAVE_XSIZE_orXX
    (void)"AO_XSIZE_orXX(&val, incr):";
    AO_XSIZE_orXX(&val, incr);
# else
    (void)"No AO_XSIZE_orXX";
# endif
# ifdef AO_HAVE_XSIZE_xorXX
    (void)"AO_XSIZE_xorXX(&val, incr):";
    AO_XSIZE_xorXX(&val, incr);
# else
    (void)"No AO_XSIZE_xorXX";
# endif
# ifdef AO_HAVE_XSIZE_compare_and_swapXX
    (void)"AO_XSIZE_compare_and_swapXX(&val, oldval, newval):";
    if (!AO_XSIZE_compare_and_swapXX(&val, oldval, newval))
      exit(1);
# else
    (void)"No AO_XSIZE_compare_and_swapXX";
# endif
  /* TODO: Add AO_compare_double_and_swap_doubleXX */
  /* TODO: Add AO_compare_and_swap_doubleXX */
# ifdef AO_HAVE_XSIZE_fetch_compare_and_swapXX
    (void)"AO_XSIZE_fetch_compare_and_swapXX(&val, oldval, newval):";
    if (AO_XSIZE_fetch_compare_and_swapXX(&val, oldval, newval) != oldval)
      exit(1);
# else
    (void)"No AO_XSIZE_fetch_compare_and_swapXX";
# endif

# if defined(AO_HAVE_test_and_setXX)
    (void)"AO_test_and_setXX(&ts):";
    (void)AO_test_and_setXX(&ts);
# else
    (void)"No AO_test_and_setXX";
# endif
}