Path: blob/main/contrib/llvm-project/openmp/runtime/src/kmp_atomic.h
35258 views
/*1* kmp_atomic.h - ATOMIC header file2*/34//===----------------------------------------------------------------------===//5//6// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.7// See https://llvm.org/LICENSE.txt for license information.8// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception9//10//===----------------------------------------------------------------------===//1112#ifndef KMP_ATOMIC_H13#define KMP_ATOMIC_H1415#include "kmp_lock.h"16#include "kmp_os.h"1718#if OMPT_SUPPORT19#include "ompt-specific.h"20#endif2122// C++ build port.23// Intel compiler does not support _Complex datatype on win.24// Intel compiler supports _Complex datatype on lin and mac.25// On the other side, there is a problem of stack alignment on lin_32 and mac_3226// if the rhs is cmplx80 or cmplx128 typedef'ed datatype.27// The decision is: to use compiler supported _Complex type on lin and mac,28// to use typedef'ed types on win.29// Condition for WIN64 was modified in anticipation of 10.1 build compiler.3031#if defined(__cplusplus) && (KMP_OS_WINDOWS)32// create shortcuts for c99 complex types3334// Visual Studio cannot have function parameters that have the35// align __declspec attribute, so we must remove it. (Compiler Error C2719)36#if KMP_COMPILER_MSVC37#undef KMP_DO_ALIGN38#define KMP_DO_ALIGN(alignment) /* Nothing */39#endif4041#if defined(_MSC_VER) && (_MSC_VER < 1600) && defined(_DEBUG)42// Workaround for the problem of _DebugHeapTag unresolved external.43// This problem prevented to use our static debug library for C tests44// compiled with /MDd option (the library itself built with /MTd),45#undef _DEBUG46#define _DEBUG_TEMPORARILY_UNSET_47#endif4849#include <complex>5051template <typename type_lhs, typename type_rhs>52std::complex<type_lhs> __kmp_lhs_div_rhs(const std::complex<type_lhs> &lhs,53const std::complex<type_rhs> &rhs) {54type_lhs a = lhs.real();55type_lhs b = lhs.imag();56type_rhs c = rhs.real();57type_rhs d = rhs.imag();58type_rhs den = c * c + d * d;59type_rhs r = (a * c + b * d);60type_rhs i = (b * c - a * d);61std::complex<type_lhs> ret(r / den, i / den);62return ret;63}6465// complex866struct __kmp_cmplx64_t : std::complex<double> {6768__kmp_cmplx64_t() : std::complex<double>() {}6970__kmp_cmplx64_t(const std::complex<double> &cd) : std::complex<double>(cd) {}7172void operator/=(const __kmp_cmplx64_t &rhs) {73std::complex<double> lhs = *this;74*this = __kmp_lhs_div_rhs(lhs, rhs);75}7677__kmp_cmplx64_t operator/(const __kmp_cmplx64_t &rhs) {78std::complex<double> lhs = *this;79return __kmp_lhs_div_rhs(lhs, rhs);80}81};82typedef struct __kmp_cmplx64_t kmp_cmplx64;8384// complex485struct __kmp_cmplx32_t : std::complex<float> {8687__kmp_cmplx32_t() : std::complex<float>() {}8889__kmp_cmplx32_t(const std::complex<float> &cf) : std::complex<float>(cf) {}9091__kmp_cmplx32_t operator+(const __kmp_cmplx32_t &b) {92std::complex<float> lhs = *this;93std::complex<float> rhs = b;94return (lhs + rhs);95}96__kmp_cmplx32_t operator-(const __kmp_cmplx32_t &b) {97std::complex<float> lhs = *this;98std::complex<float> rhs = b;99return (lhs - rhs);100}101__kmp_cmplx32_t operator*(const __kmp_cmplx32_t &b) {102std::complex<float> lhs = *this;103std::complex<float> rhs = b;104return (lhs * rhs);105}106107__kmp_cmplx32_t operator+(const kmp_cmplx64 &b) {108kmp_cmplx64 t = kmp_cmplx64(*this) + b;109std::complex<double> d(t);110std::complex<float> f(d);111__kmp_cmplx32_t r(f);112return r;113}114__kmp_cmplx32_t operator-(const kmp_cmplx64 &b) {115kmp_cmplx64 t = kmp_cmplx64(*this) - b;116std::complex<double> d(t);117std::complex<float> f(d);118__kmp_cmplx32_t r(f);119return r;120}121__kmp_cmplx32_t operator*(const kmp_cmplx64 &b) {122kmp_cmplx64 t = kmp_cmplx64(*this) * b;123std::complex<double> d(t);124std::complex<float> f(d);125__kmp_cmplx32_t r(f);126return r;127}128129void operator/=(const __kmp_cmplx32_t &rhs) {130std::complex<float> lhs = *this;131*this = __kmp_lhs_div_rhs(lhs, rhs);132}133134__kmp_cmplx32_t operator/(const __kmp_cmplx32_t &rhs) {135std::complex<float> lhs = *this;136return __kmp_lhs_div_rhs(lhs, rhs);137}138139void operator/=(const kmp_cmplx64 &rhs) {140std::complex<float> lhs = *this;141*this = __kmp_lhs_div_rhs(lhs, rhs);142}143144__kmp_cmplx32_t operator/(const kmp_cmplx64 &rhs) {145std::complex<float> lhs = *this;146return __kmp_lhs_div_rhs(lhs, rhs);147}148};149typedef struct __kmp_cmplx32_t kmp_cmplx32;150151// complex10152struct KMP_DO_ALIGN(16) __kmp_cmplx80_t : std::complex<long double> {153154__kmp_cmplx80_t() : std::complex<long double>() {}155156__kmp_cmplx80_t(const std::complex<long double> &cld)157: std::complex<long double>(cld) {}158159void operator/=(const __kmp_cmplx80_t &rhs) {160std::complex<long double> lhs = *this;161*this = __kmp_lhs_div_rhs(lhs, rhs);162}163164__kmp_cmplx80_t operator/(const __kmp_cmplx80_t &rhs) {165std::complex<long double> lhs = *this;166return __kmp_lhs_div_rhs(lhs, rhs);167}168};169typedef KMP_DO_ALIGN(16) struct __kmp_cmplx80_t kmp_cmplx80;170171// complex16172#if KMP_HAVE_QUAD173struct __kmp_cmplx128_t : std::complex<_Quad> {174175__kmp_cmplx128_t() : std::complex<_Quad>() {}176177__kmp_cmplx128_t(const std::complex<_Quad> &cq) : std::complex<_Quad>(cq) {}178179void operator/=(const __kmp_cmplx128_t &rhs) {180std::complex<_Quad> lhs = *this;181*this = __kmp_lhs_div_rhs(lhs, rhs);182}183184__kmp_cmplx128_t operator/(const __kmp_cmplx128_t &rhs) {185std::complex<_Quad> lhs = *this;186return __kmp_lhs_div_rhs(lhs, rhs);187}188};189typedef struct __kmp_cmplx128_t kmp_cmplx128;190#endif /* KMP_HAVE_QUAD */191192#ifdef _DEBUG_TEMPORARILY_UNSET_193#undef _DEBUG_TEMPORARILY_UNSET_194// Set it back now195#define _DEBUG 1196#endif197198#else199// create shortcuts for c99 complex types200typedef float _Complex kmp_cmplx32;201typedef double _Complex kmp_cmplx64;202typedef long double _Complex kmp_cmplx80;203#if KMP_HAVE_QUAD204typedef _Quad _Complex kmp_cmplx128;205#endif206#endif207208// Compiler 12.0 changed alignment of 16 and 32-byte arguments (like _Quad209// and kmp_cmplx128) on IA-32 architecture. The following aligned structures210// are implemented to support the old alignment in 10.1, 11.0, 11.1 and211// introduce the new alignment in 12.0. See CQ88405.212#if KMP_ARCH_X86 && KMP_HAVE_QUAD213214// 4-byte aligned structures for backward compatibility.215216#pragma pack(push, 4)217218struct KMP_DO_ALIGN(4) Quad_a4_t {219_Quad q;220221Quad_a4_t() : q() {}222Quad_a4_t(const _Quad &cq) : q(cq) {}223224Quad_a4_t operator+(const Quad_a4_t &b) {225_Quad lhs = (*this).q;226_Quad rhs = b.q;227return (Quad_a4_t)(lhs + rhs);228}229230Quad_a4_t operator-(const Quad_a4_t &b) {231_Quad lhs = (*this).q;232_Quad rhs = b.q;233return (Quad_a4_t)(lhs - rhs);234}235Quad_a4_t operator*(const Quad_a4_t &b) {236_Quad lhs = (*this).q;237_Quad rhs = b.q;238return (Quad_a4_t)(lhs * rhs);239}240241Quad_a4_t operator/(const Quad_a4_t &b) {242_Quad lhs = (*this).q;243_Quad rhs = b.q;244return (Quad_a4_t)(lhs / rhs);245}246};247248struct KMP_DO_ALIGN(4) kmp_cmplx128_a4_t {249kmp_cmplx128 q;250251kmp_cmplx128_a4_t() : q() {}252253#if defined(__cplusplus) && (KMP_OS_WINDOWS)254kmp_cmplx128_a4_t(const std::complex<_Quad> &c128) : q(c128) {}255#endif256kmp_cmplx128_a4_t(const kmp_cmplx128 &c128) : q(c128) {}257258kmp_cmplx128_a4_t operator+(const kmp_cmplx128_a4_t &b) {259kmp_cmplx128 lhs = (*this).q;260kmp_cmplx128 rhs = b.q;261return (kmp_cmplx128_a4_t)(lhs + rhs);262}263kmp_cmplx128_a4_t operator-(const kmp_cmplx128_a4_t &b) {264kmp_cmplx128 lhs = (*this).q;265kmp_cmplx128 rhs = b.q;266return (kmp_cmplx128_a4_t)(lhs - rhs);267}268kmp_cmplx128_a4_t operator*(const kmp_cmplx128_a4_t &b) {269kmp_cmplx128 lhs = (*this).q;270kmp_cmplx128 rhs = b.q;271return (kmp_cmplx128_a4_t)(lhs * rhs);272}273274kmp_cmplx128_a4_t operator/(const kmp_cmplx128_a4_t &b) {275kmp_cmplx128 lhs = (*this).q;276kmp_cmplx128 rhs = b.q;277return (kmp_cmplx128_a4_t)(lhs / rhs);278}279};280281#pragma pack(pop)282283// New 16-byte aligned structures for 12.0 compiler.284struct KMP_DO_ALIGN(16) Quad_a16_t {285_Quad q;286287Quad_a16_t() : q() {}288Quad_a16_t(const _Quad &cq) : q(cq) {}289290Quad_a16_t operator+(const Quad_a16_t &b) {291_Quad lhs = (*this).q;292_Quad rhs = b.q;293return (Quad_a16_t)(lhs + rhs);294}295296Quad_a16_t operator-(const Quad_a16_t &b) {297_Quad lhs = (*this).q;298_Quad rhs = b.q;299return (Quad_a16_t)(lhs - rhs);300}301Quad_a16_t operator*(const Quad_a16_t &b) {302_Quad lhs = (*this).q;303_Quad rhs = b.q;304return (Quad_a16_t)(lhs * rhs);305}306307Quad_a16_t operator/(const Quad_a16_t &b) {308_Quad lhs = (*this).q;309_Quad rhs = b.q;310return (Quad_a16_t)(lhs / rhs);311}312};313314struct KMP_DO_ALIGN(16) kmp_cmplx128_a16_t {315kmp_cmplx128 q;316317kmp_cmplx128_a16_t() : q() {}318319#if defined(__cplusplus) && (KMP_OS_WINDOWS)320kmp_cmplx128_a16_t(const std::complex<_Quad> &c128) : q(c128) {}321#endif322kmp_cmplx128_a16_t(const kmp_cmplx128 &c128) : q(c128) {}323324kmp_cmplx128_a16_t operator+(const kmp_cmplx128_a16_t &b) {325kmp_cmplx128 lhs = (*this).q;326kmp_cmplx128 rhs = b.q;327return (kmp_cmplx128_a16_t)(lhs + rhs);328}329kmp_cmplx128_a16_t operator-(const kmp_cmplx128_a16_t &b) {330kmp_cmplx128 lhs = (*this).q;331kmp_cmplx128 rhs = b.q;332return (kmp_cmplx128_a16_t)(lhs - rhs);333}334kmp_cmplx128_a16_t operator*(const kmp_cmplx128_a16_t &b) {335kmp_cmplx128 lhs = (*this).q;336kmp_cmplx128 rhs = b.q;337return (kmp_cmplx128_a16_t)(lhs * rhs);338}339340kmp_cmplx128_a16_t operator/(const kmp_cmplx128_a16_t &b) {341kmp_cmplx128 lhs = (*this).q;342kmp_cmplx128 rhs = b.q;343return (kmp_cmplx128_a16_t)(lhs / rhs);344}345};346347#endif348349#if (KMP_ARCH_X86)350#define QUAD_LEGACY Quad_a4_t351#define CPLX128_LEG kmp_cmplx128_a4_t352#else353#define QUAD_LEGACY _Quad354#define CPLX128_LEG kmp_cmplx128355#endif356357#ifdef __cplusplus358extern "C" {359#endif360361extern int __kmp_atomic_mode;362363// Atomic locks can easily become contended, so we use queuing locks for them.364typedef kmp_queuing_lock_t kmp_atomic_lock_t;365366static inline void __kmp_acquire_atomic_lock(kmp_atomic_lock_t *lck,367kmp_int32 gtid) {368#if OMPT_SUPPORT && OMPT_OPTIONAL369if (ompt_enabled.ompt_callback_mutex_acquire) {370ompt_callbacks.ompt_callback(ompt_callback_mutex_acquire)(371ompt_mutex_atomic, 0, kmp_mutex_impl_queuing,372(ompt_wait_id_t)(uintptr_t)lck, OMPT_GET_RETURN_ADDRESS(0));373}374#endif375376__kmp_acquire_queuing_lock(lck, gtid);377378#if OMPT_SUPPORT && OMPT_OPTIONAL379if (ompt_enabled.ompt_callback_mutex_acquired) {380ompt_callbacks.ompt_callback(ompt_callback_mutex_acquired)(381ompt_mutex_atomic, (ompt_wait_id_t)(uintptr_t)lck,382OMPT_GET_RETURN_ADDRESS(0));383}384#endif385}386387static inline int __kmp_test_atomic_lock(kmp_atomic_lock_t *lck,388kmp_int32 gtid) {389return __kmp_test_queuing_lock(lck, gtid);390}391392static inline void __kmp_release_atomic_lock(kmp_atomic_lock_t *lck,393kmp_int32 gtid) {394__kmp_release_queuing_lock(lck, gtid);395#if OMPT_SUPPORT && OMPT_OPTIONAL396if (ompt_enabled.ompt_callback_mutex_released) {397ompt_callbacks.ompt_callback(ompt_callback_mutex_released)(398ompt_mutex_atomic, (ompt_wait_id_t)(uintptr_t)lck,399OMPT_GET_RETURN_ADDRESS(0));400}401#endif402}403404static inline void __kmp_init_atomic_lock(kmp_atomic_lock_t *lck) {405__kmp_init_queuing_lock(lck);406}407408static inline void __kmp_destroy_atomic_lock(kmp_atomic_lock_t *lck) {409__kmp_destroy_queuing_lock(lck);410}411412// Global Locks413extern kmp_atomic_lock_t __kmp_atomic_lock; /* Control access to all user coded414atomics in Gnu compat mode */415extern kmp_atomic_lock_t __kmp_atomic_lock_1i; /* Control access to all user416coded atomics for 1-byte fixed417data types */418extern kmp_atomic_lock_t __kmp_atomic_lock_2i; /* Control access to all user419coded atomics for 2-byte fixed420data types */421extern kmp_atomic_lock_t __kmp_atomic_lock_4i; /* Control access to all user422coded atomics for 4-byte fixed423data types */424extern kmp_atomic_lock_t __kmp_atomic_lock_4r; /* Control access to all user425coded atomics for kmp_real32426data type */427extern kmp_atomic_lock_t __kmp_atomic_lock_8i; /* Control access to all user428coded atomics for 8-byte fixed429data types */430extern kmp_atomic_lock_t __kmp_atomic_lock_8r; /* Control access to all user431coded atomics for kmp_real64432data type */433extern kmp_atomic_lock_t434__kmp_atomic_lock_8c; /* Control access to all user coded atomics for435complex byte data type */436extern kmp_atomic_lock_t437__kmp_atomic_lock_10r; /* Control access to all user coded atomics for long438double data type */439extern kmp_atomic_lock_t __kmp_atomic_lock_16r; /* Control access to all user440coded atomics for _Quad data441type */442extern kmp_atomic_lock_t __kmp_atomic_lock_16c; /* Control access to all user443coded atomics for double444complex data type*/445extern kmp_atomic_lock_t446__kmp_atomic_lock_20c; /* Control access to all user coded atomics for long447double complex type*/448extern kmp_atomic_lock_t __kmp_atomic_lock_32c; /* Control access to all user449coded atomics for _Quad450complex data type */451452// Below routines for atomic UPDATE are listed453454// 1-byte455void __kmpc_atomic_fixed1_add(ident_t *id_ref, int gtid, char *lhs, char rhs);456void __kmpc_atomic_fixed1_andb(ident_t *id_ref, int gtid, char *lhs, char rhs);457void __kmpc_atomic_fixed1_div(ident_t *id_ref, int gtid, char *lhs, char rhs);458void __kmpc_atomic_fixed1u_div(ident_t *id_ref, int gtid, unsigned char *lhs,459unsigned char rhs);460void __kmpc_atomic_fixed1_mul(ident_t *id_ref, int gtid, char *lhs, char rhs);461void __kmpc_atomic_fixed1_orb(ident_t *id_ref, int gtid, char *lhs, char rhs);462void __kmpc_atomic_fixed1_shl(ident_t *id_ref, int gtid, char *lhs, char rhs);463void __kmpc_atomic_fixed1_shr(ident_t *id_ref, int gtid, char *lhs, char rhs);464void __kmpc_atomic_fixed1u_shr(ident_t *id_ref, int gtid, unsigned char *lhs,465unsigned char rhs);466void __kmpc_atomic_fixed1_sub(ident_t *id_ref, int gtid, char *lhs, char rhs);467void __kmpc_atomic_fixed1_xor(ident_t *id_ref, int gtid, char *lhs, char rhs);468// 2-byte469void __kmpc_atomic_fixed2_add(ident_t *id_ref, int gtid, short *lhs, short rhs);470void __kmpc_atomic_fixed2_andb(ident_t *id_ref, int gtid, short *lhs,471short rhs);472void __kmpc_atomic_fixed2_div(ident_t *id_ref, int gtid, short *lhs, short rhs);473void __kmpc_atomic_fixed2u_div(ident_t *id_ref, int gtid, unsigned short *lhs,474unsigned short rhs);475void __kmpc_atomic_fixed2_mul(ident_t *id_ref, int gtid, short *lhs, short rhs);476void __kmpc_atomic_fixed2_orb(ident_t *id_ref, int gtid, short *lhs, short rhs);477void __kmpc_atomic_fixed2_shl(ident_t *id_ref, int gtid, short *lhs, short rhs);478void __kmpc_atomic_fixed2_shr(ident_t *id_ref, int gtid, short *lhs, short rhs);479void __kmpc_atomic_fixed2u_shr(ident_t *id_ref, int gtid, unsigned short *lhs,480unsigned short rhs);481void __kmpc_atomic_fixed2_sub(ident_t *id_ref, int gtid, short *lhs, short rhs);482void __kmpc_atomic_fixed2_xor(ident_t *id_ref, int gtid, short *lhs, short rhs);483// 4-byte add / sub fixed484void __kmpc_atomic_fixed4_add(ident_t *id_ref, int gtid, kmp_int32 *lhs,485kmp_int32 rhs);486void __kmpc_atomic_fixed4_sub(ident_t *id_ref, int gtid, kmp_int32 *lhs,487kmp_int32 rhs);488// 4-byte add / sub float489void __kmpc_atomic_float4_add(ident_t *id_ref, int gtid, kmp_real32 *lhs,490kmp_real32 rhs);491void __kmpc_atomic_float4_sub(ident_t *id_ref, int gtid, kmp_real32 *lhs,492kmp_real32 rhs);493// 8-byte add / sub fixed494void __kmpc_atomic_fixed8_add(ident_t *id_ref, int gtid, kmp_int64 *lhs,495kmp_int64 rhs);496void __kmpc_atomic_fixed8_sub(ident_t *id_ref, int gtid, kmp_int64 *lhs,497kmp_int64 rhs);498// 8-byte add / sub float499void __kmpc_atomic_float8_add(ident_t *id_ref, int gtid, kmp_real64 *lhs,500kmp_real64 rhs);501void __kmpc_atomic_float8_sub(ident_t *id_ref, int gtid, kmp_real64 *lhs,502kmp_real64 rhs);503// 4-byte fixed504void __kmpc_atomic_fixed4_andb(ident_t *id_ref, int gtid, kmp_int32 *lhs,505kmp_int32 rhs);506void __kmpc_atomic_fixed4_div(ident_t *id_ref, int gtid, kmp_int32 *lhs,507kmp_int32 rhs);508void __kmpc_atomic_fixed4u_div(ident_t *id_ref, int gtid, kmp_uint32 *lhs,509kmp_uint32 rhs);510void __kmpc_atomic_fixed4_mul(ident_t *id_ref, int gtid, kmp_int32 *lhs,511kmp_int32 rhs);512void __kmpc_atomic_fixed4_orb(ident_t *id_ref, int gtid, kmp_int32 *lhs,513kmp_int32 rhs);514void __kmpc_atomic_fixed4_shl(ident_t *id_ref, int gtid, kmp_int32 *lhs,515kmp_int32 rhs);516void __kmpc_atomic_fixed4_shr(ident_t *id_ref, int gtid, kmp_int32 *lhs,517kmp_int32 rhs);518void __kmpc_atomic_fixed4u_shr(ident_t *id_ref, int gtid, kmp_uint32 *lhs,519kmp_uint32 rhs);520void __kmpc_atomic_fixed4_xor(ident_t *id_ref, int gtid, kmp_int32 *lhs,521kmp_int32 rhs);522// 8-byte fixed523void __kmpc_atomic_fixed8_andb(ident_t *id_ref, int gtid, kmp_int64 *lhs,524kmp_int64 rhs);525void __kmpc_atomic_fixed8_div(ident_t *id_ref, int gtid, kmp_int64 *lhs,526kmp_int64 rhs);527void __kmpc_atomic_fixed8u_div(ident_t *id_ref, int gtid, kmp_uint64 *lhs,528kmp_uint64 rhs);529void __kmpc_atomic_fixed8_mul(ident_t *id_ref, int gtid, kmp_int64 *lhs,530kmp_int64 rhs);531void __kmpc_atomic_fixed8_orb(ident_t *id_ref, int gtid, kmp_int64 *lhs,532kmp_int64 rhs);533void __kmpc_atomic_fixed8_shl(ident_t *id_ref, int gtid, kmp_int64 *lhs,534kmp_int64 rhs);535void __kmpc_atomic_fixed8_shr(ident_t *id_ref, int gtid, kmp_int64 *lhs,536kmp_int64 rhs);537void __kmpc_atomic_fixed8u_shr(ident_t *id_ref, int gtid, kmp_uint64 *lhs,538kmp_uint64 rhs);539void __kmpc_atomic_fixed8_xor(ident_t *id_ref, int gtid, kmp_int64 *lhs,540kmp_int64 rhs);541// 4-byte float542void __kmpc_atomic_float4_div(ident_t *id_ref, int gtid, kmp_real32 *lhs,543kmp_real32 rhs);544void __kmpc_atomic_float4_mul(ident_t *id_ref, int gtid, kmp_real32 *lhs,545kmp_real32 rhs);546// 8-byte float547void __kmpc_atomic_float8_div(ident_t *id_ref, int gtid, kmp_real64 *lhs,548kmp_real64 rhs);549void __kmpc_atomic_float8_mul(ident_t *id_ref, int gtid, kmp_real64 *lhs,550kmp_real64 rhs);551// 1-, 2-, 4-, 8-byte logical (&&, ||)552void __kmpc_atomic_fixed1_andl(ident_t *id_ref, int gtid, char *lhs, char rhs);553void __kmpc_atomic_fixed1_orl(ident_t *id_ref, int gtid, char *lhs, char rhs);554void __kmpc_atomic_fixed2_andl(ident_t *id_ref, int gtid, short *lhs,555short rhs);556void __kmpc_atomic_fixed2_orl(ident_t *id_ref, int gtid, short *lhs, short rhs);557void __kmpc_atomic_fixed4_andl(ident_t *id_ref, int gtid, kmp_int32 *lhs,558kmp_int32 rhs);559void __kmpc_atomic_fixed4_orl(ident_t *id_ref, int gtid, kmp_int32 *lhs,560kmp_int32 rhs);561void __kmpc_atomic_fixed8_andl(ident_t *id_ref, int gtid, kmp_int64 *lhs,562kmp_int64 rhs);563void __kmpc_atomic_fixed8_orl(ident_t *id_ref, int gtid, kmp_int64 *lhs,564kmp_int64 rhs);565// MIN / MAX566void __kmpc_atomic_fixed1_max(ident_t *id_ref, int gtid, char *lhs, char rhs);567void __kmpc_atomic_fixed1_min(ident_t *id_ref, int gtid, char *lhs, char rhs);568void __kmpc_atomic_fixed2_max(ident_t *id_ref, int gtid, short *lhs, short rhs);569void __kmpc_atomic_fixed2_min(ident_t *id_ref, int gtid, short *lhs, short rhs);570void __kmpc_atomic_fixed4_max(ident_t *id_ref, int gtid, kmp_int32 *lhs,571kmp_int32 rhs);572void __kmpc_atomic_fixed4_min(ident_t *id_ref, int gtid, kmp_int32 *lhs,573kmp_int32 rhs);574void __kmpc_atomic_fixed8_max(ident_t *id_ref, int gtid, kmp_int64 *lhs,575kmp_int64 rhs);576void __kmpc_atomic_fixed8_min(ident_t *id_ref, int gtid, kmp_int64 *lhs,577kmp_int64 rhs);578void __kmpc_atomic_float4_max(ident_t *id_ref, int gtid, kmp_real32 *lhs,579kmp_real32 rhs);580void __kmpc_atomic_float4_min(ident_t *id_ref, int gtid, kmp_real32 *lhs,581kmp_real32 rhs);582void __kmpc_atomic_float8_max(ident_t *id_ref, int gtid, kmp_real64 *lhs,583kmp_real64 rhs);584void __kmpc_atomic_float8_min(ident_t *id_ref, int gtid, kmp_real64 *lhs,585kmp_real64 rhs);586void __kmpc_atomic_float10_max(ident_t *id_ref, int gtid, long double *lhs,587long double rhs);588void __kmpc_atomic_float10_min(ident_t *id_ref, int gtid, long double *lhs,589long double rhs);590#if KMP_HAVE_QUAD591void __kmpc_atomic_float16_max(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,592QUAD_LEGACY rhs);593void __kmpc_atomic_float16_min(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,594QUAD_LEGACY rhs);595#if (KMP_ARCH_X86)596// Routines with 16-byte arguments aligned to 16-byte boundary; IA-32597// architecture only598void __kmpc_atomic_float16_max_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,599Quad_a16_t rhs);600void __kmpc_atomic_float16_min_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,601Quad_a16_t rhs);602#endif603#endif604// .NEQV. (same as xor)605void __kmpc_atomic_fixed1_neqv(ident_t *id_ref, int gtid, char *lhs, char rhs);606void __kmpc_atomic_fixed2_neqv(ident_t *id_ref, int gtid, short *lhs,607short rhs);608void __kmpc_atomic_fixed4_neqv(ident_t *id_ref, int gtid, kmp_int32 *lhs,609kmp_int32 rhs);610void __kmpc_atomic_fixed8_neqv(ident_t *id_ref, int gtid, kmp_int64 *lhs,611kmp_int64 rhs);612// .EQV. (same as ~xor)613void __kmpc_atomic_fixed1_eqv(ident_t *id_ref, int gtid, char *lhs, char rhs);614void __kmpc_atomic_fixed2_eqv(ident_t *id_ref, int gtid, short *lhs, short rhs);615void __kmpc_atomic_fixed4_eqv(ident_t *id_ref, int gtid, kmp_int32 *lhs,616kmp_int32 rhs);617void __kmpc_atomic_fixed8_eqv(ident_t *id_ref, int gtid, kmp_int64 *lhs,618kmp_int64 rhs);619// long double type620void __kmpc_atomic_float10_add(ident_t *id_ref, int gtid, long double *lhs,621long double rhs);622void __kmpc_atomic_float10_sub(ident_t *id_ref, int gtid, long double *lhs,623long double rhs);624void __kmpc_atomic_float10_mul(ident_t *id_ref, int gtid, long double *lhs,625long double rhs);626void __kmpc_atomic_float10_div(ident_t *id_ref, int gtid, long double *lhs,627long double rhs);628// _Quad type629#if KMP_HAVE_QUAD630void __kmpc_atomic_float16_add(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,631QUAD_LEGACY rhs);632void __kmpc_atomic_float16_sub(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,633QUAD_LEGACY rhs);634void __kmpc_atomic_float16_mul(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,635QUAD_LEGACY rhs);636void __kmpc_atomic_float16_div(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,637QUAD_LEGACY rhs);638#if (KMP_ARCH_X86)639// Routines with 16-byte arguments aligned to 16-byte boundary640void __kmpc_atomic_float16_add_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,641Quad_a16_t rhs);642void __kmpc_atomic_float16_sub_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,643Quad_a16_t rhs);644void __kmpc_atomic_float16_mul_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,645Quad_a16_t rhs);646void __kmpc_atomic_float16_div_a16(ident_t *id_ref, int gtid, Quad_a16_t *lhs,647Quad_a16_t rhs);648#endif649#endif650// routines for complex types651void __kmpc_atomic_cmplx4_add(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,652kmp_cmplx32 rhs);653void __kmpc_atomic_cmplx4_sub(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,654kmp_cmplx32 rhs);655void __kmpc_atomic_cmplx4_mul(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,656kmp_cmplx32 rhs);657void __kmpc_atomic_cmplx4_div(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,658kmp_cmplx32 rhs);659void __kmpc_atomic_cmplx8_add(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,660kmp_cmplx64 rhs);661void __kmpc_atomic_cmplx8_sub(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,662kmp_cmplx64 rhs);663void __kmpc_atomic_cmplx8_mul(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,664kmp_cmplx64 rhs);665void __kmpc_atomic_cmplx8_div(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,666kmp_cmplx64 rhs);667void __kmpc_atomic_cmplx10_add(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,668kmp_cmplx80 rhs);669void __kmpc_atomic_cmplx10_sub(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,670kmp_cmplx80 rhs);671void __kmpc_atomic_cmplx10_mul(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,672kmp_cmplx80 rhs);673void __kmpc_atomic_cmplx10_div(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,674kmp_cmplx80 rhs);675#if KMP_HAVE_QUAD676void __kmpc_atomic_cmplx16_add(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,677CPLX128_LEG rhs);678void __kmpc_atomic_cmplx16_sub(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,679CPLX128_LEG rhs);680void __kmpc_atomic_cmplx16_mul(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,681CPLX128_LEG rhs);682void __kmpc_atomic_cmplx16_div(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,683CPLX128_LEG rhs);684#if (KMP_ARCH_X86)685// Routines with 16-byte arguments aligned to 16-byte boundary686void __kmpc_atomic_cmplx16_add_a16(ident_t *id_ref, int gtid,687kmp_cmplx128_a16_t *lhs,688kmp_cmplx128_a16_t rhs);689void __kmpc_atomic_cmplx16_sub_a16(ident_t *id_ref, int gtid,690kmp_cmplx128_a16_t *lhs,691kmp_cmplx128_a16_t rhs);692void __kmpc_atomic_cmplx16_mul_a16(ident_t *id_ref, int gtid,693kmp_cmplx128_a16_t *lhs,694kmp_cmplx128_a16_t rhs);695void __kmpc_atomic_cmplx16_div_a16(ident_t *id_ref, int gtid,696kmp_cmplx128_a16_t *lhs,697kmp_cmplx128_a16_t rhs);698#endif699#endif700701// OpenMP 4.0: x = expr binop x for non-commutative operations.702// Supported only on IA-32 architecture and Intel(R) 64703#if KMP_ARCH_X86 || KMP_ARCH_X86_64704705void __kmpc_atomic_fixed1_sub_rev(ident_t *id_ref, int gtid, char *lhs,706char rhs);707void __kmpc_atomic_fixed1_div_rev(ident_t *id_ref, int gtid, char *lhs,708char rhs);709void __kmpc_atomic_fixed1u_div_rev(ident_t *id_ref, int gtid,710unsigned char *lhs, unsigned char rhs);711void __kmpc_atomic_fixed1_shl_rev(ident_t *id_ref, int gtid, char *lhs,712char rhs);713void __kmpc_atomic_fixed1_shr_rev(ident_t *id_ref, int gtid, char *lhs,714char rhs);715void __kmpc_atomic_fixed1u_shr_rev(ident_t *id_ref, int gtid,716unsigned char *lhs, unsigned char rhs);717void __kmpc_atomic_fixed2_sub_rev(ident_t *id_ref, int gtid, short *lhs,718short rhs);719void __kmpc_atomic_fixed2_div_rev(ident_t *id_ref, int gtid, short *lhs,720short rhs);721void __kmpc_atomic_fixed2u_div_rev(ident_t *id_ref, int gtid,722unsigned short *lhs, unsigned short rhs);723void __kmpc_atomic_fixed2_shl_rev(ident_t *id_ref, int gtid, short *lhs,724short rhs);725void __kmpc_atomic_fixed2_shr_rev(ident_t *id_ref, int gtid, short *lhs,726short rhs);727void __kmpc_atomic_fixed2u_shr_rev(ident_t *id_ref, int gtid,728unsigned short *lhs, unsigned short rhs);729void __kmpc_atomic_fixed4_sub_rev(ident_t *id_ref, int gtid, kmp_int32 *lhs,730kmp_int32 rhs);731void __kmpc_atomic_fixed4_div_rev(ident_t *id_ref, int gtid, kmp_int32 *lhs,732kmp_int32 rhs);733void __kmpc_atomic_fixed4u_div_rev(ident_t *id_ref, int gtid, kmp_uint32 *lhs,734kmp_uint32 rhs);735void __kmpc_atomic_fixed4_shl_rev(ident_t *id_ref, int gtid, kmp_int32 *lhs,736kmp_int32 rhs);737void __kmpc_atomic_fixed4_shr_rev(ident_t *id_ref, int gtid, kmp_int32 *lhs,738kmp_int32 rhs);739void __kmpc_atomic_fixed4u_shr_rev(ident_t *id_ref, int gtid, kmp_uint32 *lhs,740kmp_uint32 rhs);741void __kmpc_atomic_fixed8_sub_rev(ident_t *id_ref, int gtid, kmp_int64 *lhs,742kmp_int64 rhs);743void __kmpc_atomic_fixed8_div_rev(ident_t *id_ref, int gtid, kmp_int64 *lhs,744kmp_int64 rhs);745void __kmpc_atomic_fixed8u_div_rev(ident_t *id_ref, int gtid, kmp_uint64 *lhs,746kmp_uint64 rhs);747void __kmpc_atomic_fixed8_shl_rev(ident_t *id_ref, int gtid, kmp_int64 *lhs,748kmp_int64 rhs);749void __kmpc_atomic_fixed8_shr_rev(ident_t *id_ref, int gtid, kmp_int64 *lhs,750kmp_int64 rhs);751void __kmpc_atomic_fixed8u_shr_rev(ident_t *id_ref, int gtid, kmp_uint64 *lhs,752kmp_uint64 rhs);753void __kmpc_atomic_float4_sub_rev(ident_t *id_ref, int gtid, float *lhs,754float rhs);755void __kmpc_atomic_float4_div_rev(ident_t *id_ref, int gtid, float *lhs,756float rhs);757void __kmpc_atomic_float8_sub_rev(ident_t *id_ref, int gtid, double *lhs,758double rhs);759void __kmpc_atomic_float8_div_rev(ident_t *id_ref, int gtid, double *lhs,760double rhs);761void __kmpc_atomic_float10_sub_rev(ident_t *id_ref, int gtid, long double *lhs,762long double rhs);763void __kmpc_atomic_float10_div_rev(ident_t *id_ref, int gtid, long double *lhs,764long double rhs);765#if KMP_HAVE_QUAD766void __kmpc_atomic_float16_sub_rev(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,767QUAD_LEGACY rhs);768void __kmpc_atomic_float16_div_rev(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,769QUAD_LEGACY rhs);770#endif771void __kmpc_atomic_cmplx4_sub_rev(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,772kmp_cmplx32 rhs);773void __kmpc_atomic_cmplx4_div_rev(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,774kmp_cmplx32 rhs);775void __kmpc_atomic_cmplx8_sub_rev(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,776kmp_cmplx64 rhs);777void __kmpc_atomic_cmplx8_div_rev(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,778kmp_cmplx64 rhs);779void __kmpc_atomic_cmplx10_sub_rev(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,780kmp_cmplx80 rhs);781void __kmpc_atomic_cmplx10_div_rev(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,782kmp_cmplx80 rhs);783#if KMP_HAVE_QUAD784void __kmpc_atomic_cmplx16_sub_rev(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,785CPLX128_LEG rhs);786void __kmpc_atomic_cmplx16_div_rev(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,787CPLX128_LEG rhs);788#if (KMP_ARCH_X86)789// Routines with 16-byte arguments aligned to 16-byte boundary790void __kmpc_atomic_float16_sub_a16_rev(ident_t *id_ref, int gtid,791Quad_a16_t *lhs, Quad_a16_t rhs);792void __kmpc_atomic_float16_div_a16_rev(ident_t *id_ref, int gtid,793Quad_a16_t *lhs, Quad_a16_t rhs);794void __kmpc_atomic_cmplx16_sub_a16_rev(ident_t *id_ref, int gtid,795kmp_cmplx128_a16_t *lhs,796kmp_cmplx128_a16_t rhs);797void __kmpc_atomic_cmplx16_div_a16_rev(ident_t *id_ref, int gtid,798kmp_cmplx128_a16_t *lhs,799kmp_cmplx128_a16_t rhs);800#endif801#endif // KMP_HAVE_QUAD802803#endif // KMP_ARCH_X86 || KMP_ARCH_X86_64804805// routines for mixed types806807// RHS=float8808void __kmpc_atomic_fixed1_mul_float8(ident_t *id_ref, int gtid, char *lhs,809kmp_real64 rhs);810void __kmpc_atomic_fixed1_div_float8(ident_t *id_ref, int gtid, char *lhs,811kmp_real64 rhs);812void __kmpc_atomic_fixed2_mul_float8(ident_t *id_ref, int gtid, short *lhs,813kmp_real64 rhs);814void __kmpc_atomic_fixed2_div_float8(ident_t *id_ref, int gtid, short *lhs,815kmp_real64 rhs);816void __kmpc_atomic_fixed4_mul_float8(ident_t *id_ref, int gtid, kmp_int32 *lhs,817kmp_real64 rhs);818void __kmpc_atomic_fixed4_div_float8(ident_t *id_ref, int gtid, kmp_int32 *lhs,819kmp_real64 rhs);820void __kmpc_atomic_fixed8_mul_float8(ident_t *id_ref, int gtid, kmp_int64 *lhs,821kmp_real64 rhs);822void __kmpc_atomic_fixed8_div_float8(ident_t *id_ref, int gtid, kmp_int64 *lhs,823kmp_real64 rhs);824void __kmpc_atomic_float4_add_float8(ident_t *id_ref, int gtid, kmp_real32 *lhs,825kmp_real64 rhs);826void __kmpc_atomic_float4_sub_float8(ident_t *id_ref, int gtid, kmp_real32 *lhs,827kmp_real64 rhs);828void __kmpc_atomic_float4_mul_float8(ident_t *id_ref, int gtid, kmp_real32 *lhs,829kmp_real64 rhs);830void __kmpc_atomic_float4_div_float8(ident_t *id_ref, int gtid, kmp_real32 *lhs,831kmp_real64 rhs);832833// RHS=float16 (deprecated, to be removed when we are sure the compiler does not834// use them)835#if KMP_HAVE_QUAD836void __kmpc_atomic_fixed1_add_fp(ident_t *id_ref, int gtid, char *lhs,837_Quad rhs);838void __kmpc_atomic_fixed1u_add_fp(ident_t *id_ref, int gtid, unsigned char *lhs,839_Quad rhs);840void __kmpc_atomic_fixed1_sub_fp(ident_t *id_ref, int gtid, char *lhs,841_Quad rhs);842void __kmpc_atomic_fixed1u_sub_fp(ident_t *id_ref, int gtid, unsigned char *lhs,843_Quad rhs);844void __kmpc_atomic_fixed1_mul_fp(ident_t *id_ref, int gtid, char *lhs,845_Quad rhs);846void __kmpc_atomic_fixed1u_mul_fp(ident_t *id_ref, int gtid, unsigned char *lhs,847_Quad rhs);848void __kmpc_atomic_fixed1_div_fp(ident_t *id_ref, int gtid, char *lhs,849_Quad rhs);850void __kmpc_atomic_fixed1u_div_fp(ident_t *id_ref, int gtid, unsigned char *lhs,851_Quad rhs);852853void __kmpc_atomic_fixed2_add_fp(ident_t *id_ref, int gtid, short *lhs,854_Quad rhs);855void __kmpc_atomic_fixed2u_add_fp(ident_t *id_ref, int gtid,856unsigned short *lhs, _Quad rhs);857void __kmpc_atomic_fixed2_sub_fp(ident_t *id_ref, int gtid, short *lhs,858_Quad rhs);859void __kmpc_atomic_fixed2u_sub_fp(ident_t *id_ref, int gtid,860unsigned short *lhs, _Quad rhs);861void __kmpc_atomic_fixed2_mul_fp(ident_t *id_ref, int gtid, short *lhs,862_Quad rhs);863void __kmpc_atomic_fixed2u_mul_fp(ident_t *id_ref, int gtid,864unsigned short *lhs, _Quad rhs);865void __kmpc_atomic_fixed2_div_fp(ident_t *id_ref, int gtid, short *lhs,866_Quad rhs);867void __kmpc_atomic_fixed2u_div_fp(ident_t *id_ref, int gtid,868unsigned short *lhs, _Quad rhs);869870void __kmpc_atomic_fixed4_add_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,871_Quad rhs);872void __kmpc_atomic_fixed4u_add_fp(ident_t *id_ref, int gtid, kmp_uint32 *lhs,873_Quad rhs);874void __kmpc_atomic_fixed4_sub_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,875_Quad rhs);876void __kmpc_atomic_fixed4u_sub_fp(ident_t *id_ref, int gtid, kmp_uint32 *lhs,877_Quad rhs);878void __kmpc_atomic_fixed4_mul_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,879_Quad rhs);880void __kmpc_atomic_fixed4u_mul_fp(ident_t *id_ref, int gtid, kmp_uint32 *lhs,881_Quad rhs);882void __kmpc_atomic_fixed4_div_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,883_Quad rhs);884void __kmpc_atomic_fixed4u_div_fp(ident_t *id_ref, int gtid, kmp_uint32 *lhs,885_Quad rhs);886887void __kmpc_atomic_fixed8_add_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,888_Quad rhs);889void __kmpc_atomic_fixed8u_add_fp(ident_t *id_ref, int gtid, kmp_uint64 *lhs,890_Quad rhs);891void __kmpc_atomic_fixed8_sub_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,892_Quad rhs);893void __kmpc_atomic_fixed8u_sub_fp(ident_t *id_ref, int gtid, kmp_uint64 *lhs,894_Quad rhs);895void __kmpc_atomic_fixed8_mul_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,896_Quad rhs);897void __kmpc_atomic_fixed8u_mul_fp(ident_t *id_ref, int gtid, kmp_uint64 *lhs,898_Quad rhs);899void __kmpc_atomic_fixed8_div_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,900_Quad rhs);901void __kmpc_atomic_fixed8u_div_fp(ident_t *id_ref, int gtid, kmp_uint64 *lhs,902_Quad rhs);903904void __kmpc_atomic_float4_add_fp(ident_t *id_ref, int gtid, kmp_real32 *lhs,905_Quad rhs);906void __kmpc_atomic_float4_sub_fp(ident_t *id_ref, int gtid, kmp_real32 *lhs,907_Quad rhs);908void __kmpc_atomic_float4_mul_fp(ident_t *id_ref, int gtid, kmp_real32 *lhs,909_Quad rhs);910void __kmpc_atomic_float4_div_fp(ident_t *id_ref, int gtid, kmp_real32 *lhs,911_Quad rhs);912913void __kmpc_atomic_float8_add_fp(ident_t *id_ref, int gtid, kmp_real64 *lhs,914_Quad rhs);915void __kmpc_atomic_float8_sub_fp(ident_t *id_ref, int gtid, kmp_real64 *lhs,916_Quad rhs);917void __kmpc_atomic_float8_mul_fp(ident_t *id_ref, int gtid, kmp_real64 *lhs,918_Quad rhs);919void __kmpc_atomic_float8_div_fp(ident_t *id_ref, int gtid, kmp_real64 *lhs,920_Quad rhs);921922void __kmpc_atomic_float10_add_fp(ident_t *id_ref, int gtid, long double *lhs,923_Quad rhs);924void __kmpc_atomic_float10_sub_fp(ident_t *id_ref, int gtid, long double *lhs,925_Quad rhs);926void __kmpc_atomic_float10_mul_fp(ident_t *id_ref, int gtid, long double *lhs,927_Quad rhs);928void __kmpc_atomic_float10_div_fp(ident_t *id_ref, int gtid, long double *lhs,929_Quad rhs);930931// Reverse operations932void __kmpc_atomic_fixed1_sub_rev_fp(ident_t *id_ref, int gtid, char *lhs,933_Quad rhs);934void __kmpc_atomic_fixed1u_sub_rev_fp(ident_t *id_ref, int gtid,935unsigned char *lhs, _Quad rhs);936void __kmpc_atomic_fixed1_div_rev_fp(ident_t *id_ref, int gtid, char *lhs,937_Quad rhs);938void __kmpc_atomic_fixed1u_div_rev_fp(ident_t *id_ref, int gtid,939unsigned char *lhs, _Quad rhs);940void __kmpc_atomic_fixed2_sub_rev_fp(ident_t *id_ref, int gtid, short *lhs,941_Quad rhs);942void __kmpc_atomic_fixed2u_sub_rev_fp(ident_t *id_ref, int gtid,943unsigned short *lhs, _Quad rhs);944void __kmpc_atomic_fixed2_div_rev_fp(ident_t *id_ref, int gtid, short *lhs,945_Quad rhs);946void __kmpc_atomic_fixed2u_div_rev_fp(ident_t *id_ref, int gtid,947unsigned short *lhs, _Quad rhs);948void __kmpc_atomic_fixed4_sub_rev_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,949_Quad rhs);950void __kmpc_atomic_fixed4u_sub_rev_fp(ident_t *id_ref, int gtid,951kmp_uint32 *lhs, _Quad rhs);952void __kmpc_atomic_fixed4_div_rev_fp(ident_t *id_ref, int gtid, kmp_int32 *lhs,953_Quad rhs);954void __kmpc_atomic_fixed4u_div_rev_fp(ident_t *id_ref, int gtid,955kmp_uint32 *lhs, _Quad rhs);956void __kmpc_atomic_fixed8_sub_rev_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,957_Quad rhs);958void __kmpc_atomic_fixed8u_sub_rev_fp(ident_t *id_ref, int gtid,959kmp_uint64 *lhs, _Quad rhs);960void __kmpc_atomic_fixed8_div_rev_fp(ident_t *id_ref, int gtid, kmp_int64 *lhs,961_Quad rhs);962void __kmpc_atomic_fixed8u_div_rev_fp(ident_t *id_ref, int gtid,963kmp_uint64 *lhs, _Quad rhs);964void __kmpc_atomic_float4_sub_rev_fp(ident_t *id_ref, int gtid, float *lhs,965_Quad rhs);966void __kmpc_atomic_float4_div_rev_fp(ident_t *id_ref, int gtid, float *lhs,967_Quad rhs);968void __kmpc_atomic_float8_sub_rev_fp(ident_t *id_ref, int gtid, double *lhs,969_Quad rhs);970void __kmpc_atomic_float8_div_rev_fp(ident_t *id_ref, int gtid, double *lhs,971_Quad rhs);972void __kmpc_atomic_float10_sub_rev_fp(ident_t *id_ref, int gtid,973long double *lhs, _Quad rhs);974void __kmpc_atomic_float10_div_rev_fp(ident_t *id_ref, int gtid,975long double *lhs, _Quad rhs);976977#endif // KMP_HAVE_QUAD978979// RHS=cmplx8980void __kmpc_atomic_cmplx4_add_cmplx8(ident_t *id_ref, int gtid,981kmp_cmplx32 *lhs, kmp_cmplx64 rhs);982void __kmpc_atomic_cmplx4_sub_cmplx8(ident_t *id_ref, int gtid,983kmp_cmplx32 *lhs, kmp_cmplx64 rhs);984void __kmpc_atomic_cmplx4_mul_cmplx8(ident_t *id_ref, int gtid,985kmp_cmplx32 *lhs, kmp_cmplx64 rhs);986void __kmpc_atomic_cmplx4_div_cmplx8(ident_t *id_ref, int gtid,987kmp_cmplx32 *lhs, kmp_cmplx64 rhs);988989// generic atomic routines990void __kmpc_atomic_1(ident_t *id_ref, int gtid, void *lhs, void *rhs,991void (*f)(void *, void *, void *));992void __kmpc_atomic_2(ident_t *id_ref, int gtid, void *lhs, void *rhs,993void (*f)(void *, void *, void *));994void __kmpc_atomic_4(ident_t *id_ref, int gtid, void *lhs, void *rhs,995void (*f)(void *, void *, void *));996void __kmpc_atomic_8(ident_t *id_ref, int gtid, void *lhs, void *rhs,997void (*f)(void *, void *, void *));998void __kmpc_atomic_10(ident_t *id_ref, int gtid, void *lhs, void *rhs,999void (*f)(void *, void *, void *));1000void __kmpc_atomic_16(ident_t *id_ref, int gtid, void *lhs, void *rhs,1001void (*f)(void *, void *, void *));1002void __kmpc_atomic_20(ident_t *id_ref, int gtid, void *lhs, void *rhs,1003void (*f)(void *, void *, void *));1004void __kmpc_atomic_32(ident_t *id_ref, int gtid, void *lhs, void *rhs,1005void (*f)(void *, void *, void *));10061007// READ, WRITE, CAPTURE10081009// Below routines for atomic READ are listed1010char __kmpc_atomic_fixed1_rd(ident_t *id_ref, int gtid, char *loc);1011short __kmpc_atomic_fixed2_rd(ident_t *id_ref, int gtid, short *loc);1012kmp_int32 __kmpc_atomic_fixed4_rd(ident_t *id_ref, int gtid, kmp_int32 *loc);1013kmp_int64 __kmpc_atomic_fixed8_rd(ident_t *id_ref, int gtid, kmp_int64 *loc);1014kmp_real32 __kmpc_atomic_float4_rd(ident_t *id_ref, int gtid, kmp_real32 *loc);1015kmp_real64 __kmpc_atomic_float8_rd(ident_t *id_ref, int gtid, kmp_real64 *loc);1016long double __kmpc_atomic_float10_rd(ident_t *id_ref, int gtid,1017long double *loc);1018#if KMP_HAVE_QUAD1019QUAD_LEGACY __kmpc_atomic_float16_rd(ident_t *id_ref, int gtid,1020QUAD_LEGACY *loc);1021#endif1022// Fix for CQ220361: cmplx4 READ will return void on Windows* OS; read value1023// will be returned through an additional parameter1024#if (KMP_OS_WINDOWS)1025void __kmpc_atomic_cmplx4_rd(kmp_cmplx32 *out, ident_t *id_ref, int gtid,1026kmp_cmplx32 *loc);1027#else1028kmp_cmplx32 __kmpc_atomic_cmplx4_rd(ident_t *id_ref, int gtid,1029kmp_cmplx32 *loc);1030#endif1031kmp_cmplx64 __kmpc_atomic_cmplx8_rd(ident_t *id_ref, int gtid,1032kmp_cmplx64 *loc);1033kmp_cmplx80 __kmpc_atomic_cmplx10_rd(ident_t *id_ref, int gtid,1034kmp_cmplx80 *loc);1035#if KMP_HAVE_QUAD1036CPLX128_LEG __kmpc_atomic_cmplx16_rd(ident_t *id_ref, int gtid,1037CPLX128_LEG *loc);1038#if (KMP_ARCH_X86)1039// Routines with 16-byte arguments aligned to 16-byte boundary1040Quad_a16_t __kmpc_atomic_float16_a16_rd(ident_t *id_ref, int gtid,1041Quad_a16_t *loc);1042kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_a16_rd(ident_t *id_ref, int gtid,1043kmp_cmplx128_a16_t *loc);1044#endif1045#endif10461047// Below routines for atomic WRITE are listed1048void __kmpc_atomic_fixed1_wr(ident_t *id_ref, int gtid, char *lhs, char rhs);1049void __kmpc_atomic_fixed2_wr(ident_t *id_ref, int gtid, short *lhs, short rhs);1050void __kmpc_atomic_fixed4_wr(ident_t *id_ref, int gtid, kmp_int32 *lhs,1051kmp_int32 rhs);1052void __kmpc_atomic_fixed8_wr(ident_t *id_ref, int gtid, kmp_int64 *lhs,1053kmp_int64 rhs);1054void __kmpc_atomic_float4_wr(ident_t *id_ref, int gtid, kmp_real32 *lhs,1055kmp_real32 rhs);1056void __kmpc_atomic_float8_wr(ident_t *id_ref, int gtid, kmp_real64 *lhs,1057kmp_real64 rhs);1058void __kmpc_atomic_float10_wr(ident_t *id_ref, int gtid, long double *lhs,1059long double rhs);1060#if KMP_HAVE_QUAD1061void __kmpc_atomic_float16_wr(ident_t *id_ref, int gtid, QUAD_LEGACY *lhs,1062QUAD_LEGACY rhs);1063#endif1064void __kmpc_atomic_cmplx4_wr(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,1065kmp_cmplx32 rhs);1066void __kmpc_atomic_cmplx8_wr(ident_t *id_ref, int gtid, kmp_cmplx64 *lhs,1067kmp_cmplx64 rhs);1068void __kmpc_atomic_cmplx10_wr(ident_t *id_ref, int gtid, kmp_cmplx80 *lhs,1069kmp_cmplx80 rhs);1070#if KMP_HAVE_QUAD1071void __kmpc_atomic_cmplx16_wr(ident_t *id_ref, int gtid, CPLX128_LEG *lhs,1072CPLX128_LEG rhs);1073#if (KMP_ARCH_X86)1074// Routines with 16-byte arguments aligned to 16-byte boundary1075void __kmpc_atomic_float16_a16_wr(ident_t *id_ref, int gtid, Quad_a16_t *lhs,1076Quad_a16_t rhs);1077void __kmpc_atomic_cmplx16_a16_wr(ident_t *id_ref, int gtid,1078kmp_cmplx128_a16_t *lhs,1079kmp_cmplx128_a16_t rhs);1080#endif1081#endif10821083// Below routines for atomic CAPTURE are listed10841085// 1-byte1086char __kmpc_atomic_fixed1_add_cpt(ident_t *id_ref, int gtid, char *lhs,1087char rhs, int flag);1088char __kmpc_atomic_fixed1_andb_cpt(ident_t *id_ref, int gtid, char *lhs,1089char rhs, int flag);1090char __kmpc_atomic_fixed1_div_cpt(ident_t *id_ref, int gtid, char *lhs,1091char rhs, int flag);1092unsigned char __kmpc_atomic_fixed1u_div_cpt(ident_t *id_ref, int gtid,1093unsigned char *lhs,1094unsigned char rhs, int flag);1095char __kmpc_atomic_fixed1_mul_cpt(ident_t *id_ref, int gtid, char *lhs,1096char rhs, int flag);1097char __kmpc_atomic_fixed1_orb_cpt(ident_t *id_ref, int gtid, char *lhs,1098char rhs, int flag);1099char __kmpc_atomic_fixed1_shl_cpt(ident_t *id_ref, int gtid, char *lhs,1100char rhs, int flag);1101char __kmpc_atomic_fixed1_shr_cpt(ident_t *id_ref, int gtid, char *lhs,1102char rhs, int flag);1103unsigned char __kmpc_atomic_fixed1u_shr_cpt(ident_t *id_ref, int gtid,1104unsigned char *lhs,1105unsigned char rhs, int flag);1106char __kmpc_atomic_fixed1_sub_cpt(ident_t *id_ref, int gtid, char *lhs,1107char rhs, int flag);1108char __kmpc_atomic_fixed1_xor_cpt(ident_t *id_ref, int gtid, char *lhs,1109char rhs, int flag);1110// 2-byte1111short __kmpc_atomic_fixed2_add_cpt(ident_t *id_ref, int gtid, short *lhs,1112short rhs, int flag);1113short __kmpc_atomic_fixed2_andb_cpt(ident_t *id_ref, int gtid, short *lhs,1114short rhs, int flag);1115short __kmpc_atomic_fixed2_div_cpt(ident_t *id_ref, int gtid, short *lhs,1116short rhs, int flag);1117unsigned short __kmpc_atomic_fixed2u_div_cpt(ident_t *id_ref, int gtid,1118unsigned short *lhs,1119unsigned short rhs, int flag);1120short __kmpc_atomic_fixed2_mul_cpt(ident_t *id_ref, int gtid, short *lhs,1121short rhs, int flag);1122short __kmpc_atomic_fixed2_orb_cpt(ident_t *id_ref, int gtid, short *lhs,1123short rhs, int flag);1124short __kmpc_atomic_fixed2_shl_cpt(ident_t *id_ref, int gtid, short *lhs,1125short rhs, int flag);1126short __kmpc_atomic_fixed2_shr_cpt(ident_t *id_ref, int gtid, short *lhs,1127short rhs, int flag);1128unsigned short __kmpc_atomic_fixed2u_shr_cpt(ident_t *id_ref, int gtid,1129unsigned short *lhs,1130unsigned short rhs, int flag);1131short __kmpc_atomic_fixed2_sub_cpt(ident_t *id_ref, int gtid, short *lhs,1132short rhs, int flag);1133short __kmpc_atomic_fixed2_xor_cpt(ident_t *id_ref, int gtid, short *lhs,1134short rhs, int flag);1135// 4-byte add / sub fixed1136kmp_int32 __kmpc_atomic_fixed4_add_cpt(ident_t *id_ref, int gtid,1137kmp_int32 *lhs, kmp_int32 rhs, int flag);1138kmp_int32 __kmpc_atomic_fixed4_sub_cpt(ident_t *id_ref, int gtid,1139kmp_int32 *lhs, kmp_int32 rhs, int flag);1140// 4-byte add / sub float1141kmp_real32 __kmpc_atomic_float4_add_cpt(ident_t *id_ref, int gtid,1142kmp_real32 *lhs, kmp_real32 rhs,1143int flag);1144kmp_real32 __kmpc_atomic_float4_sub_cpt(ident_t *id_ref, int gtid,1145kmp_real32 *lhs, kmp_real32 rhs,1146int flag);1147// 8-byte add / sub fixed1148kmp_int64 __kmpc_atomic_fixed8_add_cpt(ident_t *id_ref, int gtid,1149kmp_int64 *lhs, kmp_int64 rhs, int flag);1150kmp_int64 __kmpc_atomic_fixed8_sub_cpt(ident_t *id_ref, int gtid,1151kmp_int64 *lhs, kmp_int64 rhs, int flag);1152// 8-byte add / sub float1153kmp_real64 __kmpc_atomic_float8_add_cpt(ident_t *id_ref, int gtid,1154kmp_real64 *lhs, kmp_real64 rhs,1155int flag);1156kmp_real64 __kmpc_atomic_float8_sub_cpt(ident_t *id_ref, int gtid,1157kmp_real64 *lhs, kmp_real64 rhs,1158int flag);1159// 4-byte fixed1160kmp_int32 __kmpc_atomic_fixed4_andb_cpt(ident_t *id_ref, int gtid,1161kmp_int32 *lhs, kmp_int32 rhs,1162int flag);1163kmp_int32 __kmpc_atomic_fixed4_div_cpt(ident_t *id_ref, int gtid,1164kmp_int32 *lhs, kmp_int32 rhs, int flag);1165kmp_uint32 __kmpc_atomic_fixed4u_div_cpt(ident_t *id_ref, int gtid,1166kmp_uint32 *lhs, kmp_uint32 rhs,1167int flag);1168kmp_int32 __kmpc_atomic_fixed4_mul_cpt(ident_t *id_ref, int gtid,1169kmp_int32 *lhs, kmp_int32 rhs, int flag);1170kmp_int32 __kmpc_atomic_fixed4_orb_cpt(ident_t *id_ref, int gtid,1171kmp_int32 *lhs, kmp_int32 rhs, int flag);1172kmp_int32 __kmpc_atomic_fixed4_shl_cpt(ident_t *id_ref, int gtid,1173kmp_int32 *lhs, kmp_int32 rhs, int flag);1174kmp_int32 __kmpc_atomic_fixed4_shr_cpt(ident_t *id_ref, int gtid,1175kmp_int32 *lhs, kmp_int32 rhs, int flag);1176kmp_uint32 __kmpc_atomic_fixed4u_shr_cpt(ident_t *id_ref, int gtid,1177kmp_uint32 *lhs, kmp_uint32 rhs,1178int flag);1179kmp_int32 __kmpc_atomic_fixed4_xor_cpt(ident_t *id_ref, int gtid,1180kmp_int32 *lhs, kmp_int32 rhs, int flag);1181// 8-byte fixed1182kmp_int64 __kmpc_atomic_fixed8_andb_cpt(ident_t *id_ref, int gtid,1183kmp_int64 *lhs, kmp_int64 rhs,1184int flag);1185kmp_int64 __kmpc_atomic_fixed8_div_cpt(ident_t *id_ref, int gtid,1186kmp_int64 *lhs, kmp_int64 rhs, int flag);1187kmp_uint64 __kmpc_atomic_fixed8u_div_cpt(ident_t *id_ref, int gtid,1188kmp_uint64 *lhs, kmp_uint64 rhs,1189int flag);1190kmp_int64 __kmpc_atomic_fixed8_mul_cpt(ident_t *id_ref, int gtid,1191kmp_int64 *lhs, kmp_int64 rhs, int flag);1192kmp_int64 __kmpc_atomic_fixed8_orb_cpt(ident_t *id_ref, int gtid,1193kmp_int64 *lhs, kmp_int64 rhs, int flag);1194kmp_int64 __kmpc_atomic_fixed8_shl_cpt(ident_t *id_ref, int gtid,1195kmp_int64 *lhs, kmp_int64 rhs, int flag);1196kmp_int64 __kmpc_atomic_fixed8_shr_cpt(ident_t *id_ref, int gtid,1197kmp_int64 *lhs, kmp_int64 rhs, int flag);1198kmp_uint64 __kmpc_atomic_fixed8u_shr_cpt(ident_t *id_ref, int gtid,1199kmp_uint64 *lhs, kmp_uint64 rhs,1200int flag);1201kmp_int64 __kmpc_atomic_fixed8_xor_cpt(ident_t *id_ref, int gtid,1202kmp_int64 *lhs, kmp_int64 rhs, int flag);1203// 4-byte float1204kmp_real32 __kmpc_atomic_float4_div_cpt(ident_t *id_ref, int gtid,1205kmp_real32 *lhs, kmp_real32 rhs,1206int flag);1207kmp_real32 __kmpc_atomic_float4_mul_cpt(ident_t *id_ref, int gtid,1208kmp_real32 *lhs, kmp_real32 rhs,1209int flag);1210// 8-byte float1211kmp_real64 __kmpc_atomic_float8_div_cpt(ident_t *id_ref, int gtid,1212kmp_real64 *lhs, kmp_real64 rhs,1213int flag);1214kmp_real64 __kmpc_atomic_float8_mul_cpt(ident_t *id_ref, int gtid,1215kmp_real64 *lhs, kmp_real64 rhs,1216int flag);1217// 1-, 2-, 4-, 8-byte logical (&&, ||)1218char __kmpc_atomic_fixed1_andl_cpt(ident_t *id_ref, int gtid, char *lhs,1219char rhs, int flag);1220char __kmpc_atomic_fixed1_orl_cpt(ident_t *id_ref, int gtid, char *lhs,1221char rhs, int flag);1222short __kmpc_atomic_fixed2_andl_cpt(ident_t *id_ref, int gtid, short *lhs,1223short rhs, int flag);1224short __kmpc_atomic_fixed2_orl_cpt(ident_t *id_ref, int gtid, short *lhs,1225short rhs, int flag);1226kmp_int32 __kmpc_atomic_fixed4_andl_cpt(ident_t *id_ref, int gtid,1227kmp_int32 *lhs, kmp_int32 rhs,1228int flag);1229kmp_int32 __kmpc_atomic_fixed4_orl_cpt(ident_t *id_ref, int gtid,1230kmp_int32 *lhs, kmp_int32 rhs, int flag);1231kmp_int64 __kmpc_atomic_fixed8_andl_cpt(ident_t *id_ref, int gtid,1232kmp_int64 *lhs, kmp_int64 rhs,1233int flag);1234kmp_int64 __kmpc_atomic_fixed8_orl_cpt(ident_t *id_ref, int gtid,1235kmp_int64 *lhs, kmp_int64 rhs, int flag);1236// MIN / MAX1237char __kmpc_atomic_fixed1_max_cpt(ident_t *id_ref, int gtid, char *lhs,1238char rhs, int flag);1239char __kmpc_atomic_fixed1_min_cpt(ident_t *id_ref, int gtid, char *lhs,1240char rhs, int flag);1241short __kmpc_atomic_fixed2_max_cpt(ident_t *id_ref, int gtid, short *lhs,1242short rhs, int flag);1243short __kmpc_atomic_fixed2_min_cpt(ident_t *id_ref, int gtid, short *lhs,1244short rhs, int flag);1245kmp_int32 __kmpc_atomic_fixed4_max_cpt(ident_t *id_ref, int gtid,1246kmp_int32 *lhs, kmp_int32 rhs, int flag);1247kmp_int32 __kmpc_atomic_fixed4_min_cpt(ident_t *id_ref, int gtid,1248kmp_int32 *lhs, kmp_int32 rhs, int flag);1249kmp_int64 __kmpc_atomic_fixed8_max_cpt(ident_t *id_ref, int gtid,1250kmp_int64 *lhs, kmp_int64 rhs, int flag);1251kmp_int64 __kmpc_atomic_fixed8_min_cpt(ident_t *id_ref, int gtid,1252kmp_int64 *lhs, kmp_int64 rhs, int flag);1253kmp_real32 __kmpc_atomic_float4_max_cpt(ident_t *id_ref, int gtid,1254kmp_real32 *lhs, kmp_real32 rhs,1255int flag);1256kmp_real32 __kmpc_atomic_float4_min_cpt(ident_t *id_ref, int gtid,1257kmp_real32 *lhs, kmp_real32 rhs,1258int flag);1259kmp_real64 __kmpc_atomic_float8_max_cpt(ident_t *id_ref, int gtid,1260kmp_real64 *lhs, kmp_real64 rhs,1261int flag);1262kmp_real64 __kmpc_atomic_float8_min_cpt(ident_t *id_ref, int gtid,1263kmp_real64 *lhs, kmp_real64 rhs,1264int flag);1265long double __kmpc_atomic_float10_max_cpt(ident_t *id_ref, int gtid,1266long double *lhs, long double rhs,1267int flag);1268long double __kmpc_atomic_float10_min_cpt(ident_t *id_ref, int gtid,1269long double *lhs, long double rhs,1270int flag);1271#if KMP_HAVE_QUAD1272QUAD_LEGACY __kmpc_atomic_float16_max_cpt(ident_t *id_ref, int gtid,1273QUAD_LEGACY *lhs, QUAD_LEGACY rhs,1274int flag);1275QUAD_LEGACY __kmpc_atomic_float16_min_cpt(ident_t *id_ref, int gtid,1276QUAD_LEGACY *lhs, QUAD_LEGACY rhs,1277int flag);1278#endif1279// .NEQV. (same as xor)1280char __kmpc_atomic_fixed1_neqv_cpt(ident_t *id_ref, int gtid, char *lhs,1281char rhs, int flag);1282short __kmpc_atomic_fixed2_neqv_cpt(ident_t *id_ref, int gtid, short *lhs,1283short rhs, int flag);1284kmp_int32 __kmpc_atomic_fixed4_neqv_cpt(ident_t *id_ref, int gtid,1285kmp_int32 *lhs, kmp_int32 rhs,1286int flag);1287kmp_int64 __kmpc_atomic_fixed8_neqv_cpt(ident_t *id_ref, int gtid,1288kmp_int64 *lhs, kmp_int64 rhs,1289int flag);1290// .EQV. (same as ~xor)1291char __kmpc_atomic_fixed1_eqv_cpt(ident_t *id_ref, int gtid, char *lhs,1292char rhs, int flag);1293short __kmpc_atomic_fixed2_eqv_cpt(ident_t *id_ref, int gtid, short *lhs,1294short rhs, int flag);1295kmp_int32 __kmpc_atomic_fixed4_eqv_cpt(ident_t *id_ref, int gtid,1296kmp_int32 *lhs, kmp_int32 rhs, int flag);1297kmp_int64 __kmpc_atomic_fixed8_eqv_cpt(ident_t *id_ref, int gtid,1298kmp_int64 *lhs, kmp_int64 rhs, int flag);1299// long double type1300long double __kmpc_atomic_float10_add_cpt(ident_t *id_ref, int gtid,1301long double *lhs, long double rhs,1302int flag);1303long double __kmpc_atomic_float10_sub_cpt(ident_t *id_ref, int gtid,1304long double *lhs, long double rhs,1305int flag);1306long double __kmpc_atomic_float10_mul_cpt(ident_t *id_ref, int gtid,1307long double *lhs, long double rhs,1308int flag);1309long double __kmpc_atomic_float10_div_cpt(ident_t *id_ref, int gtid,1310long double *lhs, long double rhs,1311int flag);1312#if KMP_HAVE_QUAD1313// _Quad type1314QUAD_LEGACY __kmpc_atomic_float16_add_cpt(ident_t *id_ref, int gtid,1315QUAD_LEGACY *lhs, QUAD_LEGACY rhs,1316int flag);1317QUAD_LEGACY __kmpc_atomic_float16_sub_cpt(ident_t *id_ref, int gtid,1318QUAD_LEGACY *lhs, QUAD_LEGACY rhs,1319int flag);1320QUAD_LEGACY __kmpc_atomic_float16_mul_cpt(ident_t *id_ref, int gtid,1321QUAD_LEGACY *lhs, QUAD_LEGACY rhs,1322int flag);1323QUAD_LEGACY __kmpc_atomic_float16_div_cpt(ident_t *id_ref, int gtid,1324QUAD_LEGACY *lhs, QUAD_LEGACY rhs,1325int flag);1326#endif1327// routines for complex types1328// Workaround for cmplx4 routines - return void; captured value is returned via1329// the argument1330void __kmpc_atomic_cmplx4_add_cpt(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,1331kmp_cmplx32 rhs, kmp_cmplx32 *out, int flag);1332void __kmpc_atomic_cmplx4_sub_cpt(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,1333kmp_cmplx32 rhs, kmp_cmplx32 *out, int flag);1334void __kmpc_atomic_cmplx4_mul_cpt(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,1335kmp_cmplx32 rhs, kmp_cmplx32 *out, int flag);1336void __kmpc_atomic_cmplx4_div_cpt(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,1337kmp_cmplx32 rhs, kmp_cmplx32 *out, int flag);1338kmp_cmplx64 __kmpc_atomic_cmplx8_add_cpt(ident_t *id_ref, int gtid,1339kmp_cmplx64 *lhs, kmp_cmplx64 rhs,1340int flag);1341kmp_cmplx64 __kmpc_atomic_cmplx8_sub_cpt(ident_t *id_ref, int gtid,1342kmp_cmplx64 *lhs, kmp_cmplx64 rhs,1343int flag);1344kmp_cmplx64 __kmpc_atomic_cmplx8_mul_cpt(ident_t *id_ref, int gtid,1345kmp_cmplx64 *lhs, kmp_cmplx64 rhs,1346int flag);1347kmp_cmplx64 __kmpc_atomic_cmplx8_div_cpt(ident_t *id_ref, int gtid,1348kmp_cmplx64 *lhs, kmp_cmplx64 rhs,1349int flag);1350kmp_cmplx80 __kmpc_atomic_cmplx10_add_cpt(ident_t *id_ref, int gtid,1351kmp_cmplx80 *lhs, kmp_cmplx80 rhs,1352int flag);1353kmp_cmplx80 __kmpc_atomic_cmplx10_sub_cpt(ident_t *id_ref, int gtid,1354kmp_cmplx80 *lhs, kmp_cmplx80 rhs,1355int flag);1356kmp_cmplx80 __kmpc_atomic_cmplx10_mul_cpt(ident_t *id_ref, int gtid,1357kmp_cmplx80 *lhs, kmp_cmplx80 rhs,1358int flag);1359kmp_cmplx80 __kmpc_atomic_cmplx10_div_cpt(ident_t *id_ref, int gtid,1360kmp_cmplx80 *lhs, kmp_cmplx80 rhs,1361int flag);1362#if KMP_HAVE_QUAD1363CPLX128_LEG __kmpc_atomic_cmplx16_add_cpt(ident_t *id_ref, int gtid,1364CPLX128_LEG *lhs, CPLX128_LEG rhs,1365int flag);1366CPLX128_LEG __kmpc_atomic_cmplx16_sub_cpt(ident_t *id_ref, int gtid,1367CPLX128_LEG *lhs, CPLX128_LEG rhs,1368int flag);1369CPLX128_LEG __kmpc_atomic_cmplx16_mul_cpt(ident_t *id_ref, int gtid,1370CPLX128_LEG *lhs, CPLX128_LEG rhs,1371int flag);1372CPLX128_LEG __kmpc_atomic_cmplx16_div_cpt(ident_t *id_ref, int gtid,1373CPLX128_LEG *lhs, CPLX128_LEG rhs,1374int flag);1375#if (KMP_ARCH_X86)1376// Routines with 16-byte arguments aligned to 16-byte boundary1377Quad_a16_t __kmpc_atomic_float16_add_a16_cpt(ident_t *id_ref, int gtid,1378Quad_a16_t *lhs, Quad_a16_t rhs,1379int flag);1380Quad_a16_t __kmpc_atomic_float16_sub_a16_cpt(ident_t *id_ref, int gtid,1381Quad_a16_t *lhs, Quad_a16_t rhs,1382int flag);1383Quad_a16_t __kmpc_atomic_float16_mul_a16_cpt(ident_t *id_ref, int gtid,1384Quad_a16_t *lhs, Quad_a16_t rhs,1385int flag);1386Quad_a16_t __kmpc_atomic_float16_div_a16_cpt(ident_t *id_ref, int gtid,1387Quad_a16_t *lhs, Quad_a16_t rhs,1388int flag);1389Quad_a16_t __kmpc_atomic_float16_max_a16_cpt(ident_t *id_ref, int gtid,1390Quad_a16_t *lhs, Quad_a16_t rhs,1391int flag);1392Quad_a16_t __kmpc_atomic_float16_min_a16_cpt(ident_t *id_ref, int gtid,1393Quad_a16_t *lhs, Quad_a16_t rhs,1394int flag);1395kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_add_a16_cpt(ident_t *id_ref, int gtid,1396kmp_cmplx128_a16_t *lhs,1397kmp_cmplx128_a16_t rhs,1398int flag);1399kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_sub_a16_cpt(ident_t *id_ref, int gtid,1400kmp_cmplx128_a16_t *lhs,1401kmp_cmplx128_a16_t rhs,1402int flag);1403kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_mul_a16_cpt(ident_t *id_ref, int gtid,1404kmp_cmplx128_a16_t *lhs,1405kmp_cmplx128_a16_t rhs,1406int flag);1407kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_div_a16_cpt(ident_t *id_ref, int gtid,1408kmp_cmplx128_a16_t *lhs,1409kmp_cmplx128_a16_t rhs,1410int flag);1411#endif1412#endif14131414void __kmpc_atomic_start(void);1415void __kmpc_atomic_end(void);14161417// OpenMP 4.0: v = x = expr binop x; { v = x; x = expr binop x; } { x = expr1418// binop x; v = x; } for non-commutative operations.1419#if KMP_ARCH_X86 || KMP_ARCH_X86_641420char __kmpc_atomic_fixed1_sub_cpt_rev(ident_t *id_ref, int gtid, char *lhs,1421char rhs, int flag);1422char __kmpc_atomic_fixed1_div_cpt_rev(ident_t *id_ref, int gtid, char *lhs,1423char rhs, int flag);1424unsigned char __kmpc_atomic_fixed1u_div_cpt_rev(ident_t *id_ref, int gtid,1425unsigned char *lhs,1426unsigned char rhs, int flag);1427char __kmpc_atomic_fixed1_shl_cpt_rev(ident_t *id_ref, int gtid, char *lhs,1428char rhs, int flag);1429char __kmpc_atomic_fixed1_shr_cpt_rev(ident_t *id_ref, int gtid, char *lhs,1430char rhs, int flag);1431unsigned char __kmpc_atomic_fixed1u_shr_cpt_rev(ident_t *id_ref, int gtid,1432unsigned char *lhs,1433unsigned char rhs, int flag);1434short __kmpc_atomic_fixed2_sub_cpt_rev(ident_t *id_ref, int gtid, short *lhs,1435short rhs, int flag);1436short __kmpc_atomic_fixed2_div_cpt_rev(ident_t *id_ref, int gtid, short *lhs,1437short rhs, int flag);1438unsigned short __kmpc_atomic_fixed2u_div_cpt_rev(ident_t *id_ref, int gtid,1439unsigned short *lhs,1440unsigned short rhs, int flag);1441short __kmpc_atomic_fixed2_shl_cpt_rev(ident_t *id_ref, int gtid, short *lhs,1442short rhs, int flag);1443short __kmpc_atomic_fixed2_shr_cpt_rev(ident_t *id_ref, int gtid, short *lhs,1444short rhs, int flag);1445unsigned short __kmpc_atomic_fixed2u_shr_cpt_rev(ident_t *id_ref, int gtid,1446unsigned short *lhs,1447unsigned short rhs, int flag);1448kmp_int32 __kmpc_atomic_fixed4_sub_cpt_rev(ident_t *id_ref, int gtid,1449kmp_int32 *lhs, kmp_int32 rhs,1450int flag);1451kmp_int32 __kmpc_atomic_fixed4_div_cpt_rev(ident_t *id_ref, int gtid,1452kmp_int32 *lhs, kmp_int32 rhs,1453int flag);1454kmp_uint32 __kmpc_atomic_fixed4u_div_cpt_rev(ident_t *id_ref, int gtid,1455kmp_uint32 *lhs, kmp_uint32 rhs,1456int flag);1457kmp_int32 __kmpc_atomic_fixed4_shl_cpt_rev(ident_t *id_ref, int gtid,1458kmp_int32 *lhs, kmp_int32 rhs,1459int flag);1460kmp_int32 __kmpc_atomic_fixed4_shr_cpt_rev(ident_t *id_ref, int gtid,1461kmp_int32 *lhs, kmp_int32 rhs,1462int flag);1463kmp_uint32 __kmpc_atomic_fixed4u_shr_cpt_rev(ident_t *id_ref, int gtid,1464kmp_uint32 *lhs, kmp_uint32 rhs,1465int flag);1466kmp_int64 __kmpc_atomic_fixed8_sub_cpt_rev(ident_t *id_ref, int gtid,1467kmp_int64 *lhs, kmp_int64 rhs,1468int flag);1469kmp_int64 __kmpc_atomic_fixed8_div_cpt_rev(ident_t *id_ref, int gtid,1470kmp_int64 *lhs, kmp_int64 rhs,1471int flag);1472kmp_uint64 __kmpc_atomic_fixed8u_div_cpt_rev(ident_t *id_ref, int gtid,1473kmp_uint64 *lhs, kmp_uint64 rhs,1474int flag);1475kmp_int64 __kmpc_atomic_fixed8_shl_cpt_rev(ident_t *id_ref, int gtid,1476kmp_int64 *lhs, kmp_int64 rhs,1477int flag);1478kmp_int64 __kmpc_atomic_fixed8_shr_cpt_rev(ident_t *id_ref, int gtid,1479kmp_int64 *lhs, kmp_int64 rhs,1480int flag);1481kmp_uint64 __kmpc_atomic_fixed8u_shr_cpt_rev(ident_t *id_ref, int gtid,1482kmp_uint64 *lhs, kmp_uint64 rhs,1483int flag);1484float __kmpc_atomic_float4_sub_cpt_rev(ident_t *id_ref, int gtid, float *lhs,1485float rhs, int flag);1486float __kmpc_atomic_float4_div_cpt_rev(ident_t *id_ref, int gtid, float *lhs,1487float rhs, int flag);1488double __kmpc_atomic_float8_sub_cpt_rev(ident_t *id_ref, int gtid, double *lhs,1489double rhs, int flag);1490double __kmpc_atomic_float8_div_cpt_rev(ident_t *id_ref, int gtid, double *lhs,1491double rhs, int flag);1492long double __kmpc_atomic_float10_sub_cpt_rev(ident_t *id_ref, int gtid,1493long double *lhs, long double rhs,1494int flag);1495long double __kmpc_atomic_float10_div_cpt_rev(ident_t *id_ref, int gtid,1496long double *lhs, long double rhs,1497int flag);1498#if KMP_HAVE_QUAD1499QUAD_LEGACY __kmpc_atomic_float16_sub_cpt_rev(ident_t *id_ref, int gtid,1500QUAD_LEGACY *lhs, QUAD_LEGACY rhs,1501int flag);1502QUAD_LEGACY __kmpc_atomic_float16_div_cpt_rev(ident_t *id_ref, int gtid,1503QUAD_LEGACY *lhs, QUAD_LEGACY rhs,1504int flag);1505#endif1506// Workaround for cmplx4 routines - return void; captured value is returned via1507// the argument1508void __kmpc_atomic_cmplx4_sub_cpt_rev(ident_t *id_ref, int gtid,1509kmp_cmplx32 *lhs, kmp_cmplx32 rhs,1510kmp_cmplx32 *out, int flag);1511void __kmpc_atomic_cmplx4_div_cpt_rev(ident_t *id_ref, int gtid,1512kmp_cmplx32 *lhs, kmp_cmplx32 rhs,1513kmp_cmplx32 *out, int flag);1514kmp_cmplx64 __kmpc_atomic_cmplx8_sub_cpt_rev(ident_t *id_ref, int gtid,1515kmp_cmplx64 *lhs, kmp_cmplx64 rhs,1516int flag);1517kmp_cmplx64 __kmpc_atomic_cmplx8_div_cpt_rev(ident_t *id_ref, int gtid,1518kmp_cmplx64 *lhs, kmp_cmplx64 rhs,1519int flag);1520kmp_cmplx80 __kmpc_atomic_cmplx10_sub_cpt_rev(ident_t *id_ref, int gtid,1521kmp_cmplx80 *lhs, kmp_cmplx80 rhs,1522int flag);1523kmp_cmplx80 __kmpc_atomic_cmplx10_div_cpt_rev(ident_t *id_ref, int gtid,1524kmp_cmplx80 *lhs, kmp_cmplx80 rhs,1525int flag);1526#if KMP_HAVE_QUAD1527CPLX128_LEG __kmpc_atomic_cmplx16_sub_cpt_rev(ident_t *id_ref, int gtid,1528CPLX128_LEG *lhs, CPLX128_LEG rhs,1529int flag);1530CPLX128_LEG __kmpc_atomic_cmplx16_div_cpt_rev(ident_t *id_ref, int gtid,1531CPLX128_LEG *lhs, CPLX128_LEG rhs,1532int flag);1533#if (KMP_ARCH_X86)1534Quad_a16_t __kmpc_atomic_float16_sub_a16_cpt_rev(ident_t *id_ref, int gtid,1535Quad_a16_t *lhs,1536Quad_a16_t rhs, int flag);1537Quad_a16_t __kmpc_atomic_float16_div_a16_cpt_rev(ident_t *id_ref, int gtid,1538Quad_a16_t *lhs,1539Quad_a16_t rhs, int flag);1540kmp_cmplx128_a16_t1541__kmpc_atomic_cmplx16_sub_a16_cpt_rev(ident_t *id_ref, int gtid,1542kmp_cmplx128_a16_t *lhs,1543kmp_cmplx128_a16_t rhs, int flag);1544kmp_cmplx128_a16_t1545__kmpc_atomic_cmplx16_div_a16_cpt_rev(ident_t *id_ref, int gtid,1546kmp_cmplx128_a16_t *lhs,1547kmp_cmplx128_a16_t rhs, int flag);1548#endif1549#endif15501551// OpenMP 4.0 Capture-write (swap): {v = x; x = expr;}1552char __kmpc_atomic_fixed1_swp(ident_t *id_ref, int gtid, char *lhs, char rhs);1553short __kmpc_atomic_fixed2_swp(ident_t *id_ref, int gtid, short *lhs,1554short rhs);1555kmp_int32 __kmpc_atomic_fixed4_swp(ident_t *id_ref, int gtid, kmp_int32 *lhs,1556kmp_int32 rhs);1557kmp_int64 __kmpc_atomic_fixed8_swp(ident_t *id_ref, int gtid, kmp_int64 *lhs,1558kmp_int64 rhs);1559float __kmpc_atomic_float4_swp(ident_t *id_ref, int gtid, float *lhs,1560float rhs);1561double __kmpc_atomic_float8_swp(ident_t *id_ref, int gtid, double *lhs,1562double rhs);1563long double __kmpc_atomic_float10_swp(ident_t *id_ref, int gtid,1564long double *lhs, long double rhs);1565#if KMP_HAVE_QUAD1566QUAD_LEGACY __kmpc_atomic_float16_swp(ident_t *id_ref, int gtid,1567QUAD_LEGACY *lhs, QUAD_LEGACY rhs);1568#endif1569// !!! TODO: check if we need a workaround here1570void __kmpc_atomic_cmplx4_swp(ident_t *id_ref, int gtid, kmp_cmplx32 *lhs,1571kmp_cmplx32 rhs, kmp_cmplx32 *out);1572// kmp_cmplx32 __kmpc_atomic_cmplx4_swp( ident_t *id_ref, int gtid,1573// kmp_cmplx32 * lhs, kmp_cmplx32 rhs );15741575kmp_cmplx64 __kmpc_atomic_cmplx8_swp(ident_t *id_ref, int gtid,1576kmp_cmplx64 *lhs, kmp_cmplx64 rhs);1577kmp_cmplx80 __kmpc_atomic_cmplx10_swp(ident_t *id_ref, int gtid,1578kmp_cmplx80 *lhs, kmp_cmplx80 rhs);1579#if KMP_HAVE_QUAD1580CPLX128_LEG __kmpc_atomic_cmplx16_swp(ident_t *id_ref, int gtid,1581CPLX128_LEG *lhs, CPLX128_LEG rhs);1582#if (KMP_ARCH_X86)1583Quad_a16_t __kmpc_atomic_float16_a16_swp(ident_t *id_ref, int gtid,1584Quad_a16_t *lhs, Quad_a16_t rhs);1585kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_a16_swp(ident_t *id_ref, int gtid,1586kmp_cmplx128_a16_t *lhs,1587kmp_cmplx128_a16_t rhs);1588#endif1589#endif15901591// Capture routines for mixed types (RHS=float16)1592#if KMP_HAVE_QUAD15931594char __kmpc_atomic_fixed1_add_cpt_fp(ident_t *id_ref, int gtid, char *lhs,1595_Quad rhs, int flag);1596char __kmpc_atomic_fixed1_sub_cpt_fp(ident_t *id_ref, int gtid, char *lhs,1597_Quad rhs, int flag);1598char __kmpc_atomic_fixed1_mul_cpt_fp(ident_t *id_ref, int gtid, char *lhs,1599_Quad rhs, int flag);1600char __kmpc_atomic_fixed1_div_cpt_fp(ident_t *id_ref, int gtid, char *lhs,1601_Quad rhs, int flag);1602unsigned char __kmpc_atomic_fixed1u_add_cpt_fp(ident_t *id_ref, int gtid,1603unsigned char *lhs, _Quad rhs,1604int flag);1605unsigned char __kmpc_atomic_fixed1u_sub_cpt_fp(ident_t *id_ref, int gtid,1606unsigned char *lhs, _Quad rhs,1607int flag);1608unsigned char __kmpc_atomic_fixed1u_mul_cpt_fp(ident_t *id_ref, int gtid,1609unsigned char *lhs, _Quad rhs,1610int flag);1611unsigned char __kmpc_atomic_fixed1u_div_cpt_fp(ident_t *id_ref, int gtid,1612unsigned char *lhs, _Quad rhs,1613int flag);16141615short __kmpc_atomic_fixed2_add_cpt_fp(ident_t *id_ref, int gtid, short *lhs,1616_Quad rhs, int flag);1617short __kmpc_atomic_fixed2_sub_cpt_fp(ident_t *id_ref, int gtid, short *lhs,1618_Quad rhs, int flag);1619short __kmpc_atomic_fixed2_mul_cpt_fp(ident_t *id_ref, int gtid, short *lhs,1620_Quad rhs, int flag);1621short __kmpc_atomic_fixed2_div_cpt_fp(ident_t *id_ref, int gtid, short *lhs,1622_Quad rhs, int flag);1623unsigned short __kmpc_atomic_fixed2u_add_cpt_fp(ident_t *id_ref, int gtid,1624unsigned short *lhs, _Quad rhs,1625int flag);1626unsigned short __kmpc_atomic_fixed2u_sub_cpt_fp(ident_t *id_ref, int gtid,1627unsigned short *lhs, _Quad rhs,1628int flag);1629unsigned short __kmpc_atomic_fixed2u_mul_cpt_fp(ident_t *id_ref, int gtid,1630unsigned short *lhs, _Quad rhs,1631int flag);1632unsigned short __kmpc_atomic_fixed2u_div_cpt_fp(ident_t *id_ref, int gtid,1633unsigned short *lhs, _Quad rhs,1634int flag);16351636kmp_int32 __kmpc_atomic_fixed4_add_cpt_fp(ident_t *id_ref, int gtid,1637kmp_int32 *lhs, _Quad rhs, int flag);1638kmp_int32 __kmpc_atomic_fixed4_sub_cpt_fp(ident_t *id_ref, int gtid,1639kmp_int32 *lhs, _Quad rhs, int flag);1640kmp_int32 __kmpc_atomic_fixed4_mul_cpt_fp(ident_t *id_ref, int gtid,1641kmp_int32 *lhs, _Quad rhs, int flag);1642kmp_int32 __kmpc_atomic_fixed4_div_cpt_fp(ident_t *id_ref, int gtid,1643kmp_int32 *lhs, _Quad rhs, int flag);1644kmp_uint32 __kmpc_atomic_fixed4u_add_cpt_fp(ident_t *id_ref, int gtid,1645kmp_uint32 *lhs, _Quad rhs,1646int flag);1647kmp_uint32 __kmpc_atomic_fixed4u_sub_cpt_fp(ident_t *id_ref, int gtid,1648kmp_uint32 *lhs, _Quad rhs,1649int flag);1650kmp_uint32 __kmpc_atomic_fixed4u_mul_cpt_fp(ident_t *id_ref, int gtid,1651kmp_uint32 *lhs, _Quad rhs,1652int flag);1653kmp_uint32 __kmpc_atomic_fixed4u_div_cpt_fp(ident_t *id_ref, int gtid,1654kmp_uint32 *lhs, _Quad rhs,1655int flag);16561657kmp_int64 __kmpc_atomic_fixed8_add_cpt_fp(ident_t *id_ref, int gtid,1658kmp_int64 *lhs, _Quad rhs, int flag);1659kmp_int64 __kmpc_atomic_fixed8_sub_cpt_fp(ident_t *id_ref, int gtid,1660kmp_int64 *lhs, _Quad rhs, int flag);1661kmp_int64 __kmpc_atomic_fixed8_mul_cpt_fp(ident_t *id_ref, int gtid,1662kmp_int64 *lhs, _Quad rhs, int flag);1663kmp_int64 __kmpc_atomic_fixed8_div_cpt_fp(ident_t *id_ref, int gtid,1664kmp_int64 *lhs, _Quad rhs, int flag);1665kmp_uint64 __kmpc_atomic_fixed8u_add_cpt_fp(ident_t *id_ref, int gtid,1666kmp_uint64 *lhs, _Quad rhs,1667int flag);1668kmp_uint64 __kmpc_atomic_fixed8u_sub_cpt_fp(ident_t *id_ref, int gtid,1669kmp_uint64 *lhs, _Quad rhs,1670int flag);1671kmp_uint64 __kmpc_atomic_fixed8u_mul_cpt_fp(ident_t *id_ref, int gtid,1672kmp_uint64 *lhs, _Quad rhs,1673int flag);1674kmp_uint64 __kmpc_atomic_fixed8u_div_cpt_fp(ident_t *id_ref, int gtid,1675kmp_uint64 *lhs, _Quad rhs,1676int flag);16771678float __kmpc_atomic_float4_add_cpt_fp(ident_t *id_ref, int gtid,1679kmp_real32 *lhs, _Quad rhs, int flag);1680float __kmpc_atomic_float4_sub_cpt_fp(ident_t *id_ref, int gtid,1681kmp_real32 *lhs, _Quad rhs, int flag);1682float __kmpc_atomic_float4_mul_cpt_fp(ident_t *id_ref, int gtid,1683kmp_real32 *lhs, _Quad rhs, int flag);1684float __kmpc_atomic_float4_div_cpt_fp(ident_t *id_ref, int gtid,1685kmp_real32 *lhs, _Quad rhs, int flag);16861687double __kmpc_atomic_float8_add_cpt_fp(ident_t *id_ref, int gtid,1688kmp_real64 *lhs, _Quad rhs, int flag);1689double __kmpc_atomic_float8_sub_cpt_fp(ident_t *id_ref, int gtid,1690kmp_real64 *lhs, _Quad rhs, int flag);1691double __kmpc_atomic_float8_mul_cpt_fp(ident_t *id_ref, int gtid,1692kmp_real64 *lhs, _Quad rhs, int flag);1693double __kmpc_atomic_float8_div_cpt_fp(ident_t *id_ref, int gtid,1694kmp_real64 *lhs, _Quad rhs, int flag);16951696long double __kmpc_atomic_float10_add_cpt_fp(ident_t *id_ref, int gtid,1697long double *lhs, _Quad rhs,1698int flag);1699long double __kmpc_atomic_float10_sub_cpt_fp(ident_t *id_ref, int gtid,1700long double *lhs, _Quad rhs,1701int flag);1702long double __kmpc_atomic_float10_mul_cpt_fp(ident_t *id_ref, int gtid,1703long double *lhs, _Quad rhs,1704int flag);1705long double __kmpc_atomic_float10_div_cpt_fp(ident_t *id_ref, int gtid,1706long double *lhs, _Quad rhs,1707int flag);17081709char __kmpc_atomic_fixed1_sub_cpt_rev_fp(ident_t *id_ref, int gtid, char *lhs,1710_Quad rhs, int flag);1711unsigned char __kmpc_atomic_fixed1u_sub_cpt_rev_fp(ident_t *id_ref, int gtid,1712unsigned char *lhs,1713_Quad rhs, int flag);1714char __kmpc_atomic_fixed1_div_cpt_rev_fp(ident_t *id_ref, int gtid, char *lhs,1715_Quad rhs, int flag);1716unsigned char __kmpc_atomic_fixed1u_div_cpt_rev_fp(ident_t *id_ref, int gtid,1717unsigned char *lhs,1718_Quad rhs, int flag);1719short __kmpc_atomic_fixed2_sub_cpt_rev_fp(ident_t *id_ref, int gtid, short *lhs,1720_Quad rhs, int flag);1721unsigned short __kmpc_atomic_fixed2u_sub_cpt_rev_fp(ident_t *id_ref, int gtid,1722unsigned short *lhs,1723_Quad rhs, int flag);1724short __kmpc_atomic_fixed2_div_cpt_rev_fp(ident_t *id_ref, int gtid, short *lhs,1725_Quad rhs, int flag);1726unsigned short __kmpc_atomic_fixed2u_div_cpt_rev_fp(ident_t *id_ref, int gtid,1727unsigned short *lhs,1728_Quad rhs, int flag);1729kmp_int32 __kmpc_atomic_fixed4_sub_cpt_rev_fp(ident_t *id_ref, int gtid,1730kmp_int32 *lhs, _Quad rhs,1731int flag);1732kmp_uint32 __kmpc_atomic_fixed4u_sub_cpt_rev_fp(ident_t *id_ref, int gtid,1733kmp_uint32 *lhs, _Quad rhs,1734int flag);1735kmp_int32 __kmpc_atomic_fixed4_div_cpt_rev_fp(ident_t *id_ref, int gtid,1736kmp_int32 *lhs, _Quad rhs,1737int flag);1738kmp_uint32 __kmpc_atomic_fixed4u_div_cpt_rev_fp(ident_t *id_ref, int gtid,1739kmp_uint32 *lhs, _Quad rhs,1740int flag);1741kmp_int64 __kmpc_atomic_fixed8_sub_cpt_rev_fp(ident_t *id_ref, int gtid,1742kmp_int64 *lhs, _Quad rhs,1743int flag);1744kmp_uint64 __kmpc_atomic_fixed8u_sub_cpt_rev_fp(ident_t *id_ref, int gtid,1745kmp_uint64 *lhs, _Quad rhs,1746int flag);1747kmp_int64 __kmpc_atomic_fixed8_div_cpt_rev_fp(ident_t *id_ref, int gtid,1748kmp_int64 *lhs, _Quad rhs,1749int flag);1750kmp_uint64 __kmpc_atomic_fixed8u_div_cpt_rev_fp(ident_t *id_ref, int gtid,1751kmp_uint64 *lhs, _Quad rhs,1752int flag);1753float __kmpc_atomic_float4_sub_cpt_rev_fp(ident_t *id_ref, int gtid, float *lhs,1754_Quad rhs, int flag);1755float __kmpc_atomic_float4_div_cpt_rev_fp(ident_t *id_ref, int gtid, float *lhs,1756_Quad rhs, int flag);1757double __kmpc_atomic_float8_sub_cpt_rev_fp(ident_t *id_ref, int gtid,1758double *lhs, _Quad rhs, int flag);1759double __kmpc_atomic_float8_div_cpt_rev_fp(ident_t *id_ref, int gtid,1760double *lhs, _Quad rhs, int flag);1761long double __kmpc_atomic_float10_sub_cpt_rev_fp(ident_t *id_ref, int gtid,1762long double *lhs, _Quad rhs,1763int flag);1764long double __kmpc_atomic_float10_div_cpt_rev_fp(ident_t *id_ref, int gtid,1765long double *lhs, _Quad rhs,1766int flag);17671768#endif // KMP_HAVE_QUAD17691770// End of OpenMP 4.0 capture17711772// OpenMP 5.1 compare and swap1773/*1774__kmpc_atomic_bool_1_cas1775__kmpc_atomic_bool_2_cas1776__kmpc_atomic_bool_4_cas1777__kmpc_atomic_bool_8_cas1778__kmpc_atomic_val_1_cas1779__kmpc_atomic_val_2_cas1780__kmpc_atomic_val_4_cas1781__kmpc_atomic_val_8_cas1782__kmpc_atomic_bool_1_cas_cpt1783__kmpc_atomic_bool_2_cas_cpt1784__kmpc_atomic_bool_4_cas_cpt1785__kmpc_atomic_bool_8_cas_cpt1786__kmpc_atomic_val_1_cas_cpt1787__kmpc_atomic_val_2_cas_cpt1788__kmpc_atomic_val_4_cas_cpt1789__kmpc_atomic_val_8_cas_cpt1790*/1791// In all interfaces of CAS (Compare And Swap):1792// r is the boolean result of comparison1793// x is memory location to operate on1794// e is expected (old) value1795// d is desired (new) value1796// pv is pointer to captured value v whose location may coincide with e17971798// { r = x == e; if(r) { x = d; } }1799// functions return result of comparison1800bool __kmpc_atomic_bool_1_cas(ident_t *loc, int gtid, char *x, char e, char d);1801bool __kmpc_atomic_bool_2_cas(ident_t *loc, int gtid, short *x, short e,1802short d);1803bool __kmpc_atomic_bool_4_cas(ident_t *loc, int gtid, kmp_int32 *x, kmp_int32 e,1804kmp_int32 d);1805bool __kmpc_atomic_bool_8_cas(ident_t *loc, int gtid, kmp_int64 *x, kmp_int64 e,1806kmp_int64 d);18071808// { v = x; if (x == e) { x = d; } }1809// functions return old value1810char __kmpc_atomic_val_1_cas(ident_t *loc, int gtid, char *x, char e, char d);1811short __kmpc_atomic_val_2_cas(ident_t *loc, int gtid, short *x, short e,1812short d);1813kmp_int32 __kmpc_atomic_val_4_cas(ident_t *loc, int gtid, kmp_int32 *x,1814kmp_int32 e, kmp_int32 d);1815kmp_int64 __kmpc_atomic_val_8_cas(ident_t *loc, int gtid, kmp_int64 *x,1816kmp_int64 e, kmp_int64 d);18171818// { r = x == e; if(r) { x = d; } else { v = x; } }1819// v gets old value if comparison failed, untouched otherwise1820// functions return result of comparison1821bool __kmpc_atomic_bool_1_cas_cpt(ident_t *loc, int gtid, char *x, char e,1822char d, char *pv);1823bool __kmpc_atomic_bool_2_cas_cpt(ident_t *loc, int gtid, short *x, short e,1824short d, short *pv);1825bool __kmpc_atomic_bool_4_cas_cpt(ident_t *loc, int gtid, kmp_int32 *x,1826kmp_int32 e, kmp_int32 d, kmp_int32 *pv);1827bool __kmpc_atomic_bool_8_cas_cpt(ident_t *loc, int gtid, kmp_int64 *x,1828kmp_int64 e, kmp_int64 d, kmp_int64 *pv);18291830// { if (x == e) { x = d; }; v = x; }1831// v gets old value if comparison failed, new value otherwise1832// functions return old value1833char __kmpc_atomic_val_1_cas_cpt(ident_t *loc, int gtid, char *x, char e,1834char d, char *pv);1835short __kmpc_atomic_val_2_cas_cpt(ident_t *loc, int gtid, short *x, short e,1836short d, short *pv);1837kmp_int32 __kmpc_atomic_val_4_cas_cpt(ident_t *loc, int gtid, kmp_int32 *x,1838kmp_int32 e, kmp_int32 d, kmp_int32 *pv);1839kmp_int64 __kmpc_atomic_val_8_cas_cpt(ident_t *loc, int gtid, kmp_int64 *x,1840kmp_int64 e, kmp_int64 d, kmp_int64 *pv);18411842// End OpenMP 5.1 compare + capture18431844#endif // KMP_ARCH_X86 || KMP_ARCH_X86_6418451846/* ------------------------------------------------------------------------ */18471848#ifdef __cplusplus1849} // extern "C"1850#endif18511852#endif /* KMP_ATOMIC_H */18531854// end of file185518561857