1 /*
2  * kmp_atomic.h - ATOMIC header file
3  */
4 
5 //===----------------------------------------------------------------------===//
6 //
7 //                     The LLVM Compiler Infrastructure
8 //
9 // This file is dual licensed under the MIT and the University of Illinois Open
10 // Source Licenses. See LICENSE.txt for details.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef KMP_ATOMIC_H
15 #define KMP_ATOMIC_H
16 
17 #include "kmp_lock.h"
18 #include "kmp_os.h"
19 
20 #if OMPT_SUPPORT
21 #include "ompt-specific.h"
22 #endif
23 
24 // C++ build port.
25 // Intel compiler does not support _Complex datatype on win.
26 // Intel compiler supports _Complex datatype on lin and mac.
27 // On the other side, there is a problem of stack alignment on lin_32 and mac_32
28 // if the rhs is cmplx80 or cmplx128 typedef'ed datatype.
29 // The decision is: to use compiler supported _Complex type on lin and mac,
30 //                  to use typedef'ed types on win.
31 // Condition for WIN64 was modified in anticipation of 10.1 build compiler.
32 
33 #if defined(__cplusplus) && (KMP_OS_WINDOWS)
34 // create shortcuts for c99 complex types
35 
36 // Visual Studio cannot have function parameters that have the
37 // align __declspec attribute, so we must remove it. (Compiler Error C2719)
38 #if KMP_COMPILER_MSVC
39 #undef KMP_DO_ALIGN
40 #define KMP_DO_ALIGN(alignment) /* Nothing */
41 #endif
42 
43 #if (_MSC_VER < 1600) && defined(_DEBUG)
44 // Workaround for the problem of _DebugHeapTag unresolved external.
45 // This problem prevented to use our static debug library for C tests
46 // compiled with /MDd option (the library itself built with /MTd),
47 #undef _DEBUG
48 #define _DEBUG_TEMPORARILY_UNSET_
49 #endif
50 
51 #include <complex>
52 
53 template <typename type_lhs, typename type_rhs>
54 std::complex<type_lhs> __kmp_lhs_div_rhs(const std::complex<type_lhs> &lhs,
55                                          const std::complex<type_rhs> &rhs) {
56   type_lhs a = lhs.real();
57   type_lhs b = lhs.imag();
58   type_rhs c = rhs.real();
59   type_rhs d = rhs.imag();
60   type_rhs den = c * c + d * d;
61   type_rhs r = (a * c + b * d);
62   type_rhs i = (b * c - a * d);
63   std::complex<type_lhs> ret(r / den, i / den);
64   return ret;
65 }
66 
67 // complex8
68 struct __kmp_cmplx64_t : std::complex<double> {
69 
70   __kmp_cmplx64_t() : std::complex<double>() {}
71 
72   __kmp_cmplx64_t(const std::complex<double> &cd) : std::complex<double>(cd) {}
73 
74   void operator/=(const __kmp_cmplx64_t &rhs) {
75     std::complex<double> lhs = *this;
76     *this = __kmp_lhs_div_rhs(lhs, rhs);
77   }
78 
79   __kmp_cmplx64_t operator/(const __kmp_cmplx64_t &rhs) {
80     std::complex<double> lhs = *this;
81     return __kmp_lhs_div_rhs(lhs, rhs);
82   }
83 };
84 typedef struct __kmp_cmplx64_t kmp_cmplx64;
85 
86 // complex4
87 struct __kmp_cmplx32_t : std::complex<float> {
88 
89   __kmp_cmplx32_t() : std::complex<float>() {}
90 
91   __kmp_cmplx32_t(const std::complex<float> &cf) : std::complex<float>(cf) {}
92 
93   __kmp_cmplx32_t operator+(const __kmp_cmplx32_t &b) {
94     std::complex<float> lhs = *this;
95     std::complex<float> rhs = b;
96     return (lhs + rhs);
97   }
98   __kmp_cmplx32_t operator-(const __kmp_cmplx32_t &b) {
99     std::complex<float> lhs = *this;
100     std::complex<float> rhs = b;
101     return (lhs - rhs);
102   }
103   __kmp_cmplx32_t operator*(const __kmp_cmplx32_t &b) {
104     std::complex<float> lhs = *this;
105     std::complex<float> rhs = b;
106     return (lhs * rhs);
107   }
108 
109   __kmp_cmplx32_t operator+(const kmp_cmplx64 &b) {
110     kmp_cmplx64 t = kmp_cmplx64(*this) + b;
111     std::complex<double> d(t);
112     std::complex<float> f(d);
113     __kmp_cmplx32_t r(f);
114     return r;
115   }
116   __kmp_cmplx32_t operator-(const kmp_cmplx64 &b) {
117     kmp_cmplx64 t = kmp_cmplx64(*this) - b;
118     std::complex<double> d(t);
119     std::complex<float> f(d);
120     __kmp_cmplx32_t r(f);
121     return r;
122   }
123   __kmp_cmplx32_t operator*(const kmp_cmplx64 &b) {
124     kmp_cmplx64 t = kmp_cmplx64(*this) * b;
125     std::complex<double> d(t);
126     std::complex<float> f(d);
127     __kmp_cmplx32_t r(f);
128     return r;
129   }
130 
131   void operator/=(const __kmp_cmplx32_t &rhs) {
132     std::complex<float> lhs = *this;
133     *this = __kmp_lhs_div_rhs(lhs, rhs);
134   }
135 
136   __kmp_cmplx32_t operator/(const __kmp_cmplx32_t &rhs) {
137     std::complex<float> lhs = *this;
138     return __kmp_lhs_div_rhs(lhs, rhs);
139   }
140 
141   void operator/=(const kmp_cmplx64 &rhs) {
142     std::complex<float> lhs = *this;
143     *this = __kmp_lhs_div_rhs(lhs, rhs);
144   }
145 
146   __kmp_cmplx32_t operator/(const kmp_cmplx64 &rhs) {
147     std::complex<float> lhs = *this;
148     return __kmp_lhs_div_rhs(lhs, rhs);
149   }
150 };
151 typedef struct __kmp_cmplx32_t kmp_cmplx32;
152 
153 // complex10
154 struct KMP_DO_ALIGN(16) __kmp_cmplx80_t : std::complex<long double> {
155 
156   __kmp_cmplx80_t() : std::complex<long double>() {}
157 
158   __kmp_cmplx80_t(const std::complex<long double> &cld)
159       : std::complex<long double>(cld) {}
160 
161   void operator/=(const __kmp_cmplx80_t &rhs) {
162     std::complex<long double> lhs = *this;
163     *this = __kmp_lhs_div_rhs(lhs, rhs);
164   }
165 
166   __kmp_cmplx80_t operator/(const __kmp_cmplx80_t &rhs) {
167     std::complex<long double> lhs = *this;
168     return __kmp_lhs_div_rhs(lhs, rhs);
169   }
170 };
171 typedef KMP_DO_ALIGN(16) struct __kmp_cmplx80_t kmp_cmplx80;
172 
173 // complex16
174 #if KMP_HAVE_QUAD
175 struct __kmp_cmplx128_t : std::complex<_Quad> {
176 
177   __kmp_cmplx128_t() : std::complex<_Quad>() {}
178 
179   __kmp_cmplx128_t(const std::complex<_Quad> &cq) : std::complex<_Quad>(cq) {}
180 
181   void operator/=(const __kmp_cmplx128_t &rhs) {
182     std::complex<_Quad> lhs = *this;
183     *this = __kmp_lhs_div_rhs(lhs, rhs);
184   }
185 
186   __kmp_cmplx128_t operator/(const __kmp_cmplx128_t &rhs) {
187     std::complex<_Quad> lhs = *this;
188     return __kmp_lhs_div_rhs(lhs, rhs);
189   }
190 };
191 typedef struct __kmp_cmplx128_t kmp_cmplx128;
192 #endif /* KMP_HAVE_QUAD */
193 
194 #ifdef _DEBUG_TEMPORARILY_UNSET_
195 #undef _DEBUG_TEMPORARILY_UNSET_
196 // Set it back now
197 #define _DEBUG 1
198 #endif
199 
200 #else
201 // create shortcuts for c99 complex types
202 typedef float _Complex kmp_cmplx32;
203 typedef double _Complex kmp_cmplx64;
204 typedef long double _Complex kmp_cmplx80;
205 #if KMP_HAVE_QUAD
206 typedef _Quad _Complex kmp_cmplx128;
207 #endif
208 #endif
209 
210 // Compiler 12.0 changed alignment of 16 and 32-byte arguments (like _Quad
211 // and kmp_cmplx128) on IA-32 architecture. The following aligned structures
212 // are implemented to support the old alignment in 10.1, 11.0, 11.1 and
213 // introduce the new alignment in 12.0. See CQ88405.
214 #if KMP_ARCH_X86 && KMP_HAVE_QUAD
215 
216 // 4-byte aligned structures for backward compatibility.
217 
218 #pragma pack(push, 4)
219 
220 struct KMP_DO_ALIGN(4) Quad_a4_t {
221   _Quad q;
222 
223   Quad_a4_t() : q() {}
224   Quad_a4_t(const _Quad &cq) : q(cq) {}
225 
226   Quad_a4_t operator+(const Quad_a4_t &b) {
227     _Quad lhs = (*this).q;
228     _Quad rhs = b.q;
229     return (Quad_a4_t)(lhs + rhs);
230   }
231 
232   Quad_a4_t operator-(const Quad_a4_t &b) {
233     _Quad lhs = (*this).q;
234     _Quad rhs = b.q;
235     return (Quad_a4_t)(lhs - rhs);
236   }
237   Quad_a4_t operator*(const Quad_a4_t &b) {
238     _Quad lhs = (*this).q;
239     _Quad rhs = b.q;
240     return (Quad_a4_t)(lhs * rhs);
241   }
242 
243   Quad_a4_t operator/(const Quad_a4_t &b) {
244     _Quad lhs = (*this).q;
245     _Quad rhs = b.q;
246     return (Quad_a4_t)(lhs / rhs);
247   }
248 };
249 
250 struct KMP_DO_ALIGN(4) kmp_cmplx128_a4_t {
251   kmp_cmplx128 q;
252 
253   kmp_cmplx128_a4_t() : q() {}
254 
255   kmp_cmplx128_a4_t(const kmp_cmplx128 &c128) : q(c128) {}
256 
257   kmp_cmplx128_a4_t operator+(const kmp_cmplx128_a4_t &b) {
258     kmp_cmplx128 lhs = (*this).q;
259     kmp_cmplx128 rhs = b.q;
260     return (kmp_cmplx128_a4_t)(lhs + rhs);
261   }
262   kmp_cmplx128_a4_t operator-(const kmp_cmplx128_a4_t &b) {
263     kmp_cmplx128 lhs = (*this).q;
264     kmp_cmplx128 rhs = b.q;
265     return (kmp_cmplx128_a4_t)(lhs - rhs);
266   }
267   kmp_cmplx128_a4_t operator*(const kmp_cmplx128_a4_t &b) {
268     kmp_cmplx128 lhs = (*this).q;
269     kmp_cmplx128 rhs = b.q;
270     return (kmp_cmplx128_a4_t)(lhs * rhs);
271   }
272 
273   kmp_cmplx128_a4_t operator/(const kmp_cmplx128_a4_t &b) {
274     kmp_cmplx128 lhs = (*this).q;
275     kmp_cmplx128 rhs = b.q;
276     return (kmp_cmplx128_a4_t)(lhs / rhs);
277   }
278 };
279 
280 #pragma pack(pop)
281 
282 // New 16-byte aligned structures for 12.0 compiler.
283 struct KMP_DO_ALIGN(16) Quad_a16_t {
284   _Quad q;
285 
286   Quad_a16_t() : q() {}
287   Quad_a16_t(const _Quad &cq) : q(cq) {}
288 
289   Quad_a16_t operator+(const Quad_a16_t &b) {
290     _Quad lhs = (*this).q;
291     _Quad rhs = b.q;
292     return (Quad_a16_t)(lhs + rhs);
293   }
294 
295   Quad_a16_t operator-(const Quad_a16_t &b) {
296     _Quad lhs = (*this).q;
297     _Quad rhs = b.q;
298     return (Quad_a16_t)(lhs - rhs);
299   }
300   Quad_a16_t operator*(const Quad_a16_t &b) {
301     _Quad lhs = (*this).q;
302     _Quad rhs = b.q;
303     return (Quad_a16_t)(lhs * rhs);
304   }
305 
306   Quad_a16_t operator/(const Quad_a16_t &b) {
307     _Quad lhs = (*this).q;
308     _Quad rhs = b.q;
309     return (Quad_a16_t)(lhs / rhs);
310   }
311 };
312 
313 struct KMP_DO_ALIGN(16) kmp_cmplx128_a16_t {
314   kmp_cmplx128 q;
315 
316   kmp_cmplx128_a16_t() : q() {}
317 
318   kmp_cmplx128_a16_t(const kmp_cmplx128 &c128) : q(c128) {}
319 
320   kmp_cmplx128_a16_t operator+(const kmp_cmplx128_a16_t &b) {
321     kmp_cmplx128 lhs = (*this).q;
322     kmp_cmplx128 rhs = b.q;
323     return (kmp_cmplx128_a16_t)(lhs + rhs);
324   }
325   kmp_cmplx128_a16_t operator-(const kmp_cmplx128_a16_t &b) {
326     kmp_cmplx128 lhs = (*this).q;
327     kmp_cmplx128 rhs = b.q;
328     return (kmp_cmplx128_a16_t)(lhs - rhs);
329   }
330   kmp_cmplx128_a16_t operator*(const kmp_cmplx128_a16_t &b) {
331     kmp_cmplx128 lhs = (*this).q;
332     kmp_cmplx128 rhs = b.q;
333     return (kmp_cmplx128_a16_t)(lhs * rhs);
334   }
335 
336   kmp_cmplx128_a16_t operator/(const kmp_cmplx128_a16_t &b) {
337     kmp_cmplx128 lhs = (*this).q;
338     kmp_cmplx128 rhs = b.q;
339     return (kmp_cmplx128_a16_t)(lhs / rhs);
340   }
341 };
342 
343 #endif
344 
345 #if (KMP_ARCH_X86)
346 #define QUAD_LEGACY Quad_a4_t
347 #define CPLX128_LEG kmp_cmplx128_a4_t
348 #else
349 #define QUAD_LEGACY _Quad
350 #define CPLX128_LEG kmp_cmplx128
351 #endif
352 
353 #ifdef __cplusplus
354 extern "C" {
355 #endif
356 
357 extern int __kmp_atomic_mode;
358 
359 // Atomic locks can easily become contended, so we use queuing locks for them.
360 typedef kmp_queuing_lock_t kmp_atomic_lock_t;
361 
362 static inline void __kmp_acquire_atomic_lock(kmp_atomic_lock_t *lck,
363                                              kmp_int32 gtid) {
364 #if OMPT_SUPPORT && OMPT_OPTIONAL
365   if (ompt_enabled.ompt_callback_mutex_acquire) {
366     ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(
367         ompt_mutex_atomic, 0, kmp_mutex_impl_queuing, (ompt_wait_id_t)lck,
368         OMPT_GET_RETURN_ADDRESS(0));
369   }
370 #endif
371 
372   __kmp_acquire_queuing_lock(lck, gtid);
373 
374 #if OMPT_SUPPORT && OMPT_OPTIONAL
375   if (ompt_enabled.ompt_callback_mutex_acquired) {
376     ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(
377         ompt_mutex_atomic, (ompt_wait_id_t)lck, OMPT_GET_RETURN_ADDRESS(0));
378   }
379 #endif
380 }
381 
382 static inline int __kmp_test_atomic_lock(kmp_atomic_lock_t *lck,
383                                          kmp_int32 gtid) {
384   return __kmp_test_queuing_lock(lck, gtid);
385 }
386 
387 static inline void __kmp_release_atomic_lock(kmp_atomic_lock_t *lck,
388                                              kmp_int32 gtid) {
389   __kmp_release_queuing_lock(lck, gtid);
390 #if OMPT_SUPPORT && OMPT_OPTIONAL
391   if (ompt_enabled.ompt_callback_mutex_released) {
392     ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(
393         ompt_mutex_atomic, (ompt_wait_id_t)lck, OMPT_GET_RETURN_ADDRESS(0));
394   }
395 #endif
396 }
397 
398 static inline void __kmp_init_atomic_lock(kmp_atomic_lock_t *lck) {
399   __kmp_init_queuing_lock(lck);
400 }
401 
402 static inline void __kmp_destroy_atomic_lock(kmp_atomic_lock_t *lck) {
403   __kmp_destroy_queuing_lock(lck);
404 }
405 
406 // Global Locks
407 extern kmp_atomic_lock_t __kmp_atomic_lock; /* Control access to all user coded
408                                                atomics in Gnu compat mode   */
409 extern kmp_atomic_lock_t __kmp_atomic_lock_1i; /* Control access to all user
410                                                   coded atomics for 1-byte fixed
411                                                   data types */
412 extern kmp_atomic_lock_t __kmp_atomic_lock_2i; /* Control access to all user
413                                                   coded atomics for 2-byte fixed
414                                                   data types */
415 extern kmp_atomic_lock_t __kmp_atomic_lock_4i; /* Control access to all user
416                                                   coded atomics for 4-byte fixed
417                                                   data types */
418 extern kmp_atomic_lock_t __kmp_atomic_lock_4r; /* Control access to all user
419                                                   coded atomics for kmp_real32
420                                                   data type    */
421 extern kmp_atomic_lock_t __kmp_atomic_lock_8i; /* Control access to all user
422                                                   coded atomics for 8-byte fixed
423                                                   data types */
424 extern kmp_atomic_lock_t __kmp_atomic_lock_8r; /* Control access to all user
425                                                   coded atomics for kmp_real64
426                                                   data type    */
427 extern kmp_atomic_lock_t
428     __kmp_atomic_lock_8c; /* Control access to all user coded atomics for
429                              complex byte data type  */
430 extern kmp_atomic_lock_t
431     __kmp_atomic_lock_10r; /* Control access to all user coded atomics for long
432                               double data type   */
433 extern kmp_atomic_lock_t __kmp_atomic_lock_16r; /* Control access to all user
434                                                    coded atomics for _Quad data
435                                                    type         */
436 extern kmp_atomic_lock_t __kmp_atomic_lock_16c; /* Control access to all user
437                                                    coded atomics for double
438                                                    complex data type*/
439 extern kmp_atomic_lock_t
440     __kmp_atomic_lock_20c; /* Control access to all user coded atomics for long
441                               double complex type*/
442 extern kmp_atomic_lock_t __kmp_atomic_lock_32c; /* Control access to all user
443                                                    coded atomics for _Quad
444                                                    complex data type */
445 
446 //  Below routines for atomic UPDATE are listed
447 
448 // 1-byte
449 void __kmpc_atomic_fixed1_add(ident_t *id_ref, int gtid, char *lhs, char rhs);
450 void __kmpc_atomic_fixed1_andb(ident_t *id_ref, int gtid, char *lhs, char rhs);
451 void __kmpc_atomic_fixed1_div(ident_t *id_ref, int gtid, char *lhs, char rhs);
452 void __kmpc_atomic_fixed1u_div(ident_t *id_ref, int gtid, unsigned char *lhs,
453                                unsigned char rhs);
454 void __kmpc_atomic_fixed1_mul(ident_t *id_ref, int gtid, char *lhs, char rhs);
455 void __kmpc_atomic_fixed1_orb(ident_t *id_ref, int gtid, char *lhs, char rhs);
456 void __kmpc_atomic_fixed1_shl(ident_t *id_ref, int gtid, char *lhs, char rhs);
457 void __kmpc_atomic_fixed1_shr(ident_t *id_ref, int gtid, char *lhs, char rhs);
458 void __kmpc_atomic_fixed1u_shr(ident_t *id_ref, int gtid, unsigned char *lhs,
459                                unsigned char rhs);
460 void __kmpc_atomic_fixed1_sub(ident_t *id_ref, int gtid, char *lhs, char rhs);
461 void __kmpc_atomic_fixed1_xor(ident_t *id_ref, int gtid, char *lhs, char rhs);
462 // 2-byte
463 void __kmpc_atomic_fixed2_add(ident_t *id_ref, int gtid, short *lhs, short rhs);
464 void __kmpc_atomic_fixed2_andb(ident_t *id_ref, int gtid, short *lhs,
465                                short rhs);
466 void __kmpc_atomic_fixed2_div(ident_t *id_ref, int gtid, short *lhs, short rhs);
467 void __kmpc_atomic_fixed2u_div(ident_t *id_ref, int gtid, unsigned short *lhs,
468                                unsigned short rhs);
469 void __kmpc_atomic_fixed2_mul(ident_t *id_ref, int gtid, short *lhs, short rhs);
470 void __kmpc_atomic_fixed2_orb(ident_t *id_ref, int gtid, short *lhs, short rhs);
471 void __kmpc_atomic_fixed2_shl(ident_t *id_ref, int gtid, short *lhs, short rhs);
472 void __kmpc_atomic_fixed2_shr(ident_t *id_ref, int gtid, short *lhs, short rhs);
473 void __kmpc_atomic_fixed2u_shr(ident_t *id_ref, int gtid, unsigned short *lhs,
474                                unsigned short rhs);
475 void __kmpc_atomic_fixed2_sub(ident_t *id_ref, int gtid, short *lhs, short rhs);
476 void __kmpc_atomic_fixed2_xor(ident_t *id_ref, int gtid, short *lhs, short rhs);
477 // 4-byte add / sub fixed
478 void __kmpc_atomic_fixed4_add(ident_t *id_ref, int gtid, kmp_int32 *lhs,
479                               kmp_int32 rhs);
480 void __kmpc_atomic_fixed4_sub(ident_t *id_ref, int gtid, kmp_int32 *lhs,
481                               kmp_int32 rhs);
482 // 4-byte add / sub float
483 void __kmpc_atomic_float4_add(ident_t *id_ref, int gtid, kmp_real32 *lhs,
484                               kmp_real32 rhs);
485 void __kmpc_atomic_float4_sub(ident_t *id_ref, int gtid, kmp_real32 *lhs,
486                               kmp_real32 rhs);
487 // 8-byte add / sub fixed
488 void __kmpc_atomic_fixed8_add(ident_t *id_ref, int gtid, kmp_int64 *lhs,
489                               kmp_int64 rhs);
490 void __kmpc_atomic_fixed8_sub(ident_t *id_ref, int gtid, kmp_int64 *lhs,
491                               kmp_int64 rhs);
492 // 8-byte add / sub float
493 void __kmpc_atomic_float8_add(ident_t *id_ref, int gtid, kmp_real64 *lhs,
494                               kmp_real64 rhs);
495 void __kmpc_atomic_float8_sub(ident_t *id_ref, int gtid, kmp_real64 *lhs,
496                               kmp_real64 rhs);
497 // 4-byte fixed
498 void __kmpc_atomic_fixed4_andb(ident_t *id_ref, int gtid, kmp_int32 *lhs,
499                                kmp_int32 rhs);
500 void __kmpc_atomic_fixed4_div(ident_t *id_ref, int gtid, kmp_int32 *lhs,
501                               kmp_int32 rhs);
502 void __kmpc_atomic_fixed4u_div(ident_t *id_ref, int gtid, kmp_uint32 *lhs,
503                                kmp_uint32 rhs);
504 void __kmpc_atomic_fixed4_mul(ident_t *id_ref, int gtid, kmp_int32 *lhs,
505                               kmp_int32 rhs);
506 void __kmpc_atomic_fixed4_orb(ident_t *id_ref, int gtid, kmp_int32 *lhs,
507                               kmp_int32 rhs);
508 void __kmpc_atomic_fixed4_shl(ident_t *id_ref, int gtid, kmp_int32 *lhs,
509                               kmp_int32 rhs);
510 void __kmpc_atomic_fixed4_shr(ident_t *id_ref, int gtid, kmp_int32 *lhs,
511                               kmp_int32 rhs);
512 void __kmpc_atomic_fixed4u_shr(ident_t *id_ref, int gtid, kmp_uint32 *lhs,
513                                kmp_uint32 rhs);
514 void __kmpc_atomic_fixed4_xor(ident_t *id_ref, int gtid, kmp_int32 *lhs,
515                               kmp_int32 rhs);
516 // 8-byte fixed
517 void __kmpc_atomic_fixed8_andb(ident_t *id_ref, int gtid, kmp_int64 *lhs,
518                                kmp_int64 rhs);
519 void __kmpc_atomic_fixed8_div(ident_t *id_ref, int gtid, kmp_int64 *lhs,
520                               kmp_int64 rhs);
521 void __kmpc_atomic_fixed8u_div(ident_t *id_ref, int gtid, kmp_uint64 *lhs,
522                                kmp_uint64 rhs);
523 void __kmpc_atomic_fixed8_mul(ident_t *id_ref, int gtid, kmp_int64 *lhs,
524                               kmp_int64 rhs);
525 void __kmpc_atomic_fixed8_orb(ident_t *id_ref, int gtid, kmp_int64 *lhs,
526                               kmp_int64 rhs);
527 void __kmpc_atomic_fixed8_shl(ident_t *id_ref, int gtid, kmp_int64 *lhs,
528                               kmp_int64 rhs);
529 void __kmpc_atomic_fixed8_shr(ident_t *id_ref, int gtid, kmp_int64 *lhs,
530                               kmp_int64 rhs);
531 void __kmpc_atomic_fixed8u_shr(ident_t *id_ref, int gtid, kmp_uint64 *lhs,
532                                kmp_uint64 rhs);
533 void __kmpc_atomic_fixed8_xor(ident_t *id_ref, int gtid, kmp_int64 *lhs,
534                               kmp_int64 rhs);
535 // 4-byte float
536 void __kmpc_atomic_float4_div(ident_t *id_ref, int gtid, kmp_real32 *lhs,
537                               kmp_real32 rhs);
538 void __kmpc_atomic_float4_mul(ident_t *id_ref, int gtid, kmp_real32 *lhs,
539                               kmp_real32 rhs);
540 // 8-byte float
541 void __kmpc_atomic_float8_div(ident_t *id_ref, int gtid, kmp_real64 *lhs,
542                               kmp_real64 rhs);
543 void __kmpc_atomic_float8_mul(ident_t *id_ref, int gtid, kmp_real64 *lhs,
544                               kmp_real64 rhs);
545 // 1-, 2-, 4-, 8-byte logical (&&, ||)
546 void __kmpc_atomic_fixed1_andl(ident_t *id_ref, int gtid, char *lhs, char rhs);
547 void __kmpc_atomic_fixed1_orl(ident_t *id_ref, int gtid, char *lhs, char rhs);
548 void __kmpc_atomic_fixed2_andl(ident_t *id_ref, int gtid, short *lhs,
549                                short rhs);
550 void __kmpc_atomic_fixed2_orl(ident_t *id_ref, int gtid, short *lhs, short rhs);
551 void __kmpc_atomic_fixed4_andl(ident_t *id_ref, int gtid, kmp_int32 *lhs,
552                                kmp_int32 rhs);
553 void __kmpc_atomic_fixed4_orl(ident_t *id_ref, int gtid, kmp_int32 *lhs,
554                               kmp_int32 rhs);
555 void __kmpc_atomic_fixed8_andl(ident_t *id_ref, int gtid, kmp_int64 *lhs,
556                                kmp_int64 rhs);
557 void __kmpc_atomic_fixed8_orl(ident_t *id_ref, int gtid, kmp_int64 *lhs,
558                               kmp_int64 rhs);
559 // MIN / MAX
560 void __kmpc_atomic_fixed1_max(ident_t *id_ref, int gtid, char *lhs, char rhs);
561 void __kmpc_atomic_fixed1_min(ident_t *id_ref, int gtid, char *lhs, char rhs);
562 void __kmpc_atomic_fixed2_max(ident_t *id_ref, int gtid, short *lhs, short rhs);
563 void __kmpc_atomic_fixed2_min(ident_t *id_ref, int gtid, short *lhs, short rhs);
564 void __kmpc_atomic_fixed4_max(ident_t *id_ref, int gtid, kmp_int32 *lhs,
565                               kmp_int32 rhs);
566 void __kmpc_atomic_fixed4_min(ident_t *id_ref, int gtid, kmp_int32 *lhs,
567                               kmp_int32 rhs);
568 void __kmpc_atomic_fixed8_max(ident_t *id_ref, int gtid, kmp_int64 *lhs,
569                               kmp_int64 rhs);
570 void __kmpc_atomic_fixed8_min(ident_t *id_ref, int gtid, kmp_int64 *lhs,
571                               kmp_int64 rhs);
572 void __kmpc_atomic_float4_max(ident_t *id_ref, int gtid, kmp_real32 *lhs,
573                               kmp_real32 rhs);
574 void __kmpc_atomic_float4_min(ident_t *id_ref, int gtid, kmp_real32 *lhs,
575                               kmp_real32 rhs);
576 void __kmpc_atomic_float8_max(ident_t *id_ref, int gtid, kmp_real64 *lhs,
577                               kmp_real64 rhs);
578 void __kmpc_atomic_float8_min(ident_t *id_ref, int gtid, kmp_real64 *lhs,
579                               kmp_real64 rhs);
580 #if KMP_HAVE_QUAD
581 void __kmpc_atomic_float16_max(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,
582                                QUAD_LEGACY rhs);
583 void __kmpc_atomic_float16_min(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,
584                                QUAD_LEGACY rhs);
585 #if (KMP_ARCH_X86)
586 // Routines with 16-byte arguments aligned to 16-byte boundary; IA-32
587 // architecture only
588 void __kmpc_atomic_float16_max_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,
589                                    Quad_a16_t rhs);
590 void __kmpc_atomic_float16_min_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,
591                                    Quad_a16_t rhs);
592 #endif
593 #endif
594 // .NEQV. (same as xor)
595 void __kmpc_atomic_fixed1_neqv(ident_t *id_ref, int gtid, char *lhs, char rhs);
596 void __kmpc_atomic_fixed2_neqv(ident_t *id_ref, int gtid, short *lhs,
597                                short rhs);
598 void __kmpc_atomic_fixed4_neqv(ident_t *id_ref, int gtid, kmp_int32 *lhs,
599                                kmp_int32 rhs);
600 void __kmpc_atomic_fixed8_neqv(ident_t *id_ref, int gtid, kmp_int64 *lhs,
601                                kmp_int64 rhs);
602 // .EQV. (same as ~xor)
603 void __kmpc_atomic_fixed1_eqv(ident_t *id_ref, int gtid, char *lhs, char rhs);
604 void __kmpc_atomic_fixed2_eqv(ident_t *id_ref, int gtid, short *lhs, short rhs);
605 void __kmpc_atomic_fixed4_eqv(ident_t *id_ref, int gtid, kmp_int32 *lhs,
606                               kmp_int32 rhs);
607 void __kmpc_atomic_fixed8_eqv(ident_t *id_ref, int gtid, kmp_int64 *lhs,
608                               kmp_int64 rhs);
609 // long double type
610 void __kmpc_atomic_float10_add(ident_t *id_ref, int gtid, long double *lhs,
611                                long double rhs);
612 void __kmpc_atomic_float10_sub(ident_t *id_ref, int gtid, long double *lhs,
613                                long double rhs);
614 void __kmpc_atomic_float10_mul(ident_t *id_ref, int gtid, long double *lhs,
615                                long double rhs);
616 void __kmpc_atomic_float10_div(ident_t *id_ref, int gtid, long double *lhs,
617                                long double rhs);
618 // _Quad type
619 #if KMP_HAVE_QUAD
620 void __kmpc_atomic_float16_add(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,
621                                QUAD_LEGACY rhs);
622 void __kmpc_atomic_float16_sub(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,
623                                QUAD_LEGACY rhs);
624 void __kmpc_atomic_float16_mul(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,
625                                QUAD_LEGACY rhs);
626 void __kmpc_atomic_float16_div(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,
627                                QUAD_LEGACY rhs);
628 #if (KMP_ARCH_X86)
629 // Routines with 16-byte arguments aligned to 16-byte boundary
630 void __kmpc_atomic_float16_add_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,
631                                    Quad_a16_t rhs);
632 void __kmpc_atomic_float16_sub_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,
633                                    Quad_a16_t rhs);
634 void __kmpc_atomic_float16_mul_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,
635                                    Quad_a16_t rhs);
636 void __kmpc_atomic_float16_div_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,
637                                    Quad_a16_t rhs);
638 #endif
639 #endif
640 // routines for complex types
641 void __kmpc_atomic_cmplx4_add(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
642                               kmp_cmplx32 rhs);
643 void __kmpc_atomic_cmplx4_sub(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
644                               kmp_cmplx32 rhs);
645 void __kmpc_atomic_cmplx4_mul(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
646                               kmp_cmplx32 rhs);
647 void __kmpc_atomic_cmplx4_div(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
648                               kmp_cmplx32 rhs);
649 void __kmpc_atomic_cmplx8_add(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,
650                               kmp_cmplx64 rhs);
651 void __kmpc_atomic_cmplx8_sub(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,
652                               kmp_cmplx64 rhs);
653 void __kmpc_atomic_cmplx8_mul(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,
654                               kmp_cmplx64 rhs);
655 void __kmpc_atomic_cmplx8_div(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,
656                               kmp_cmplx64 rhs);
657 void __kmpc_atomic_cmplx10_add(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,
658                                kmp_cmplx80 rhs);
659 void __kmpc_atomic_cmplx10_sub(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,
660                                kmp_cmplx80 rhs);
661 void __kmpc_atomic_cmplx10_mul(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,
662                                kmp_cmplx80 rhs);
663 void __kmpc_atomic_cmplx10_div(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,
664                                kmp_cmplx80 rhs);
665 #if KMP_HAVE_QUAD
666 void __kmpc_atomic_cmplx16_add(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,
667                                CPLX128_LEG rhs);
668 void __kmpc_atomic_cmplx16_sub(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,
669                                CPLX128_LEG rhs);
670 void __kmpc_atomic_cmplx16_mul(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,
671                                CPLX128_LEG rhs);
672 void __kmpc_atomic_cmplx16_div(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,
673                                CPLX128_LEG rhs);
674 #if (KMP_ARCH_X86)
675 // Routines with 16-byte arguments aligned to 16-byte boundary
676 void __kmpc_atomic_cmplx16_add_a16(ident_t *id_ref, int gtid,
677                                    kmp_cmplx128_a16_t *lhs,
678                                    kmp_cmplx128_a16_t rhs);
679 void __kmpc_atomic_cmplx16_sub_a16(ident_t *id_ref, int gtid,
680                                    kmp_cmplx128_a16_t *lhs,
681                                    kmp_cmplx128_a16_t rhs);
682 void __kmpc_atomic_cmplx16_mul_a16(ident_t *id_ref, int gtid,
683                                    kmp_cmplx128_a16_t *lhs,
684                                    kmp_cmplx128_a16_t rhs);
685 void __kmpc_atomic_cmplx16_div_a16(ident_t *id_ref, int gtid,
686                                    kmp_cmplx128_a16_t *lhs,
687                                    kmp_cmplx128_a16_t rhs);
688 #endif
689 #endif
690 
691 #if OMP_40_ENABLED
692 
693 // OpenMP 4.0: x = expr binop x for non-commutative operations.
694 // Supported only on IA-32 architecture and Intel(R) 64
695 #if KMP_ARCH_X86 || KMP_ARCH_X86_64
696 
697 void __kmpc_atomic_fixed1_sub_rev(ident_t *id_ref, int gtid, char *lhs,
698                                   char rhs);
699 void __kmpc_atomic_fixed1_div_rev(ident_t *id_ref, int gtid, char *lhs,
700                                   char rhs);
701 void __kmpc_atomic_fixed1u_div_rev(ident_t *id_ref, int gtid,
702                                    unsigned char *lhs, unsigned char rhs);
703 void __kmpc_atomic_fixed1_shl_rev(ident_t *id_ref, int gtid, char *lhs,
704                                   char rhs);
705 void __kmpc_atomic_fixed1_shr_rev(ident_t *id_ref, int gtid, char *lhs,
706                                   char rhs);
707 void __kmpc_atomic_fixed1u_shr_rev(ident_t *id_ref, int gtid,
708                                    unsigned char *lhs, unsigned char rhs);
709 void __kmpc_atomic_fixed2_sub_rev(ident_t *id_ref, int gtid, short *lhs,
710                                   short rhs);
711 void __kmpc_atomic_fixed2_div_rev(ident_t *id_ref, int gtid, short *lhs,
712                                   short rhs);
713 void __kmpc_atomic_fixed2u_div_rev(ident_t *id_ref, int gtid,
714                                    unsigned short *lhs, unsigned short rhs);
715 void __kmpc_atomic_fixed2_shl_rev(ident_t *id_ref, int gtid, short *lhs,
716                                   short rhs);
717 void __kmpc_atomic_fixed2_shr_rev(ident_t *id_ref, int gtid, short *lhs,
718                                   short rhs);
719 void __kmpc_atomic_fixed2u_shr_rev(ident_t *id_ref, int gtid,
720                                    unsigned short *lhs, unsigned short rhs);
721 void __kmpc_atomic_fixed4_sub_rev(ident_t *id_ref, int gtid, kmp_int32 *lhs,
722                                   kmp_int32 rhs);
723 void __kmpc_atomic_fixed4_div_rev(ident_t *id_ref, int gtid, kmp_int32 *lhs,
724                                   kmp_int32 rhs);
725 void __kmpc_atomic_fixed4u_div_rev(ident_t *id_ref, int gtid, kmp_uint32 *lhs,
726                                    kmp_uint32 rhs);
727 void __kmpc_atomic_fixed4_shl_rev(ident_t *id_ref, int gtid, kmp_int32 *lhs,
728                                   kmp_int32 rhs);
729 void __kmpc_atomic_fixed4_shr_rev(ident_t *id_ref, int gtid, kmp_int32 *lhs,
730                                   kmp_int32 rhs);
731 void __kmpc_atomic_fixed4u_shr_rev(ident_t *id_ref, int gtid, kmp_uint32 *lhs,
732                                    kmp_uint32 rhs);
733 void __kmpc_atomic_fixed8_sub_rev(ident_t *id_ref, int gtid, kmp_int64 *lhs,
734                                   kmp_int64 rhs);
735 void __kmpc_atomic_fixed8_div_rev(ident_t *id_ref, int gtid, kmp_int64 *lhs,
736                                   kmp_int64 rhs);
737 void __kmpc_atomic_fixed8u_div_rev(ident_t *id_ref, int gtid, kmp_uint64 *lhs,
738                                    kmp_uint64 rhs);
739 void __kmpc_atomic_fixed8_shl_rev(ident_t *id_ref, int gtid, kmp_int64 *lhs,
740                                   kmp_int64 rhs);
741 void __kmpc_atomic_fixed8_shr_rev(ident_t *id_ref, int gtid, kmp_int64 *lhs,
742                                   kmp_int64 rhs);
743 void __kmpc_atomic_fixed8u_shr_rev(ident_t *id_ref, int gtid, kmp_uint64 *lhs,
744                                    kmp_uint64 rhs);
745 void __kmpc_atomic_float4_sub_rev(ident_t *id_ref, int gtid, float *lhs,
746                                   float rhs);
747 void __kmpc_atomic_float4_div_rev(ident_t *id_ref, int gtid, float *lhs,
748                                   float rhs);
749 void __kmpc_atomic_float8_sub_rev(ident_t *id_ref, int gtid, double *lhs,
750                                   double rhs);
751 void __kmpc_atomic_float8_div_rev(ident_t *id_ref, int gtid, double *lhs,
752                                   double rhs);
753 void __kmpc_atomic_float10_sub_rev(ident_t *id_ref, int gtid, long double *lhs,
754                                    long double rhs);
755 void __kmpc_atomic_float10_div_rev(ident_t *id_ref, int gtid, long double *lhs,
756                                    long double rhs);
757 #if KMP_HAVE_QUAD
758 void __kmpc_atomic_float16_sub_rev(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,
759                                    QUAD_LEGACY rhs);
760 void __kmpc_atomic_float16_div_rev(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,
761                                    QUAD_LEGACY rhs);
762 #endif
763 void __kmpc_atomic_cmplx4_sub_rev(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
764                                   kmp_cmplx32 rhs);
765 void __kmpc_atomic_cmplx4_div_rev(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
766                                   kmp_cmplx32 rhs);
767 void __kmpc_atomic_cmplx8_sub_rev(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,
768                                   kmp_cmplx64 rhs);
769 void __kmpc_atomic_cmplx8_div_rev(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,
770                                   kmp_cmplx64 rhs);
771 void __kmpc_atomic_cmplx10_sub_rev(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,
772                                    kmp_cmplx80 rhs);
773 void __kmpc_atomic_cmplx10_div_rev(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,
774                                    kmp_cmplx80 rhs);
775 #if KMP_HAVE_QUAD
776 void __kmpc_atomic_cmplx16_sub_rev(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,
777                                    CPLX128_LEG rhs);
778 void __kmpc_atomic_cmplx16_div_rev(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,
779                                    CPLX128_LEG rhs);
780 #if (KMP_ARCH_X86)
781 // Routines with 16-byte arguments aligned to 16-byte boundary
782 void __kmpc_atomic_float16_sub_a16_rev(ident_t *id_ref, int gtid,
783                                        Quad_a16_t *lhs, Quad_a16_t rhs);
784 void __kmpc_atomic_float16_div_a16_rev(ident_t *id_ref, int gtid,
785                                        Quad_a16_t *lhs, Quad_a16_t rhs);
786 void __kmpc_atomic_cmplx16_sub_a16_rev(ident_t *id_ref, int gtid,
787                                        kmp_cmplx128_a16_t *lhs,
788                                        kmp_cmplx128_a16_t rhs);
789 void __kmpc_atomic_cmplx16_div_a16_rev(ident_t *id_ref, int gtid,
790                                        kmp_cmplx128_a16_t *lhs,
791                                        kmp_cmplx128_a16_t rhs);
792 #endif
793 #endif // KMP_HAVE_QUAD
794 
795 #endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
796 
797 #endif // OMP_40_ENABLED
798 
799 // routines for mixed types
800 
801 // RHS=float8
802 void __kmpc_atomic_fixed1_mul_float8(ident_t *id_ref, int gtid, char *lhs,
803                                      kmp_real64 rhs);
804 void __kmpc_atomic_fixed1_div_float8(ident_t *id_ref, int gtid, char *lhs,
805                                      kmp_real64 rhs);
806 void __kmpc_atomic_fixed2_mul_float8(ident_t *id_ref, int gtid, short *lhs,
807                                      kmp_real64 rhs);
808 void __kmpc_atomic_fixed2_div_float8(ident_t *id_ref, int gtid, short *lhs,
809                                      kmp_real64 rhs);
810 void __kmpc_atomic_fixed4_mul_float8(ident_t *id_ref, int gtid, kmp_int32 *lhs,
811                                      kmp_real64 rhs);
812 void __kmpc_atomic_fixed4_div_float8(ident_t *id_ref, int gtid, kmp_int32 *lhs,
813                                      kmp_real64 rhs);
814 void __kmpc_atomic_fixed8_mul_float8(ident_t *id_ref, int gtid, kmp_int64 *lhs,
815                                      kmp_real64 rhs);
816 void __kmpc_atomic_fixed8_div_float8(ident_t *id_ref, int gtid, kmp_int64 *lhs,
817                                      kmp_real64 rhs);
818 void __kmpc_atomic_float4_add_float8(ident_t *id_ref, int gtid, kmp_real32 *lhs,
819                                      kmp_real64 rhs);
820 void __kmpc_atomic_float4_sub_float8(ident_t *id_ref, int gtid, kmp_real32 *lhs,
821                                      kmp_real64 rhs);
822 void __kmpc_atomic_float4_mul_float8(ident_t *id_ref, int gtid, kmp_real32 *lhs,
823                                      kmp_real64 rhs);
824 void __kmpc_atomic_float4_div_float8(ident_t *id_ref, int gtid, kmp_real32 *lhs,
825                                      kmp_real64 rhs);
826 
827 // RHS=float16 (deprecated, to be removed when we are sure the compiler does not
828 // use them)
829 #if KMP_HAVE_QUAD
830 void __kmpc_atomic_fixed1_add_fp(ident_t *id_ref, int gtid, char *lhs,
831                                  _Quad rhs);
832 void __kmpc_atomic_fixed1u_add_fp(ident_t *id_ref, int gtid, unsigned char *lhs,
833                                   _Quad rhs);
834 void __kmpc_atomic_fixed1_sub_fp(ident_t *id_ref, int gtid, char *lhs,
835                                  _Quad rhs);
836 void __kmpc_atomic_fixed1u_sub_fp(ident_t *id_ref, int gtid, unsigned char *lhs,
837                                   _Quad rhs);
838 void __kmpc_atomic_fixed1_mul_fp(ident_t *id_ref, int gtid, char *lhs,
839                                  _Quad rhs);
840 void __kmpc_atomic_fixed1u_mul_fp(ident_t *id_ref, int gtid, unsigned char *lhs,
841                                   _Quad rhs);
842 void __kmpc_atomic_fixed1_div_fp(ident_t *id_ref, int gtid, char *lhs,
843                                  _Quad rhs);
844 void __kmpc_atomic_fixed1u_div_fp(ident_t *id_ref, int gtid, unsigned char *lhs,
845                                   _Quad rhs);
846 
847 void __kmpc_atomic_fixed2_add_fp(ident_t *id_ref, int gtid, short *lhs,
848                                  _Quad rhs);
849 void __kmpc_atomic_fixed2u_add_fp(ident_t *id_ref, int gtid,
850                                   unsigned short *lhs, _Quad rhs);
851 void __kmpc_atomic_fixed2_sub_fp(ident_t *id_ref, int gtid, short *lhs,
852                                  _Quad rhs);
853 void __kmpc_atomic_fixed2u_sub_fp(ident_t *id_ref, int gtid,
854                                   unsigned short *lhs, _Quad rhs);
855 void __kmpc_atomic_fixed2_mul_fp(ident_t *id_ref, int gtid, short *lhs,
856                                  _Quad rhs);
857 void __kmpc_atomic_fixed2u_mul_fp(ident_t *id_ref, int gtid,
858                                   unsigned short *lhs, _Quad rhs);
859 void __kmpc_atomic_fixed2_div_fp(ident_t *id_ref, int gtid, short *lhs,
860                                  _Quad rhs);
861 void __kmpc_atomic_fixed2u_div_fp(ident_t *id_ref, int gtid,
862                                   unsigned short *lhs, _Quad rhs);
863 
864 void __kmpc_atomic_fixed4_add_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,
865                                  _Quad rhs);
866 void __kmpc_atomic_fixed4u_add_fp(ident_t *id_ref, int gtid, kmp_uint32 *lhs,
867                                   _Quad rhs);
868 void __kmpc_atomic_fixed4_sub_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,
869                                  _Quad rhs);
870 void __kmpc_atomic_fixed4u_sub_fp(ident_t *id_ref, int gtid, kmp_uint32 *lhs,
871                                   _Quad rhs);
872 void __kmpc_atomic_fixed4_mul_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,
873                                  _Quad rhs);
874 void __kmpc_atomic_fixed4u_mul_fp(ident_t *id_ref, int gtid, kmp_uint32 *lhs,
875                                   _Quad rhs);
876 void __kmpc_atomic_fixed4_div_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,
877                                  _Quad rhs);
878 void __kmpc_atomic_fixed4u_div_fp(ident_t *id_ref, int gtid, kmp_uint32 *lhs,
879                                   _Quad rhs);
880 
881 void __kmpc_atomic_fixed8_add_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,
882                                  _Quad rhs);
883 void __kmpc_atomic_fixed8u_add_fp(ident_t *id_ref, int gtid, kmp_uint64 *lhs,
884                                   _Quad rhs);
885 void __kmpc_atomic_fixed8_sub_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,
886                                  _Quad rhs);
887 void __kmpc_atomic_fixed8u_sub_fp(ident_t *id_ref, int gtid, kmp_uint64 *lhs,
888                                   _Quad rhs);
889 void __kmpc_atomic_fixed8_mul_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,
890                                  _Quad rhs);
891 void __kmpc_atomic_fixed8u_mul_fp(ident_t *id_ref, int gtid, kmp_uint64 *lhs,
892                                   _Quad rhs);
893 void __kmpc_atomic_fixed8_div_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,
894                                  _Quad rhs);
895 void __kmpc_atomic_fixed8u_div_fp(ident_t *id_ref, int gtid, kmp_uint64 *lhs,
896                                   _Quad rhs);
897 
898 void __kmpc_atomic_float4_add_fp(ident_t *id_ref, int gtid, kmp_real32 *lhs,
899                                  _Quad rhs);
900 void __kmpc_atomic_float4_sub_fp(ident_t *id_ref, int gtid, kmp_real32 *lhs,
901                                  _Quad rhs);
902 void __kmpc_atomic_float4_mul_fp(ident_t *id_ref, int gtid, kmp_real32 *lhs,
903                                  _Quad rhs);
904 void __kmpc_atomic_float4_div_fp(ident_t *id_ref, int gtid, kmp_real32 *lhs,
905                                  _Quad rhs);
906 
907 void __kmpc_atomic_float8_add_fp(ident_t *id_ref, int gtid, kmp_real64 *lhs,
908                                  _Quad rhs);
909 void __kmpc_atomic_float8_sub_fp(ident_t *id_ref, int gtid, kmp_real64 *lhs,
910                                  _Quad rhs);
911 void __kmpc_atomic_float8_mul_fp(ident_t *id_ref, int gtid, kmp_real64 *lhs,
912                                  _Quad rhs);
913 void __kmpc_atomic_float8_div_fp(ident_t *id_ref, int gtid, kmp_real64 *lhs,
914                                  _Quad rhs);
915 
916 void __kmpc_atomic_float10_add_fp(ident_t *id_ref, int gtid, long double *lhs,
917                                   _Quad rhs);
918 void __kmpc_atomic_float10_sub_fp(ident_t *id_ref, int gtid, long double *lhs,
919                                   _Quad rhs);
920 void __kmpc_atomic_float10_mul_fp(ident_t *id_ref, int gtid, long double *lhs,
921                                   _Quad rhs);
922 void __kmpc_atomic_float10_div_fp(ident_t *id_ref, int gtid, long double *lhs,
923                                   _Quad rhs);
924 
925 // Reverse operations
926 void __kmpc_atomic_fixed1_sub_rev_fp(ident_t *id_ref, int gtid, char *lhs,
927                                      _Quad rhs);
928 void __kmpc_atomic_fixed1u_sub_rev_fp(ident_t *id_ref, int gtid,
929                                       unsigned char *lhs, _Quad rhs);
930 void __kmpc_atomic_fixed1_div_rev_fp(ident_t *id_ref, int gtid, char *lhs,
931                                      _Quad rhs);
932 void __kmpc_atomic_fixed1u_div_rev_fp(ident_t *id_ref, int gtid,
933                                       unsigned char *lhs, _Quad rhs);
934 void __kmpc_atomic_fixed2_sub_rev_fp(ident_t *id_ref, int gtid, short *lhs,
935                                      _Quad rhs);
936 void __kmpc_atomic_fixed2u_sub_rev_fp(ident_t *id_ref, int gtid,
937                                       unsigned short *lhs, _Quad rhs);
938 void __kmpc_atomic_fixed2_div_rev_fp(ident_t *id_ref, int gtid, short *lhs,
939                                      _Quad rhs);
940 void __kmpc_atomic_fixed2u_div_rev_fp(ident_t *id_ref, int gtid,
941                                       unsigned short *lhs, _Quad rhs);
942 void __kmpc_atomic_fixed4_sub_rev_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,
943                                      _Quad rhs);
944 void __kmpc_atomic_fixed4u_sub_rev_fp(ident_t *id_ref, int gtid,
945                                       kmp_uint32 *lhs, _Quad rhs);
946 void __kmpc_atomic_fixed4_div_rev_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,
947                                      _Quad rhs);
948 void __kmpc_atomic_fixed4u_div_rev_fp(ident_t *id_ref, int gtid,
949                                       kmp_uint32 *lhs, _Quad rhs);
950 void __kmpc_atomic_fixed8_sub_rev_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,
951                                      _Quad rhs);
952 void __kmpc_atomic_fixed8u_sub_rev_fp(ident_t *id_ref, int gtid,
953                                       kmp_uint64 *lhs, _Quad rhs);
954 void __kmpc_atomic_fixed8_div_rev_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,
955                                      _Quad rhs);
956 void __kmpc_atomic_fixed8u_div_rev_fp(ident_t *id_ref, int gtid,
957                                       kmp_uint64 *lhs, _Quad rhs);
958 void __kmpc_atomic_float4_sub_rev_fp(ident_t *id_ref, int gtid, float *lhs,
959                                      _Quad rhs);
960 void __kmpc_atomic_float4_div_rev_fp(ident_t *id_ref, int gtid, float *lhs,
961                                      _Quad rhs);
962 void __kmpc_atomic_float8_sub_rev_fp(ident_t *id_ref, int gtid, double *lhs,
963                                      _Quad rhs);
964 void __kmpc_atomic_float8_div_rev_fp(ident_t *id_ref, int gtid, double *lhs,
965                                      _Quad rhs);
966 void __kmpc_atomic_float10_sub_rev_fp(ident_t *id_ref, int gtid,
967                                       long double *lhs, _Quad rhs);
968 void __kmpc_atomic_float10_div_rev_fp(ident_t *id_ref, int gtid,
969                                       long double *lhs, _Quad rhs);
970 
971 #endif // KMP_HAVE_QUAD
972 
973 // RHS=cmplx8
974 void __kmpc_atomic_cmplx4_add_cmplx8(ident_t *id_ref, int gtid,
975                                      kmp_cmplx32 *lhs, kmp_cmplx64 rhs);
976 void __kmpc_atomic_cmplx4_sub_cmplx8(ident_t *id_ref, int gtid,
977                                      kmp_cmplx32 *lhs, kmp_cmplx64 rhs);
978 void __kmpc_atomic_cmplx4_mul_cmplx8(ident_t *id_ref, int gtid,
979                                      kmp_cmplx32 *lhs, kmp_cmplx64 rhs);
980 void __kmpc_atomic_cmplx4_div_cmplx8(ident_t *id_ref, int gtid,
981                                      kmp_cmplx32 *lhs, kmp_cmplx64 rhs);
982 
983 // generic atomic routines
984 void __kmpc_atomic_1(ident_t *id_ref, int gtid, void *lhs, void *rhs,
985                      void (*f)(void *, void *, void *));
986 void __kmpc_atomic_2(ident_t *id_ref, int gtid, void *lhs, void *rhs,
987                      void (*f)(void *, void *, void *));
988 void __kmpc_atomic_4(ident_t *id_ref, int gtid, void *lhs, void *rhs,
989                      void (*f)(void *, void *, void *));
990 void __kmpc_atomic_8(ident_t *id_ref, int gtid, void *lhs, void *rhs,
991                      void (*f)(void *, void *, void *));
992 void __kmpc_atomic_10(ident_t *id_ref, int gtid, void *lhs, void *rhs,
993                       void (*f)(void *, void *, void *));
994 void __kmpc_atomic_16(ident_t *id_ref, int gtid, void *lhs, void *rhs,
995                       void (*f)(void *, void *, void *));
996 void __kmpc_atomic_20(ident_t *id_ref, int gtid, void *lhs, void *rhs,
997                       void (*f)(void *, void *, void *));
998 void __kmpc_atomic_32(ident_t *id_ref, int gtid, void *lhs, void *rhs,
999                       void (*f)(void *, void *, void *));
1000 
1001 // READ, WRITE, CAPTURE are supported only on IA-32 architecture and Intel(R) 64
1002 #if KMP_ARCH_X86 || KMP_ARCH_X86_64
1003 
1004 //  Below routines for atomic READ are listed
1005 char __kmpc_atomic_fixed1_rd(ident_t *id_ref, int gtid, char *loc);
1006 short __kmpc_atomic_fixed2_rd(ident_t *id_ref, int gtid, short *loc);
1007 kmp_int32 __kmpc_atomic_fixed4_rd(ident_t *id_ref, int gtid, kmp_int32 *loc);
1008 kmp_int64 __kmpc_atomic_fixed8_rd(ident_t *id_ref, int gtid, kmp_int64 *loc);
1009 kmp_real32 __kmpc_atomic_float4_rd(ident_t *id_ref, int gtid, kmp_real32 *loc);
1010 kmp_real64 __kmpc_atomic_float8_rd(ident_t *id_ref, int gtid, kmp_real64 *loc);
1011 long double __kmpc_atomic_float10_rd(ident_t *id_ref, int gtid,
1012                                      long double *loc);
1013 #if KMP_HAVE_QUAD
1014 QUAD_LEGACY __kmpc_atomic_float16_rd(ident_t *id_ref, int gtid,
1015                                      QUAD_LEGACY *loc);
1016 #endif
1017 // Fix for CQ220361: cmplx4 READ will return void on Windows* OS; read value
1018 // will be returned through an additional parameter
1019 #if (KMP_OS_WINDOWS)
1020 void __kmpc_atomic_cmplx4_rd(kmp_cmplx32 *out, ident_t *id_ref, int gtid,
1021                              kmp_cmplx32 *loc);
1022 #else
1023 kmp_cmplx32 __kmpc_atomic_cmplx4_rd(ident_t *id_ref, int gtid,
1024                                     kmp_cmplx32 *loc);
1025 #endif
1026 kmp_cmplx64 __kmpc_atomic_cmplx8_rd(ident_t *id_ref, int gtid,
1027                                     kmp_cmplx64 *loc);
1028 kmp_cmplx80 __kmpc_atomic_cmplx10_rd(ident_t *id_ref, int gtid,
1029                                      kmp_cmplx80 *loc);
1030 #if KMP_HAVE_QUAD
1031 CPLX128_LEG __kmpc_atomic_cmplx16_rd(ident_t *id_ref, int gtid,
1032                                      CPLX128_LEG *loc);
1033 #if (KMP_ARCH_X86)
1034 // Routines with 16-byte arguments aligned to 16-byte boundary
1035 Quad_a16_t __kmpc_atomic_float16_a16_rd(ident_t *id_ref, int gtid,
1036                                         Quad_a16_t *loc);
1037 kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_a16_rd(ident_t *id_ref, int gtid,
1038                                                 kmp_cmplx128_a16_t *loc);
1039 #endif
1040 #endif
1041 
1042 //  Below routines for atomic WRITE are listed
1043 void __kmpc_atomic_fixed1_wr(ident_t *id_ref, int gtid, char *lhs, char rhs);
1044 void __kmpc_atomic_fixed2_wr(ident_t *id_ref, int gtid, short *lhs, short rhs);
1045 void __kmpc_atomic_fixed4_wr(ident_t *id_ref, int gtid, kmp_int32 *lhs,
1046                              kmp_int32 rhs);
1047 void __kmpc_atomic_fixed8_wr(ident_t *id_ref, int gtid, kmp_int64 *lhs,
1048                              kmp_int64 rhs);
1049 void __kmpc_atomic_float4_wr(ident_t *id_ref, int gtid, kmp_real32 *lhs,
1050                              kmp_real32 rhs);
1051 void __kmpc_atomic_float8_wr(ident_t *id_ref, int gtid, kmp_real64 *lhs,
1052                              kmp_real64 rhs);
1053 void __kmpc_atomic_float10_wr(ident_t *id_ref, int gtid, long double *lhs,
1054                               long double rhs);
1055 #if KMP_HAVE_QUAD
1056 void __kmpc_atomic_float16_wr(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,
1057                               QUAD_LEGACY rhs);
1058 #endif
1059 void __kmpc_atomic_cmplx4_wr(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
1060                              kmp_cmplx32 rhs);
1061 void __kmpc_atomic_cmplx8_wr(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,
1062                              kmp_cmplx64 rhs);
1063 void __kmpc_atomic_cmplx10_wr(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,
1064                               kmp_cmplx80 rhs);
1065 #if KMP_HAVE_QUAD
1066 void __kmpc_atomic_cmplx16_wr(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,
1067                               CPLX128_LEG rhs);
1068 #if (KMP_ARCH_X86)
1069 // Routines with 16-byte arguments aligned to 16-byte boundary
1070 void __kmpc_atomic_float16_a16_wr(ident_t *id_ref, int gtid, Quad_a16_t *lhs,
1071                                   Quad_a16_t rhs);
1072 void __kmpc_atomic_cmplx16_a16_wr(ident_t *id_ref, int gtid,
1073                                   kmp_cmplx128_a16_t *lhs,
1074                                   kmp_cmplx128_a16_t rhs);
1075 #endif
1076 #endif
1077 
1078 //  Below routines for atomic CAPTURE are listed
1079 
1080 // 1-byte
1081 char __kmpc_atomic_fixed1_add_cpt(ident_t *id_ref, int gtid, char *lhs,
1082                                   char rhs, int flag);
1083 char __kmpc_atomic_fixed1_andb_cpt(ident_t *id_ref, int gtid, char *lhs,
1084                                    char rhs, int flag);
1085 char __kmpc_atomic_fixed1_div_cpt(ident_t *id_ref, int gtid, char *lhs,
1086                                   char rhs, int flag);
1087 unsigned char __kmpc_atomic_fixed1u_div_cpt(ident_t *id_ref, int gtid,
1088                                             unsigned char *lhs,
1089                                             unsigned char rhs, int flag);
1090 char __kmpc_atomic_fixed1_mul_cpt(ident_t *id_ref, int gtid, char *lhs,
1091                                   char rhs, int flag);
1092 char __kmpc_atomic_fixed1_orb_cpt(ident_t *id_ref, int gtid, char *lhs,
1093                                   char rhs, int flag);
1094 char __kmpc_atomic_fixed1_shl_cpt(ident_t *id_ref, int gtid, char *lhs,
1095                                   char rhs, int flag);
1096 char __kmpc_atomic_fixed1_shr_cpt(ident_t *id_ref, int gtid, char *lhs,
1097                                   char rhs, int flag);
1098 unsigned char __kmpc_atomic_fixed1u_shr_cpt(ident_t *id_ref, int gtid,
1099                                             unsigned char *lhs,
1100                                             unsigned char rhs, int flag);
1101 char __kmpc_atomic_fixed1_sub_cpt(ident_t *id_ref, int gtid, char *lhs,
1102                                   char rhs, int flag);
1103 char __kmpc_atomic_fixed1_xor_cpt(ident_t *id_ref, int gtid, char *lhs,
1104                                   char rhs, int flag);
1105 // 2-byte
1106 short __kmpc_atomic_fixed2_add_cpt(ident_t *id_ref, int gtid, short *lhs,
1107                                    short rhs, int flag);
1108 short __kmpc_atomic_fixed2_andb_cpt(ident_t *id_ref, int gtid, short *lhs,
1109                                     short rhs, int flag);
1110 short __kmpc_atomic_fixed2_div_cpt(ident_t *id_ref, int gtid, short *lhs,
1111                                    short rhs, int flag);
1112 unsigned short __kmpc_atomic_fixed2u_div_cpt(ident_t *id_ref, int gtid,
1113                                              unsigned short *lhs,
1114                                              unsigned short rhs, int flag);
1115 short __kmpc_atomic_fixed2_mul_cpt(ident_t *id_ref, int gtid, short *lhs,
1116                                    short rhs, int flag);
1117 short __kmpc_atomic_fixed2_orb_cpt(ident_t *id_ref, int gtid, short *lhs,
1118                                    short rhs, int flag);
1119 short __kmpc_atomic_fixed2_shl_cpt(ident_t *id_ref, int gtid, short *lhs,
1120                                    short rhs, int flag);
1121 short __kmpc_atomic_fixed2_shr_cpt(ident_t *id_ref, int gtid, short *lhs,
1122                                    short rhs, int flag);
1123 unsigned short __kmpc_atomic_fixed2u_shr_cpt(ident_t *id_ref, int gtid,
1124                                              unsigned short *lhs,
1125                                              unsigned short rhs, int flag);
1126 short __kmpc_atomic_fixed2_sub_cpt(ident_t *id_ref, int gtid, short *lhs,
1127                                    short rhs, int flag);
1128 short __kmpc_atomic_fixed2_xor_cpt(ident_t *id_ref, int gtid, short *lhs,
1129                                    short rhs, int flag);
1130 // 4-byte add / sub fixed
1131 kmp_int32 __kmpc_atomic_fixed4_add_cpt(ident_t *id_ref, int gtid,
1132                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1133 kmp_int32 __kmpc_atomic_fixed4_sub_cpt(ident_t *id_ref, int gtid,
1134                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1135 // 4-byte add / sub float
1136 kmp_real32 __kmpc_atomic_float4_add_cpt(ident_t *id_ref, int gtid,
1137                                         kmp_real32 *lhs, kmp_real32 rhs,
1138                                         int flag);
1139 kmp_real32 __kmpc_atomic_float4_sub_cpt(ident_t *id_ref, int gtid,
1140                                         kmp_real32 *lhs, kmp_real32 rhs,
1141                                         int flag);
1142 // 8-byte add / sub fixed
1143 kmp_int64 __kmpc_atomic_fixed8_add_cpt(ident_t *id_ref, int gtid,
1144                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1145 kmp_int64 __kmpc_atomic_fixed8_sub_cpt(ident_t *id_ref, int gtid,
1146                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1147 // 8-byte add / sub float
1148 kmp_real64 __kmpc_atomic_float8_add_cpt(ident_t *id_ref, int gtid,
1149                                         kmp_real64 *lhs, kmp_real64 rhs,
1150                                         int flag);
1151 kmp_real64 __kmpc_atomic_float8_sub_cpt(ident_t *id_ref, int gtid,
1152                                         kmp_real64 *lhs, kmp_real64 rhs,
1153                                         int flag);
1154 // 4-byte fixed
1155 kmp_int32 __kmpc_atomic_fixed4_andb_cpt(ident_t *id_ref, int gtid,
1156                                         kmp_int32 *lhs, kmp_int32 rhs,
1157                                         int flag);
1158 kmp_int32 __kmpc_atomic_fixed4_div_cpt(ident_t *id_ref, int gtid,
1159                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1160 kmp_uint32 __kmpc_atomic_fixed4u_div_cpt(ident_t *id_ref, int gtid,
1161                                          kmp_uint32 *lhs, kmp_uint32 rhs,
1162                                          int flag);
1163 kmp_int32 __kmpc_atomic_fixed4_mul_cpt(ident_t *id_ref, int gtid,
1164                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1165 kmp_int32 __kmpc_atomic_fixed4_orb_cpt(ident_t *id_ref, int gtid,
1166                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1167 kmp_int32 __kmpc_atomic_fixed4_shl_cpt(ident_t *id_ref, int gtid,
1168                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1169 kmp_int32 __kmpc_atomic_fixed4_shr_cpt(ident_t *id_ref, int gtid,
1170                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1171 kmp_uint32 __kmpc_atomic_fixed4u_shr_cpt(ident_t *id_ref, int gtid,
1172                                          kmp_uint32 *lhs, kmp_uint32 rhs,
1173                                          int flag);
1174 kmp_int32 __kmpc_atomic_fixed4_xor_cpt(ident_t *id_ref, int gtid,
1175                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1176 // 8-byte fixed
1177 kmp_int64 __kmpc_atomic_fixed8_andb_cpt(ident_t *id_ref, int gtid,
1178                                         kmp_int64 *lhs, kmp_int64 rhs,
1179                                         int flag);
1180 kmp_int64 __kmpc_atomic_fixed8_div_cpt(ident_t *id_ref, int gtid,
1181                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1182 kmp_uint64 __kmpc_atomic_fixed8u_div_cpt(ident_t *id_ref, int gtid,
1183                                          kmp_uint64 *lhs, kmp_uint64 rhs,
1184                                          int flag);
1185 kmp_int64 __kmpc_atomic_fixed8_mul_cpt(ident_t *id_ref, int gtid,
1186                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1187 kmp_int64 __kmpc_atomic_fixed8_orb_cpt(ident_t *id_ref, int gtid,
1188                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1189 kmp_int64 __kmpc_atomic_fixed8_shl_cpt(ident_t *id_ref, int gtid,
1190                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1191 kmp_int64 __kmpc_atomic_fixed8_shr_cpt(ident_t *id_ref, int gtid,
1192                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1193 kmp_uint64 __kmpc_atomic_fixed8u_shr_cpt(ident_t *id_ref, int gtid,
1194                                          kmp_uint64 *lhs, kmp_uint64 rhs,
1195                                          int flag);
1196 kmp_int64 __kmpc_atomic_fixed8_xor_cpt(ident_t *id_ref, int gtid,
1197                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1198 // 4-byte float
1199 kmp_real32 __kmpc_atomic_float4_div_cpt(ident_t *id_ref, int gtid,
1200                                         kmp_real32 *lhs, kmp_real32 rhs,
1201                                         int flag);
1202 kmp_real32 __kmpc_atomic_float4_mul_cpt(ident_t *id_ref, int gtid,
1203                                         kmp_real32 *lhs, kmp_real32 rhs,
1204                                         int flag);
1205 // 8-byte float
1206 kmp_real64 __kmpc_atomic_float8_div_cpt(ident_t *id_ref, int gtid,
1207                                         kmp_real64 *lhs, kmp_real64 rhs,
1208                                         int flag);
1209 kmp_real64 __kmpc_atomic_float8_mul_cpt(ident_t *id_ref, int gtid,
1210                                         kmp_real64 *lhs, kmp_real64 rhs,
1211                                         int flag);
1212 // 1-, 2-, 4-, 8-byte logical (&&, ||)
1213 char __kmpc_atomic_fixed1_andl_cpt(ident_t *id_ref, int gtid, char *lhs,
1214                                    char rhs, int flag);
1215 char __kmpc_atomic_fixed1_orl_cpt(ident_t *id_ref, int gtid, char *lhs,
1216                                   char rhs, int flag);
1217 short __kmpc_atomic_fixed2_andl_cpt(ident_t *id_ref, int gtid, short *lhs,
1218                                     short rhs, int flag);
1219 short __kmpc_atomic_fixed2_orl_cpt(ident_t *id_ref, int gtid, short *lhs,
1220                                    short rhs, int flag);
1221 kmp_int32 __kmpc_atomic_fixed4_andl_cpt(ident_t *id_ref, int gtid,
1222                                         kmp_int32 *lhs, kmp_int32 rhs,
1223                                         int flag);
1224 kmp_int32 __kmpc_atomic_fixed4_orl_cpt(ident_t *id_ref, int gtid,
1225                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1226 kmp_int64 __kmpc_atomic_fixed8_andl_cpt(ident_t *id_ref, int gtid,
1227                                         kmp_int64 *lhs, kmp_int64 rhs,
1228                                         int flag);
1229 kmp_int64 __kmpc_atomic_fixed8_orl_cpt(ident_t *id_ref, int gtid,
1230                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1231 // MIN / MAX
1232 char __kmpc_atomic_fixed1_max_cpt(ident_t *id_ref, int gtid, char *lhs,
1233                                   char rhs, int flag);
1234 char __kmpc_atomic_fixed1_min_cpt(ident_t *id_ref, int gtid, char *lhs,
1235                                   char rhs, int flag);
1236 short __kmpc_atomic_fixed2_max_cpt(ident_t *id_ref, int gtid, short *lhs,
1237                                    short rhs, int flag);
1238 short __kmpc_atomic_fixed2_min_cpt(ident_t *id_ref, int gtid, short *lhs,
1239                                    short rhs, int flag);
1240 kmp_int32 __kmpc_atomic_fixed4_max_cpt(ident_t *id_ref, int gtid,
1241                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1242 kmp_int32 __kmpc_atomic_fixed4_min_cpt(ident_t *id_ref, int gtid,
1243                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1244 kmp_int64 __kmpc_atomic_fixed8_max_cpt(ident_t *id_ref, int gtid,
1245                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1246 kmp_int64 __kmpc_atomic_fixed8_min_cpt(ident_t *id_ref, int gtid,
1247                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1248 kmp_real32 __kmpc_atomic_float4_max_cpt(ident_t *id_ref, int gtid,
1249                                         kmp_real32 *lhs, kmp_real32 rhs,
1250                                         int flag);
1251 kmp_real32 __kmpc_atomic_float4_min_cpt(ident_t *id_ref, int gtid,
1252                                         kmp_real32 *lhs, kmp_real32 rhs,
1253                                         int flag);
1254 kmp_real64 __kmpc_atomic_float8_max_cpt(ident_t *id_ref, int gtid,
1255                                         kmp_real64 *lhs, kmp_real64 rhs,
1256                                         int flag);
1257 kmp_real64 __kmpc_atomic_float8_min_cpt(ident_t *id_ref, int gtid,
1258                                         kmp_real64 *lhs, kmp_real64 rhs,
1259                                         int flag);
1260 #if KMP_HAVE_QUAD
1261 QUAD_LEGACY __kmpc_atomic_float16_max_cpt(ident_t *id_ref, int gtid,
1262                                           QUAD_LEGACY *lhs, QUAD_LEGACY rhs,
1263                                           int flag);
1264 QUAD_LEGACY __kmpc_atomic_float16_min_cpt(ident_t *id_ref, int gtid,
1265                                           QUAD_LEGACY *lhs, QUAD_LEGACY rhs,
1266                                           int flag);
1267 #endif
1268 // .NEQV. (same as xor)
1269 char __kmpc_atomic_fixed1_neqv_cpt(ident_t *id_ref, int gtid, char *lhs,
1270                                    char rhs, int flag);
1271 short __kmpc_atomic_fixed2_neqv_cpt(ident_t *id_ref, int gtid, short *lhs,
1272                                     short rhs, int flag);
1273 kmp_int32 __kmpc_atomic_fixed4_neqv_cpt(ident_t *id_ref, int gtid,
1274                                         kmp_int32 *lhs, kmp_int32 rhs,
1275                                         int flag);
1276 kmp_int64 __kmpc_atomic_fixed8_neqv_cpt(ident_t *id_ref, int gtid,
1277                                         kmp_int64 *lhs, kmp_int64 rhs,
1278                                         int flag);
1279 // .EQV. (same as ~xor)
1280 char __kmpc_atomic_fixed1_eqv_cpt(ident_t *id_ref, int gtid, char *lhs,
1281                                   char rhs, int flag);
1282 short __kmpc_atomic_fixed2_eqv_cpt(ident_t *id_ref, int gtid, short *lhs,
1283                                    short rhs, int flag);
1284 kmp_int32 __kmpc_atomic_fixed4_eqv_cpt(ident_t *id_ref, int gtid,
1285                                        kmp_int32 *lhs, kmp_int32 rhs, int flag);
1286 kmp_int64 __kmpc_atomic_fixed8_eqv_cpt(ident_t *id_ref, int gtid,
1287                                        kmp_int64 *lhs, kmp_int64 rhs, int flag);
1288 // long double type
1289 long double __kmpc_atomic_float10_add_cpt(ident_t *id_ref, int gtid,
1290                                           long double *lhs, long double rhs,
1291                                           int flag);
1292 long double __kmpc_atomic_float10_sub_cpt(ident_t *id_ref, int gtid,
1293                                           long double *lhs, long double rhs,
1294                                           int flag);
1295 long double __kmpc_atomic_float10_mul_cpt(ident_t *id_ref, int gtid,
1296                                           long double *lhs, long double rhs,
1297                                           int flag);
1298 long double __kmpc_atomic_float10_div_cpt(ident_t *id_ref, int gtid,
1299                                           long double *lhs, long double rhs,
1300                                           int flag);
1301 #if KMP_HAVE_QUAD
1302 // _Quad type
1303 QUAD_LEGACY __kmpc_atomic_float16_add_cpt(ident_t *id_ref, int gtid,
1304                                           QUAD_LEGACY *lhs, QUAD_LEGACY rhs,
1305                                           int flag);
1306 QUAD_LEGACY __kmpc_atomic_float16_sub_cpt(ident_t *id_ref, int gtid,
1307                                           QUAD_LEGACY *lhs, QUAD_LEGACY rhs,
1308                                           int flag);
1309 QUAD_LEGACY __kmpc_atomic_float16_mul_cpt(ident_t *id_ref, int gtid,
1310                                           QUAD_LEGACY *lhs, QUAD_LEGACY rhs,
1311                                           int flag);
1312 QUAD_LEGACY __kmpc_atomic_float16_div_cpt(ident_t *id_ref, int gtid,
1313                                           QUAD_LEGACY *lhs, QUAD_LEGACY rhs,
1314                                           int flag);
1315 #endif
1316 // routines for complex types
1317 // Workaround for cmplx4 routines - return void; captured value is returned via
1318 // the argument
1319 void __kmpc_atomic_cmplx4_add_cpt(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
1320                                   kmp_cmplx32 rhs, kmp_cmplx32 *out, int flag);
1321 void __kmpc_atomic_cmplx4_sub_cpt(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
1322                                   kmp_cmplx32 rhs, kmp_cmplx32 *out, int flag);
1323 void __kmpc_atomic_cmplx4_mul_cpt(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
1324                                   kmp_cmplx32 rhs, kmp_cmplx32 *out, int flag);
1325 void __kmpc_atomic_cmplx4_div_cpt(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
1326                                   kmp_cmplx32 rhs, kmp_cmplx32 *out, int flag);
1327 
1328 kmp_cmplx64 __kmpc_atomic_cmplx8_add_cpt(ident_t *id_ref, int gtid,
1329                                          kmp_cmplx64 *lhs, kmp_cmplx64 rhs,
1330                                          int flag);
1331 kmp_cmplx64 __kmpc_atomic_cmplx8_sub_cpt(ident_t *id_ref, int gtid,
1332                                          kmp_cmplx64 *lhs, kmp_cmplx64 rhs,
1333                                          int flag);
1334 kmp_cmplx64 __kmpc_atomic_cmplx8_mul_cpt(ident_t *id_ref, int gtid,
1335                                          kmp_cmplx64 *lhs, kmp_cmplx64 rhs,
1336                                          int flag);
1337 kmp_cmplx64 __kmpc_atomic_cmplx8_div_cpt(ident_t *id_ref, int gtid,
1338                                          kmp_cmplx64 *lhs, kmp_cmplx64 rhs,
1339                                          int flag);
1340 kmp_cmplx80 __kmpc_atomic_cmplx10_add_cpt(ident_t *id_ref, int gtid,
1341                                           kmp_cmplx80 *lhs, kmp_cmplx80 rhs,
1342                                           int flag);
1343 kmp_cmplx80 __kmpc_atomic_cmplx10_sub_cpt(ident_t *id_ref, int gtid,
1344                                           kmp_cmplx80 *lhs, kmp_cmplx80 rhs,
1345                                           int flag);
1346 kmp_cmplx80 __kmpc_atomic_cmplx10_mul_cpt(ident_t *id_ref, int gtid,
1347                                           kmp_cmplx80 *lhs, kmp_cmplx80 rhs,
1348                                           int flag);
1349 kmp_cmplx80 __kmpc_atomic_cmplx10_div_cpt(ident_t *id_ref, int gtid,
1350                                           kmp_cmplx80 *lhs, kmp_cmplx80 rhs,
1351                                           int flag);
1352 #if KMP_HAVE_QUAD
1353 CPLX128_LEG __kmpc_atomic_cmplx16_add_cpt(ident_t *id_ref, int gtid,
1354                                           CPLX128_LEG *lhs, CPLX128_LEG rhs,
1355                                           int flag);
1356 CPLX128_LEG __kmpc_atomic_cmplx16_sub_cpt(ident_t *id_ref, int gtid,
1357                                           CPLX128_LEG *lhs, CPLX128_LEG rhs,
1358                                           int flag);
1359 CPLX128_LEG __kmpc_atomic_cmplx16_mul_cpt(ident_t *id_ref, int gtid,
1360                                           CPLX128_LEG *lhs, CPLX128_LEG rhs,
1361                                           int flag);
1362 CPLX128_LEG __kmpc_atomic_cmplx16_div_cpt(ident_t *id_ref, int gtid,
1363                                           CPLX128_LEG *lhs, CPLX128_LEG rhs,
1364                                           int flag);
1365 #if (KMP_ARCH_X86)
1366 // Routines with 16-byte arguments aligned to 16-byte boundary
1367 Quad_a16_t __kmpc_atomic_float16_add_a16_cpt(ident_t *id_ref, int gtid,
1368                                              Quad_a16_t *lhs, Quad_a16_t rhs,
1369                                              int flag);
1370 Quad_a16_t __kmpc_atomic_float16_sub_a16_cpt(ident_t *id_ref, int gtid,
1371                                              Quad_a16_t *lhs, Quad_a16_t rhs,
1372                                              int flag);
1373 Quad_a16_t __kmpc_atomic_float16_mul_a16_cpt(ident_t *id_ref, int gtid,
1374                                              Quad_a16_t *lhs, Quad_a16_t rhs,
1375                                              int flag);
1376 Quad_a16_t __kmpc_atomic_float16_div_a16_cpt(ident_t *id_ref, int gtid,
1377                                              Quad_a16_t *lhs, Quad_a16_t rhs,
1378                                              int flag);
1379 Quad_a16_t __kmpc_atomic_float16_max_a16_cpt(ident_t *id_ref, int gtid,
1380                                              Quad_a16_t *lhs, Quad_a16_t rhs,
1381                                              int flag);
1382 Quad_a16_t __kmpc_atomic_float16_min_a16_cpt(ident_t *id_ref, int gtid,
1383                                              Quad_a16_t *lhs, Quad_a16_t rhs,
1384                                              int flag);
1385 kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_add_a16_cpt(ident_t *id_ref, int gtid,
1386                                                      kmp_cmplx128_a16_t *lhs,
1387                                                      kmp_cmplx128_a16_t rhs,
1388                                                      int flag);
1389 kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_sub_a16_cpt(ident_t *id_ref, int gtid,
1390                                                      kmp_cmplx128_a16_t *lhs,
1391                                                      kmp_cmplx128_a16_t rhs,
1392                                                      int flag);
1393 kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_mul_a16_cpt(ident_t *id_ref, int gtid,
1394                                                      kmp_cmplx128_a16_t *lhs,
1395                                                      kmp_cmplx128_a16_t rhs,
1396                                                      int flag);
1397 kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_div_a16_cpt(ident_t *id_ref, int gtid,
1398                                                      kmp_cmplx128_a16_t *lhs,
1399                                                      kmp_cmplx128_a16_t rhs,
1400                                                      int flag);
1401 #endif
1402 #endif
1403 
1404 void __kmpc_atomic_start(void);
1405 void __kmpc_atomic_end(void);
1406 
1407 #if OMP_40_ENABLED
1408 
1409 // OpenMP 4.0: v = x = expr binop x; { v = x; x = expr binop x; } { x = expr
1410 // binop x; v = x; }  for non-commutative operations.
1411 
1412 char __kmpc_atomic_fixed1_sub_cpt_rev(ident_t *id_ref, int gtid, char *lhs,
1413                                       char rhs, int flag);
1414 char __kmpc_atomic_fixed1_div_cpt_rev(ident_t *id_ref, int gtid, char *lhs,
1415                                       char rhs, int flag);
1416 unsigned char __kmpc_atomic_fixed1u_div_cpt_rev(ident_t *id_ref, int gtid,
1417                                                 unsigned char *lhs,
1418                                                 unsigned char rhs, int flag);
1419 char __kmpc_atomic_fixed1_shl_cpt_rev(ident_t *id_ref, int gtid, char *lhs,
1420                                       char rhs, int flag);
1421 char __kmpc_atomic_fixed1_shr_cpt_rev(ident_t *id_ref, int gtid, char *lhs,
1422                                       char rhs, int flag);
1423 unsigned char __kmpc_atomic_fixed1u_shr_cpt_rev(ident_t *id_ref, int gtid,
1424                                                 unsigned char *lhs,
1425                                                 unsigned char rhs, int flag);
1426 short __kmpc_atomic_fixed2_sub_cpt_rev(ident_t *id_ref, int gtid, short *lhs,
1427                                        short rhs, int flag);
1428 short __kmpc_atomic_fixed2_div_cpt_rev(ident_t *id_ref, int gtid, short *lhs,
1429                                        short rhs, int flag);
1430 unsigned short __kmpc_atomic_fixed2u_div_cpt_rev(ident_t *id_ref, int gtid,
1431                                                  unsigned short *lhs,
1432                                                  unsigned short rhs, int flag);
1433 short __kmpc_atomic_fixed2_shl_cpt_rev(ident_t *id_ref, int gtid, short *lhs,
1434                                        short rhs, int flag);
1435 short __kmpc_atomic_fixed2_shr_cpt_rev(ident_t *id_ref, int gtid, short *lhs,
1436                                        short rhs, int flag);
1437 unsigned short __kmpc_atomic_fixed2u_shr_cpt_rev(ident_t *id_ref, int gtid,
1438                                                  unsigned short *lhs,
1439                                                  unsigned short rhs, int flag);
1440 kmp_int32 __kmpc_atomic_fixed4_sub_cpt_rev(ident_t *id_ref, int gtid,
1441                                            kmp_int32 *lhs, kmp_int32 rhs,
1442                                            int flag);
1443 kmp_int32 __kmpc_atomic_fixed4_div_cpt_rev(ident_t *id_ref, int gtid,
1444                                            kmp_int32 *lhs, kmp_int32 rhs,
1445                                            int flag);
1446 kmp_uint32 __kmpc_atomic_fixed4u_div_cpt_rev(ident_t *id_ref, int gtid,
1447                                              kmp_uint32 *lhs, kmp_uint32 rhs,
1448                                              int flag);
1449 kmp_int32 __kmpc_atomic_fixed4_shl_cpt_rev(ident_t *id_ref, int gtid,
1450                                            kmp_int32 *lhs, kmp_int32 rhs,
1451                                            int flag);
1452 kmp_int32 __kmpc_atomic_fixed4_shr_cpt_rev(ident_t *id_ref, int gtid,
1453                                            kmp_int32 *lhs, kmp_int32 rhs,
1454                                            int flag);
1455 kmp_uint32 __kmpc_atomic_fixed4u_shr_cpt_rev(ident_t *id_ref, int gtid,
1456                                              kmp_uint32 *lhs, kmp_uint32 rhs,
1457                                              int flag);
1458 kmp_int64 __kmpc_atomic_fixed8_sub_cpt_rev(ident_t *id_ref, int gtid,
1459                                            kmp_int64 *lhs, kmp_int64 rhs,
1460                                            int flag);
1461 kmp_int64 __kmpc_atomic_fixed8_div_cpt_rev(ident_t *id_ref, int gtid,
1462                                            kmp_int64 *lhs, kmp_int64 rhs,
1463                                            int flag);
1464 kmp_uint64 __kmpc_atomic_fixed8u_div_cpt_rev(ident_t *id_ref, int gtid,
1465                                              kmp_uint64 *lhs, kmp_uint64 rhs,
1466                                              int flag);
1467 kmp_int64 __kmpc_atomic_fixed8_shl_cpt_rev(ident_t *id_ref, int gtid,
1468                                            kmp_int64 *lhs, kmp_int64 rhs,
1469                                            int flag);
1470 kmp_int64 __kmpc_atomic_fixed8_shr_cpt_rev(ident_t *id_ref, int gtid,
1471                                            kmp_int64 *lhs, kmp_int64 rhs,
1472                                            int flag);
1473 kmp_uint64 __kmpc_atomic_fixed8u_shr_cpt_rev(ident_t *id_ref, int gtid,
1474                                              kmp_uint64 *lhs, kmp_uint64 rhs,
1475                                              int flag);
1476 float __kmpc_atomic_float4_sub_cpt_rev(ident_t *id_ref, int gtid, float *lhs,
1477                                        float rhs, int flag);
1478 float __kmpc_atomic_float4_div_cpt_rev(ident_t *id_ref, int gtid, float *lhs,
1479                                        float rhs, int flag);
1480 double __kmpc_atomic_float8_sub_cpt_rev(ident_t *id_ref, int gtid, double *lhs,
1481                                         double rhs, int flag);
1482 double __kmpc_atomic_float8_div_cpt_rev(ident_t *id_ref, int gtid, double *lhs,
1483                                         double rhs, int flag);
1484 long double __kmpc_atomic_float10_sub_cpt_rev(ident_t *id_ref, int gtid,
1485                                               long double *lhs, long double rhs,
1486                                               int flag);
1487 long double __kmpc_atomic_float10_div_cpt_rev(ident_t *id_ref, int gtid,
1488                                               long double *lhs, long double rhs,
1489                                               int flag);
1490 #if KMP_HAVE_QUAD
1491 QUAD_LEGACY __kmpc_atomic_float16_sub_cpt_rev(ident_t *id_ref, int gtid,
1492                                               QUAD_LEGACY *lhs, QUAD_LEGACY rhs,
1493                                               int flag);
1494 QUAD_LEGACY __kmpc_atomic_float16_div_cpt_rev(ident_t *id_ref, int gtid,
1495                                               QUAD_LEGACY *lhs, QUAD_LEGACY rhs,
1496                                               int flag);
1497 #endif
1498 // Workaround for cmplx4 routines - return void; captured value is returned via
1499 // the argument
1500 void __kmpc_atomic_cmplx4_sub_cpt_rev(ident_t *id_ref, int gtid,
1501                                       kmp_cmplx32 *lhs, kmp_cmplx32 rhs,
1502                                       kmp_cmplx32 *out, int flag);
1503 void __kmpc_atomic_cmplx4_div_cpt_rev(ident_t *id_ref, int gtid,
1504                                       kmp_cmplx32 *lhs, kmp_cmplx32 rhs,
1505                                       kmp_cmplx32 *out, int flag);
1506 kmp_cmplx64 __kmpc_atomic_cmplx8_sub_cpt_rev(ident_t *id_ref, int gtid,
1507                                              kmp_cmplx64 *lhs, kmp_cmplx64 rhs,
1508                                              int flag);
1509 kmp_cmplx64 __kmpc_atomic_cmplx8_div_cpt_rev(ident_t *id_ref, int gtid,
1510                                              kmp_cmplx64 *lhs, kmp_cmplx64 rhs,
1511                                              int flag);
1512 kmp_cmplx80 __kmpc_atomic_cmplx10_sub_cpt_rev(ident_t *id_ref, int gtid,
1513                                               kmp_cmplx80 *lhs, kmp_cmplx80 rhs,
1514                                               int flag);
1515 kmp_cmplx80 __kmpc_atomic_cmplx10_div_cpt_rev(ident_t *id_ref, int gtid,
1516                                               kmp_cmplx80 *lhs, kmp_cmplx80 rhs,
1517                                               int flag);
1518 #if KMP_HAVE_QUAD
1519 CPLX128_LEG __kmpc_atomic_cmplx16_sub_cpt_rev(ident_t *id_ref, int gtid,
1520                                               CPLX128_LEG *lhs, CPLX128_LEG rhs,
1521                                               int flag);
1522 CPLX128_LEG __kmpc_atomic_cmplx16_div_cpt_rev(ident_t *id_ref, int gtid,
1523                                               CPLX128_LEG *lhs, CPLX128_LEG rhs,
1524                                               int flag);
1525 #if (KMP_ARCH_X86)
1526 Quad_a16_t __kmpc_atomic_float16_sub_a16_cpt_rev(ident_t *id_ref, int gtid,
1527                                                  Quad_a16_t *lhs,
1528                                                  Quad_a16_t rhs, int flag);
1529 Quad_a16_t __kmpc_atomic_float16_div_a16_cpt_rev(ident_t *id_ref, int gtid,
1530                                                  Quad_a16_t *lhs,
1531                                                  Quad_a16_t rhs, int flag);
1532 kmp_cmplx128_a16_t
1533 __kmpc_atomic_cmplx16_sub_a16_cpt_rev(ident_t *id_ref, int gtid,
1534                                       kmp_cmplx128_a16_t *lhs,
1535                                       kmp_cmplx128_a16_t rhs, int flag);
1536 kmp_cmplx128_a16_t
1537 __kmpc_atomic_cmplx16_div_a16_cpt_rev(ident_t *id_ref, int gtid,
1538                                       kmp_cmplx128_a16_t *lhs,
1539                                       kmp_cmplx128_a16_t rhs, int flag);
1540 #endif
1541 #endif
1542 
1543 //   OpenMP 4.0 Capture-write (swap): {v = x; x = expr;}
1544 char __kmpc_atomic_fixed1_swp(ident_t *id_ref, int gtid, char *lhs, char rhs);
1545 short __kmpc_atomic_fixed2_swp(ident_t *id_ref, int gtid, short *lhs,
1546                                short rhs);
1547 kmp_int32 __kmpc_atomic_fixed4_swp(ident_t *id_ref, int gtid, kmp_int32 *lhs,
1548                                    kmp_int32 rhs);
1549 kmp_int64 __kmpc_atomic_fixed8_swp(ident_t *id_ref, int gtid, kmp_int64 *lhs,
1550                                    kmp_int64 rhs);
1551 float __kmpc_atomic_float4_swp(ident_t *id_ref, int gtid, float *lhs,
1552                                float rhs);
1553 double __kmpc_atomic_float8_swp(ident_t *id_ref, int gtid, double *lhs,
1554                                 double rhs);
1555 long double __kmpc_atomic_float10_swp(ident_t *id_ref, int gtid,
1556                                       long double *lhs, long double rhs);
1557 #if KMP_HAVE_QUAD
1558 QUAD_LEGACY __kmpc_atomic_float16_swp(ident_t *id_ref, int gtid,
1559                                       QUAD_LEGACY *lhs, QUAD_LEGACY rhs);
1560 #endif
1561 // !!! TODO: check if we need a workaround here
1562 void __kmpc_atomic_cmplx4_swp(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,
1563                               kmp_cmplx32 rhs, kmp_cmplx32 *out);
1564 // kmp_cmplx32   	__kmpc_atomic_cmplx4_swp(  ident_t *id_ref, int gtid,
1565 // kmp_cmplx32 * lhs, kmp_cmplx32 rhs );
1566 
1567 kmp_cmplx64 __kmpc_atomic_cmplx8_swp(ident_t *id_ref, int gtid,
1568                                      kmp_cmplx64 *lhs, kmp_cmplx64 rhs);
1569 kmp_cmplx80 __kmpc_atomic_cmplx10_swp(ident_t *id_ref, int gtid,
1570                                       kmp_cmplx80 *lhs, kmp_cmplx80 rhs);
1571 #if KMP_HAVE_QUAD
1572 CPLX128_LEG __kmpc_atomic_cmplx16_swp(ident_t *id_ref, int gtid,
1573                                       CPLX128_LEG *lhs, CPLX128_LEG rhs);
1574 #if (KMP_ARCH_X86)
1575 Quad_a16_t __kmpc_atomic_float16_a16_swp(ident_t *id_ref, int gtid,
1576                                          Quad_a16_t *lhs, Quad_a16_t rhs);
1577 kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_a16_swp(ident_t *id_ref, int gtid,
1578                                                  kmp_cmplx128_a16_t *lhs,
1579                                                  kmp_cmplx128_a16_t rhs);
1580 #endif
1581 #endif
1582 
1583 // Capture routines for mixed types (RHS=float16)
1584 #if KMP_HAVE_QUAD
1585 
1586 char __kmpc_atomic_fixed1_add_cpt_fp(ident_t *id_ref, int gtid, char *lhs,
1587                                      _Quad rhs, int flag);
1588 char __kmpc_atomic_fixed1_sub_cpt_fp(ident_t *id_ref, int gtid, char *lhs,
1589                                      _Quad rhs, int flag);
1590 char __kmpc_atomic_fixed1_mul_cpt_fp(ident_t *id_ref, int gtid, char *lhs,
1591                                      _Quad rhs, int flag);
1592 char __kmpc_atomic_fixed1_div_cpt_fp(ident_t *id_ref, int gtid, char *lhs,
1593                                      _Quad rhs, int flag);
1594 unsigned char __kmpc_atomic_fixed1u_add_cpt_fp(ident_t *id_ref, int gtid,
1595                                                unsigned char *lhs, _Quad rhs,
1596                                                int flag);
1597 unsigned char __kmpc_atomic_fixed1u_sub_cpt_fp(ident_t *id_ref, int gtid,
1598                                                unsigned char *lhs, _Quad rhs,
1599                                                int flag);
1600 unsigned char __kmpc_atomic_fixed1u_mul_cpt_fp(ident_t *id_ref, int gtid,
1601                                                unsigned char *lhs, _Quad rhs,
1602                                                int flag);
1603 unsigned char __kmpc_atomic_fixed1u_div_cpt_fp(ident_t *id_ref, int gtid,
1604                                                unsigned char *lhs, _Quad rhs,
1605                                                int flag);
1606 
1607 short __kmpc_atomic_fixed2_add_cpt_fp(ident_t *id_ref, int gtid, short *lhs,
1608                                       _Quad rhs, int flag);
1609 short __kmpc_atomic_fixed2_sub_cpt_fp(ident_t *id_ref, int gtid, short *lhs,
1610                                       _Quad rhs, int flag);
1611 short __kmpc_atomic_fixed2_mul_cpt_fp(ident_t *id_ref, int gtid, short *lhs,
1612                                       _Quad rhs, int flag);
1613 short __kmpc_atomic_fixed2_div_cpt_fp(ident_t *id_ref, int gtid, short *lhs,
1614                                       _Quad rhs, int flag);
1615 unsigned short __kmpc_atomic_fixed2u_add_cpt_fp(ident_t *id_ref, int gtid,
1616                                                 unsigned short *lhs, _Quad rhs,
1617                                                 int flag);
1618 unsigned short __kmpc_atomic_fixed2u_sub_cpt_fp(ident_t *id_ref, int gtid,
1619                                                 unsigned short *lhs, _Quad rhs,
1620                                                 int flag);
1621 unsigned short __kmpc_atomic_fixed2u_mul_cpt_fp(ident_t *id_ref, int gtid,
1622                                                 unsigned short *lhs, _Quad rhs,
1623                                                 int flag);
1624 unsigned short __kmpc_atomic_fixed2u_div_cpt_fp(ident_t *id_ref, int gtid,
1625                                                 unsigned short *lhs, _Quad rhs,
1626                                                 int flag);
1627 
1628 kmp_int32 __kmpc_atomic_fixed4_add_cpt_fp(ident_t *id_ref, int gtid,
1629                                           kmp_int32 *lhs, _Quad rhs, int flag);
1630 kmp_int32 __kmpc_atomic_fixed4_sub_cpt_fp(ident_t *id_ref, int gtid,
1631                                           kmp_int32 *lhs, _Quad rhs, int flag);
1632 kmp_int32 __kmpc_atomic_fixed4_mul_cpt_fp(ident_t *id_ref, int gtid,
1633                                           kmp_int32 *lhs, _Quad rhs, int flag);
1634 kmp_int32 __kmpc_atomic_fixed4_div_cpt_fp(ident_t *id_ref, int gtid,
1635                                           kmp_int32 *lhs, _Quad rhs, int flag);
1636 kmp_uint32 __kmpc_atomic_fixed4u_add_cpt_fp(ident_t *id_ref, int gtid,
1637                                             kmp_uint32 *lhs, _Quad rhs,
1638                                             int flag);
1639 kmp_uint32 __kmpc_atomic_fixed4u_sub_cpt_fp(ident_t *id_ref, int gtid,
1640                                             kmp_uint32 *lhs, _Quad rhs,
1641                                             int flag);
1642 kmp_uint32 __kmpc_atomic_fixed4u_mul_cpt_fp(ident_t *id_ref, int gtid,
1643                                             kmp_uint32 *lhs, _Quad rhs,
1644                                             int flag);
1645 kmp_uint32 __kmpc_atomic_fixed4u_div_cpt_fp(ident_t *id_ref, int gtid,
1646                                             kmp_uint32 *lhs, _Quad rhs,
1647                                             int flag);
1648 
1649 kmp_int64 __kmpc_atomic_fixed8_add_cpt_fp(ident_t *id_ref, int gtid,
1650                                           kmp_int64 *lhs, _Quad rhs, int flag);
1651 kmp_int64 __kmpc_atomic_fixed8_sub_cpt_fp(ident_t *id_ref, int gtid,
1652                                           kmp_int64 *lhs, _Quad rhs, int flag);
1653 kmp_int64 __kmpc_atomic_fixed8_mul_cpt_fp(ident_t *id_ref, int gtid,
1654                                           kmp_int64 *lhs, _Quad rhs, int flag);
1655 kmp_int64 __kmpc_atomic_fixed8_div_cpt_fp(ident_t *id_ref, int gtid,
1656                                           kmp_int64 *lhs, _Quad rhs, int flag);
1657 kmp_uint64 __kmpc_atomic_fixed8u_add_cpt_fp(ident_t *id_ref, int gtid,
1658                                             kmp_uint64 *lhs, _Quad rhs,
1659                                             int flag);
1660 kmp_uint64 __kmpc_atomic_fixed8u_sub_cpt_fp(ident_t *id_ref, int gtid,
1661                                             kmp_uint64 *lhs, _Quad rhs,
1662                                             int flag);
1663 kmp_uint64 __kmpc_atomic_fixed8u_mul_cpt_fp(ident_t *id_ref, int gtid,
1664                                             kmp_uint64 *lhs, _Quad rhs,
1665                                             int flag);
1666 kmp_uint64 __kmpc_atomic_fixed8u_div_cpt_fp(ident_t *id_ref, int gtid,
1667                                             kmp_uint64 *lhs, _Quad rhs,
1668                                             int flag);
1669 
1670 float __kmpc_atomic_float4_add_cpt_fp(ident_t *id_ref, int gtid,
1671                                       kmp_real32 *lhs, _Quad rhs, int flag);
1672 float __kmpc_atomic_float4_sub_cpt_fp(ident_t *id_ref, int gtid,
1673                                       kmp_real32 *lhs, _Quad rhs, int flag);
1674 float __kmpc_atomic_float4_mul_cpt_fp(ident_t *id_ref, int gtid,
1675                                       kmp_real32 *lhs, _Quad rhs, int flag);
1676 float __kmpc_atomic_float4_div_cpt_fp(ident_t *id_ref, int gtid,
1677                                       kmp_real32 *lhs, _Quad rhs, int flag);
1678 
1679 double __kmpc_atomic_float8_add_cpt_fp(ident_t *id_ref, int gtid,
1680                                        kmp_real64 *lhs, _Quad rhs, int flag);
1681 double __kmpc_atomic_float8_sub_cpt_fp(ident_t *id_ref, int gtid,
1682                                        kmp_real64 *lhs, _Quad rhs, int flag);
1683 double __kmpc_atomic_float8_mul_cpt_fp(ident_t *id_ref, int gtid,
1684                                        kmp_real64 *lhs, _Quad rhs, int flag);
1685 double __kmpc_atomic_float8_div_cpt_fp(ident_t *id_ref, int gtid,
1686                                        kmp_real64 *lhs, _Quad rhs, int flag);
1687 
1688 long double __kmpc_atomic_float10_add_cpt_fp(ident_t *id_ref, int gtid,
1689                                              long double *lhs, _Quad rhs,
1690                                              int flag);
1691 long double __kmpc_atomic_float10_sub_cpt_fp(ident_t *id_ref, int gtid,
1692                                              long double *lhs, _Quad rhs,
1693                                              int flag);
1694 long double __kmpc_atomic_float10_mul_cpt_fp(ident_t *id_ref, int gtid,
1695                                              long double *lhs, _Quad rhs,
1696                                              int flag);
1697 long double __kmpc_atomic_float10_div_cpt_fp(ident_t *id_ref, int gtid,
1698                                              long double *lhs, _Quad rhs,
1699                                              int flag);
1700 
1701 char __kmpc_atomic_fixed1_sub_cpt_rev_fp(ident_t *id_ref, int gtid, char *lhs,
1702                                          _Quad rhs, int flag);
1703 unsigned char __kmpc_atomic_fixed1u_sub_cpt_rev_fp(ident_t *id_ref, int gtid,
1704                                                    unsigned char *lhs,
1705                                                    _Quad rhs, int flag);
1706 char __kmpc_atomic_fixed1_div_cpt_rev_fp(ident_t *id_ref, int gtid, char *lhs,
1707                                          _Quad rhs, int flag);
1708 unsigned char __kmpc_atomic_fixed1u_div_cpt_rev_fp(ident_t *id_ref, int gtid,
1709                                                    unsigned char *lhs,
1710                                                    _Quad rhs, int flag);
1711 short __kmpc_atomic_fixed2_sub_cpt_rev_fp(ident_t *id_ref, int gtid, short *lhs,
1712                                           _Quad rhs, int flag);
1713 unsigned short __kmpc_atomic_fixed2u_sub_cpt_rev_fp(ident_t *id_ref, int gtid,
1714                                                     unsigned short *lhs,
1715                                                     _Quad rhs, int flag);
1716 short __kmpc_atomic_fixed2_div_cpt_rev_fp(ident_t *id_ref, int gtid, short *lhs,
1717                                           _Quad rhs, int flag);
1718 unsigned short __kmpc_atomic_fixed2u_div_cpt_rev_fp(ident_t *id_ref, int gtid,
1719                                                     unsigned short *lhs,
1720                                                     _Quad rhs, int flag);
1721 kmp_int32 __kmpc_atomic_fixed4_sub_cpt_rev_fp(ident_t *id_ref, int gtid,
1722                                               kmp_int32 *lhs, _Quad rhs,
1723                                               int flag);
1724 kmp_uint32 __kmpc_atomic_fixed4u_sub_cpt_rev_fp(ident_t *id_ref, int gtid,
1725                                                 kmp_uint32 *lhs, _Quad rhs,
1726                                                 int flag);
1727 kmp_int32 __kmpc_atomic_fixed4_div_cpt_rev_fp(ident_t *id_ref, int gtid,
1728                                               kmp_int32 *lhs, _Quad rhs,
1729                                               int flag);
1730 kmp_uint32 __kmpc_atomic_fixed4u_div_cpt_rev_fp(ident_t *id_ref, int gtid,
1731                                                 kmp_uint32 *lhs, _Quad rhs,
1732                                                 int flag);
1733 kmp_int64 __kmpc_atomic_fixed8_sub_cpt_rev_fp(ident_t *id_ref, int gtid,
1734                                               kmp_int64 *lhs, _Quad rhs,
1735                                               int flag);
1736 kmp_uint64 __kmpc_atomic_fixed8u_sub_cpt_rev_fp(ident_t *id_ref, int gtid,
1737                                                 kmp_uint64 *lhs, _Quad rhs,
1738                                                 int flag);
1739 kmp_int64 __kmpc_atomic_fixed8_div_cpt_rev_fp(ident_t *id_ref, int gtid,
1740                                               kmp_int64 *lhs, _Quad rhs,
1741                                               int flag);
1742 kmp_uint64 __kmpc_atomic_fixed8u_div_cpt_rev_fp(ident_t *id_ref, int gtid,
1743                                                 kmp_uint64 *lhs, _Quad rhs,
1744                                                 int flag);
1745 float __kmpc_atomic_float4_sub_cpt_rev_fp(ident_t *id_ref, int gtid, float *lhs,
1746                                           _Quad rhs, int flag);
1747 float __kmpc_atomic_float4_div_cpt_rev_fp(ident_t *id_ref, int gtid, float *lhs,
1748                                           _Quad rhs, int flag);
1749 double __kmpc_atomic_float8_sub_cpt_rev_fp(ident_t *id_ref, int gtid,
1750                                            double *lhs, _Quad rhs, int flag);
1751 double __kmpc_atomic_float8_div_cpt_rev_fp(ident_t *id_ref, int gtid,
1752                                            double *lhs, _Quad rhs, int flag);
1753 long double __kmpc_atomic_float10_sub_cpt_rev_fp(ident_t *id_ref, int gtid,
1754                                                  long double *lhs, _Quad rhs,
1755                                                  int flag);
1756 long double __kmpc_atomic_float10_div_cpt_rev_fp(ident_t *id_ref, int gtid,
1757                                                  long double *lhs, _Quad rhs,
1758                                                  int flag);
1759 
1760 #endif // KMP_HAVE_QUAD
1761 
1762 // End of OpenMP 4.0 capture
1763 
1764 #endif // OMP_40_ENABLED
1765 
1766 #endif // KMP_ARCH_X86 || KMP_ARCH_X86_64
1767 
1768 /* ------------------------------------------------------------------------ */
1769 
1770 #ifdef __cplusplus
1771 } // extern "C"
1772 #endif
1773 
1774 #endif /* KMP_ATOMIC_H */
1775 
1776 // end of file
1777