Implement atomic operations library for libgupc SMP runtime.
[official-gcc.git] / libgupc / include / upc_ops.def
blobc7d8b6bdb120a24052c9e5712b1c412ed3cb308b
1 /* UPc Operation (used in collectives and atomic ops). */
3 /*
4 - Supported AMO integer types are UPC_INT, UPC_UINT, UPC_LONG, UPC_ULONG,
5 UPC_INT32, UPC_UINT32, UPC_INT64, and UPC_UINT64.
6 - Supported AMO floating-point types are UPC_FLOAT and UPC_DOUBLE.
7 - Supported AMO accessors are UPC_GET, UPC_SET, and UPC_CSWAP.
8 - Supported AMO bit-wise operations are UPC_AND, UPC_OR, and UPC_XOR.
9 - Supported AMO numeric operations are UPC_ADD, UPC_SUB, UPC_MULT, UPC_INC,
10 UPC_DEC, UPC_MAX, and UPC_MIN. */
12 upc_op = {
13 op_upc_name = "UPC_ADD";
14 op_name = "add";
15 op_op = "+";
16 op_bit = 0;
17 op_c_value = "(1LL << 0)";
18 op_mode = "numeric";
19 op_atomic_ok;
20 op_require_operand1;
21 op_null_operand2;
23 upc_op = {
24 op_upc_name = "UPC_MULT";
25 op_name = "mult";
26 op_op = "*";
27 op_bit = 1;
28 op_c_value = "(1LL << 1)";
29 op_mode = "numeric";
30 op_atomic_ok;
31 op_require_operand1;
32 op_null_operand2;
34 upc_op = {
35 op_upc_name = "UPC_AND";
36 op_name = "and";
37 op_op = "&";
38 op_bit = 2;
39 op_c_value = "(1LL << 2)";
40 op_mode = "logical";
41 op_atomic_ok;
42 op_require_operand1;
43 op_null_operand2;
45 upc_op = {
46 op_upc_name = "UPC_OR";
47 op_name = "or";
48 op_op = "|";
49 op_bit = 3;
50 op_c_value = "(1LL << 3)";
51 op_mode = "logical";
52 op_atomic_ok;
53 op_require_operand1;
54 op_null_operand2;
56 upc_op = {
57 op_upc_name = "UPC_XOR";
58 op_name = "xor";
59 op_op = "^";
60 op_bit = 4;
61 op_c_value = "(1LL << 4)";
62 op_mode = "logical";
63 op_atomic_ok;
64 op_require_operand1;
65 op_null_operand2;
67 upc_op = {
68 op_upc_name = "UPC_LOGAND";
69 op_name = "logand";
70 op_bit = 5;
71 op_c_value = "(1LL << 5)";
72 op_mode = "logical";
74 upc_op = {
75 op_upc_name = "UPC_LOGOR";
76 op_name = "logor";
77 op_bit = 6;
78 op_c_value = "(1LL << 6)";
79 op_mode = "logical";
81 upc_op = {
82 op_upc_name = "UPC_MIN";
83 op_name = "min";
84 op_bit = 7;
85 op_c_value = "(1LL << 7)";
86 op_mode = "numeric";
87 op_atomic_ok;
88 op_require_operand1;
89 op_null_operand2;
91 upc_op = {
92 op_upc_name = "UPC_MAX";
93 op_name = "max";
94 op_bit = 8;
95 op_c_value = "(1LL << 8)";
96 op_mode = "numeric";
97 op_atomic_ok;
98 op_require_operand1;
99 op_null_operand2;
101 upc_op = {
102 op_upc_name = "UPC_GET";
103 op_name = "get";
104 op_bit = 9;
105 op_c_value = "(1LL << 9)";
106 op_mode = "access";
107 op_atomic_ok;
108 op_require_fetch_ptr;
109 op_null_operand1;
110 op_null_operand2;
112 upc_op = {
113 op_upc_name = "UPC_SET";
114 op_name = "set";
115 op_bit = 10;
116 op_c_value = "(1LL << 10)";
117 op_mode = "access";
118 op_atomic_ok;
119 op_require_operand1;
120 op_null_operand2;
122 upc_op = {
123 op_upc_name = "UPC_CSWAP";
124 op_name = "compare_exchange";
125 op_bit = 11;
126 op_c_value = "(1LL << 11)";
127 op_mode = "access";
128 op_atomic_ok;
129 op_require_operand1;
130 op_require_operand2;
132 upc_op = {
133 op_upc_name = "UPC_SUB";
134 op_name = "sub";
135 op_op = "-";
136 op_bit = 12;
137 op_c_value = "(1LL << 12)";
138 op_mode = "numeric";
139 op_atomic_ok;
140 op_require_operand1;
141 op_null_operand2;
143 upc_op = {
144 op_upc_name = "UPC_INC";
145 op_name = "inc";
146 op_op = "+";
147 op_bit = 13;
148 op_c_value = "(1LL << 13)";
149 op_mode = "numeric";
150 op_atomic_ok;
151 op_null_operand1;
152 op_null_operand2;
154 upc_op = {
155 op_upc_name = "UPC_DEC";
156 op_name = "dec";
157 op_op = "-";
158 op_bit = 14;
159 op_c_value = "(1LL << 14)";
160 op_mode = "numeric";
161 op_atomic_ok;
162 op_null_operand1;
163 op_null_operand2;