Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 1 | /* |
| 2 | * kmp_atomic.h - ATOMIC header file |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 3 | * $Revision: 42810 $ |
| 4 | * $Date: 2013-11-07 12:06:33 -0600 (Thu, 07 Nov 2013) $ |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // The LLVM Compiler Infrastructure |
| 11 | // |
| 12 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 13 | // Source Licenses. See LICENSE.txt for details. |
| 14 | // |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | |
| 17 | |
| 18 | #ifndef KMP_ATOMIC_H |
| 19 | #define KMP_ATOMIC_H |
| 20 | |
| 21 | #include "kmp_os.h" |
| 22 | #include "kmp_lock.h" |
| 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 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 33 | #if defined( __cplusplus ) && ( KMP_OS_WINDOWS ) |
| 34 | // create shortcuts for c99 complex types |
| 35 | |
| 36 | #ifdef _DEBUG |
| 37 | // Workaround for the problem of _DebugHeapTag unresolved external. |
| 38 | // This problem prevented to use our static debug library for C tests |
| 39 | // compiled with /MDd option (the library itself built with /MTd), |
| 40 | #undef _DEBUG |
| 41 | #define _DEBUG_TEMPORARILY_UNSET_ |
| 42 | #endif |
| 43 | |
| 44 | #include <complex> |
| 45 | |
| 46 | template< typename type_lhs, typename type_rhs > |
| 47 | std::complex< type_lhs > __kmp_lhs_div_rhs( |
| 48 | const std::complex< type_lhs >& lhs, |
| 49 | const std::complex< type_rhs >& rhs ) { |
| 50 | type_lhs a = lhs.real(); |
| 51 | type_lhs b = lhs.imag(); |
| 52 | type_rhs c = rhs.real(); |
| 53 | type_rhs d = rhs.imag(); |
| 54 | type_rhs den = c*c + d*d; |
| 55 | type_rhs r = ( a*c + b*d ); |
| 56 | type_rhs i = ( b*c - a*d ); |
| 57 | std::complex< type_lhs > ret( r/den, i/den ); |
| 58 | return ret; |
| 59 | } |
| 60 | |
| 61 | // complex8 |
| 62 | struct __kmp_cmplx64_t : std::complex< double > { |
| 63 | |
| 64 | __kmp_cmplx64_t() : std::complex< double > () {} |
| 65 | |
| 66 | __kmp_cmplx64_t( const std::complex< double >& cd ) |
| 67 | : std::complex< double > ( cd ) {} |
| 68 | |
| 69 | void operator /= ( const __kmp_cmplx64_t& rhs ) { |
| 70 | std::complex< double > lhs = *this; |
| 71 | *this = __kmp_lhs_div_rhs( lhs, rhs ); |
| 72 | } |
| 73 | |
| 74 | __kmp_cmplx64_t operator / ( const __kmp_cmplx64_t& rhs ) { |
| 75 | std::complex< double > lhs = *this; |
| 76 | return __kmp_lhs_div_rhs( lhs, rhs ); |
| 77 | } |
| 78 | |
| 79 | }; |
| 80 | typedef struct __kmp_cmplx64_t kmp_cmplx64; |
| 81 | |
| 82 | // complex4 |
| 83 | struct __kmp_cmplx32_t : std::complex< float > { |
| 84 | |
| 85 | __kmp_cmplx32_t() : std::complex< float > () {} |
| 86 | |
| 87 | __kmp_cmplx32_t( const std::complex<float>& cf ) |
| 88 | : std::complex< float > ( cf ) {} |
| 89 | |
| 90 | __kmp_cmplx32_t operator + ( const __kmp_cmplx32_t& b ) { |
| 91 | std::complex< float > lhs = *this; |
| 92 | std::complex< float > rhs = b; |
| 93 | return ( lhs + rhs ); |
| 94 | } |
| 95 | __kmp_cmplx32_t operator - ( const __kmp_cmplx32_t& b ) { |
| 96 | std::complex< float > lhs = *this; |
| 97 | std::complex< float > rhs = b; |
| 98 | return ( lhs - rhs ); |
| 99 | } |
| 100 | __kmp_cmplx32_t operator * ( const __kmp_cmplx32_t& b ) { |
| 101 | std::complex< float > lhs = *this; |
| 102 | std::complex< float > rhs = b; |
| 103 | return ( lhs * rhs ); |
| 104 | } |
| 105 | |
| 106 | __kmp_cmplx32_t operator + ( const kmp_cmplx64& b ) { |
| 107 | kmp_cmplx64 t = kmp_cmplx64( *this ) + b; |
| 108 | std::complex< double > d( t ); |
| 109 | std::complex< float > f( d ); |
| 110 | __kmp_cmplx32_t r( f ); |
| 111 | return r; |
| 112 | } |
| 113 | __kmp_cmplx32_t operator - ( const kmp_cmplx64& b ) { |
| 114 | kmp_cmplx64 t = kmp_cmplx64( *this ) - b; |
| 115 | std::complex< double > d( t ); |
| 116 | std::complex< float > f( d ); |
| 117 | __kmp_cmplx32_t r( f ); |
| 118 | return r; |
| 119 | } |
| 120 | __kmp_cmplx32_t operator * ( const kmp_cmplx64& b ) { |
| 121 | kmp_cmplx64 t = kmp_cmplx64( *this ) * b; |
| 122 | std::complex< double > d( t ); |
| 123 | std::complex< float > f( d ); |
| 124 | __kmp_cmplx32_t r( f ); |
| 125 | return r; |
| 126 | } |
| 127 | |
| 128 | void operator /= ( const __kmp_cmplx32_t& rhs ) { |
| 129 | std::complex< float > lhs = *this; |
| 130 | *this = __kmp_lhs_div_rhs( lhs, rhs ); |
| 131 | } |
| 132 | |
| 133 | __kmp_cmplx32_t operator / ( const __kmp_cmplx32_t& rhs ) { |
| 134 | std::complex< float > lhs = *this; |
| 135 | return __kmp_lhs_div_rhs( lhs, rhs ); |
| 136 | } |
| 137 | |
| 138 | void operator /= ( const kmp_cmplx64& rhs ) { |
| 139 | std::complex< float > lhs = *this; |
| 140 | *this = __kmp_lhs_div_rhs( lhs, rhs ); |
| 141 | } |
| 142 | |
| 143 | __kmp_cmplx32_t operator / ( const kmp_cmplx64& rhs ) { |
| 144 | std::complex< float > lhs = *this; |
| 145 | return __kmp_lhs_div_rhs( lhs, rhs ); |
| 146 | } |
| 147 | }; |
| 148 | typedef struct __kmp_cmplx32_t kmp_cmplx32; |
| 149 | |
| 150 | // complex10 |
| 151 | struct KMP_DO_ALIGN( 16 ) __kmp_cmplx80_t : std::complex< long double > { |
| 152 | |
| 153 | __kmp_cmplx80_t() : std::complex< long double > () {} |
| 154 | |
| 155 | __kmp_cmplx80_t( const std::complex< long double >& cld ) |
| 156 | : std::complex< long double > ( cld ) {} |
| 157 | |
| 158 | void operator /= ( const __kmp_cmplx80_t& rhs ) { |
| 159 | std::complex< long double > lhs = *this; |
| 160 | *this = __kmp_lhs_div_rhs( lhs, rhs ); |
| 161 | } |
| 162 | |
| 163 | __kmp_cmplx80_t operator / ( const __kmp_cmplx80_t& rhs ) { |
| 164 | std::complex< long double > lhs = *this; |
| 165 | return __kmp_lhs_div_rhs( lhs, rhs ); |
| 166 | } |
| 167 | |
| 168 | }; |
| 169 | typedef KMP_DO_ALIGN( 16 ) struct __kmp_cmplx80_t kmp_cmplx80; |
| 170 | |
| 171 | // complex16 |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 172 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 173 | struct __kmp_cmplx128_t : std::complex< _Quad > { |
| 174 | |
| 175 | __kmp_cmplx128_t() : std::complex< _Quad > () {} |
| 176 | |
| 177 | __kmp_cmplx128_t( const std::complex< _Quad >& cq ) |
| 178 | : std::complex< _Quad > ( cq ) {} |
| 179 | |
| 180 | void operator /= ( const __kmp_cmplx128_t& rhs ) { |
| 181 | std::complex< _Quad > lhs = *this; |
| 182 | *this = __kmp_lhs_div_rhs( lhs, rhs ); |
| 183 | } |
| 184 | |
| 185 | __kmp_cmplx128_t operator / ( const __kmp_cmplx128_t& rhs ) { |
| 186 | std::complex< _Quad > lhs = *this; |
| 187 | return __kmp_lhs_div_rhs( lhs, rhs ); |
| 188 | } |
| 189 | |
| 190 | }; |
| 191 | typedef struct __kmp_cmplx128_t kmp_cmplx128; |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 192 | #endif /* KMP_HAVE_QUAD */ |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 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; |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 205 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 206 | typedef _Quad _Complex kmp_cmplx128; |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 207 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 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. |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 214 | #if KMP_ARCH_X86 && KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 215 | |
| 216 | // 4-byte aligned structures for backward compatibility. |
| 217 | |
| 218 | #pragma pack( push, 4 ) |
| 219 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 220 | |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 221 | struct KMP_DO_ALIGN( 4 ) Quad_a4_t { |
| 222 | _Quad q; |
| 223 | |
| 224 | Quad_a4_t( ) : q( ) {} |
| 225 | Quad_a4_t( const _Quad & cq ) : q ( cq ) {} |
| 226 | |
| 227 | Quad_a4_t operator + ( const Quad_a4_t& b ) { |
| 228 | _Quad lhs = (*this).q; |
| 229 | _Quad rhs = b.q; |
| 230 | return (Quad_a4_t)( lhs + rhs ); |
| 231 | } |
| 232 | |
| 233 | Quad_a4_t operator - ( const Quad_a4_t& b ) { |
| 234 | _Quad lhs = (*this).q; |
| 235 | _Quad rhs = b.q; |
| 236 | return (Quad_a4_t)( lhs - rhs ); |
| 237 | } |
| 238 | Quad_a4_t operator * ( const Quad_a4_t& b ) { |
| 239 | _Quad lhs = (*this).q; |
| 240 | _Quad rhs = b.q; |
| 241 | return (Quad_a4_t)( lhs * rhs ); |
| 242 | } |
| 243 | |
| 244 | Quad_a4_t operator / ( const Quad_a4_t& b ) { |
| 245 | _Quad lhs = (*this).q; |
| 246 | _Quad rhs = b.q; |
| 247 | return (Quad_a4_t)( lhs / rhs ); |
| 248 | } |
| 249 | |
| 250 | }; |
| 251 | |
| 252 | struct KMP_DO_ALIGN( 4 ) kmp_cmplx128_a4_t { |
| 253 | kmp_cmplx128 q; |
| 254 | |
| 255 | kmp_cmplx128_a4_t() : q () {} |
| 256 | |
| 257 | kmp_cmplx128_a4_t( const kmp_cmplx128 & c128 ) : q ( c128 ) {} |
| 258 | |
| 259 | kmp_cmplx128_a4_t operator + ( const kmp_cmplx128_a4_t& b ) { |
| 260 | kmp_cmplx128 lhs = (*this).q; |
| 261 | kmp_cmplx128 rhs = b.q; |
| 262 | return (kmp_cmplx128_a4_t)( lhs + rhs ); |
| 263 | } |
| 264 | kmp_cmplx128_a4_t operator - ( const kmp_cmplx128_a4_t& b ) { |
| 265 | kmp_cmplx128 lhs = (*this).q; |
| 266 | kmp_cmplx128 rhs = b.q; |
| 267 | return (kmp_cmplx128_a4_t)( lhs - rhs ); |
| 268 | } |
| 269 | kmp_cmplx128_a4_t operator * ( const kmp_cmplx128_a4_t& b ) { |
| 270 | kmp_cmplx128 lhs = (*this).q; |
| 271 | kmp_cmplx128 rhs = b.q; |
| 272 | return (kmp_cmplx128_a4_t)( lhs * rhs ); |
| 273 | } |
| 274 | |
| 275 | kmp_cmplx128_a4_t operator / ( const kmp_cmplx128_a4_t& b ) { |
| 276 | kmp_cmplx128 lhs = (*this).q; |
| 277 | kmp_cmplx128 rhs = b.q; |
| 278 | return (kmp_cmplx128_a4_t)( lhs / rhs ); |
| 279 | } |
| 280 | |
| 281 | }; |
| 282 | |
| 283 | #pragma pack( pop ) |
| 284 | |
| 285 | // New 16-byte aligned structures for 12.0 compiler. |
| 286 | struct KMP_DO_ALIGN( 16 ) Quad_a16_t { |
| 287 | _Quad q; |
| 288 | |
| 289 | Quad_a16_t( ) : q( ) {} |
| 290 | Quad_a16_t( const _Quad & cq ) : q ( cq ) {} |
| 291 | |
| 292 | Quad_a16_t operator + ( const Quad_a16_t& b ) { |
| 293 | _Quad lhs = (*this).q; |
| 294 | _Quad rhs = b.q; |
| 295 | return (Quad_a16_t)( lhs + rhs ); |
| 296 | } |
| 297 | |
| 298 | Quad_a16_t operator - ( const Quad_a16_t& b ) { |
| 299 | _Quad lhs = (*this).q; |
| 300 | _Quad rhs = b.q; |
| 301 | return (Quad_a16_t)( lhs - rhs ); |
| 302 | } |
| 303 | Quad_a16_t operator * ( const Quad_a16_t& b ) { |
| 304 | _Quad lhs = (*this).q; |
| 305 | _Quad rhs = b.q; |
| 306 | return (Quad_a16_t)( lhs * rhs ); |
| 307 | } |
| 308 | |
| 309 | Quad_a16_t operator / ( const Quad_a16_t& b ) { |
| 310 | _Quad lhs = (*this).q; |
| 311 | _Quad rhs = b.q; |
| 312 | return (Quad_a16_t)( lhs / rhs ); |
| 313 | } |
| 314 | }; |
| 315 | |
| 316 | struct KMP_DO_ALIGN( 16 ) kmp_cmplx128_a16_t { |
| 317 | kmp_cmplx128 q; |
| 318 | |
| 319 | kmp_cmplx128_a16_t() : q () {} |
| 320 | |
| 321 | kmp_cmplx128_a16_t( const kmp_cmplx128 & c128 ) : q ( c128 ) {} |
| 322 | |
| 323 | kmp_cmplx128_a16_t operator + ( const kmp_cmplx128_a16_t& b ) { |
| 324 | kmp_cmplx128 lhs = (*this).q; |
| 325 | kmp_cmplx128 rhs = b.q; |
| 326 | return (kmp_cmplx128_a16_t)( lhs + rhs ); |
| 327 | } |
| 328 | kmp_cmplx128_a16_t operator - ( const kmp_cmplx128_a16_t& b ) { |
| 329 | kmp_cmplx128 lhs = (*this).q; |
| 330 | kmp_cmplx128 rhs = b.q; |
| 331 | return (kmp_cmplx128_a16_t)( lhs - rhs ); |
| 332 | } |
| 333 | kmp_cmplx128_a16_t operator * ( const kmp_cmplx128_a16_t& b ) { |
| 334 | kmp_cmplx128 lhs = (*this).q; |
| 335 | kmp_cmplx128 rhs = b.q; |
| 336 | return (kmp_cmplx128_a16_t)( lhs * rhs ); |
| 337 | } |
| 338 | |
| 339 | kmp_cmplx128_a16_t operator / ( const kmp_cmplx128_a16_t& b ) { |
| 340 | kmp_cmplx128 lhs = (*this).q; |
| 341 | kmp_cmplx128 rhs = b.q; |
| 342 | return (kmp_cmplx128_a16_t)( lhs / rhs ); |
| 343 | } |
| 344 | }; |
| 345 | |
| 346 | #endif |
| 347 | |
| 348 | #if ( KMP_ARCH_X86 ) |
| 349 | #define QUAD_LEGACY Quad_a4_t |
| 350 | #define CPLX128_LEG kmp_cmplx128_a4_t |
| 351 | #else |
| 352 | #define QUAD_LEGACY _Quad |
| 353 | #define CPLX128_LEG kmp_cmplx128 |
| 354 | #endif |
| 355 | |
| 356 | #ifdef __cplusplus |
| 357 | extern "C" { |
| 358 | #endif |
| 359 | |
| 360 | extern int __kmp_atomic_mode; |
| 361 | |
| 362 | // |
| 363 | // Atomic locks can easily become contended, so we use queuing locks for them. |
| 364 | // |
| 365 | |
| 366 | typedef kmp_queuing_lock_t kmp_atomic_lock_t; |
| 367 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 368 | static inline void |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 369 | __kmp_acquire_atomic_lock( kmp_atomic_lock_t *lck, kmp_int32 gtid ) |
| 370 | { |
| 371 | __kmp_acquire_queuing_lock( lck, gtid ); |
| 372 | } |
| 373 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 374 | static inline int |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 375 | __kmp_test_atomic_lock( kmp_atomic_lock_t *lck, kmp_int32 gtid ) |
| 376 | { |
| 377 | return __kmp_test_queuing_lock( lck, gtid ); |
| 378 | } |
| 379 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 380 | static inline void |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 381 | __kmp_release_atomic_lock( kmp_atomic_lock_t *lck, kmp_int32 gtid ) |
| 382 | { |
| 383 | __kmp_release_queuing_lock( lck, gtid ); |
| 384 | } |
| 385 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 386 | static inline void |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 387 | __kmp_init_atomic_lock( kmp_atomic_lock_t *lck ) |
| 388 | { |
| 389 | __kmp_init_queuing_lock( lck ); |
| 390 | } |
| 391 | |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 392 | static inline void |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 393 | __kmp_destroy_atomic_lock( kmp_atomic_lock_t *lck ) |
| 394 | { |
| 395 | __kmp_destroy_queuing_lock( lck ); |
| 396 | } |
| 397 | |
| 398 | // Global Locks |
| 399 | |
| 400 | extern kmp_atomic_lock_t __kmp_atomic_lock; /* Control access to all user coded atomics in Gnu compat mode */ |
| 401 | extern kmp_atomic_lock_t __kmp_atomic_lock_1i; /* Control access to all user coded atomics for 1-byte fixed data types */ |
| 402 | extern kmp_atomic_lock_t __kmp_atomic_lock_2i; /* Control access to all user coded atomics for 2-byte fixed data types */ |
| 403 | extern kmp_atomic_lock_t __kmp_atomic_lock_4i; /* Control access to all user coded atomics for 4-byte fixed data types */ |
| 404 | extern kmp_atomic_lock_t __kmp_atomic_lock_4r; /* Control access to all user coded atomics for kmp_real32 data type */ |
| 405 | extern kmp_atomic_lock_t __kmp_atomic_lock_8i; /* Control access to all user coded atomics for 8-byte fixed data types */ |
| 406 | extern kmp_atomic_lock_t __kmp_atomic_lock_8r; /* Control access to all user coded atomics for kmp_real64 data type */ |
| 407 | extern kmp_atomic_lock_t __kmp_atomic_lock_8c; /* Control access to all user coded atomics for complex byte data type */ |
| 408 | extern kmp_atomic_lock_t __kmp_atomic_lock_10r; /* Control access to all user coded atomics for long double data type */ |
| 409 | extern kmp_atomic_lock_t __kmp_atomic_lock_16r; /* Control access to all user coded atomics for _Quad data type */ |
| 410 | extern kmp_atomic_lock_t __kmp_atomic_lock_16c; /* Control access to all user coded atomics for double complex data type*/ |
| 411 | extern kmp_atomic_lock_t __kmp_atomic_lock_20c; /* Control access to all user coded atomics for long double complex type*/ |
| 412 | extern kmp_atomic_lock_t __kmp_atomic_lock_32c; /* Control access to all user coded atomics for _Quad complex data type */ |
| 413 | |
| 414 | // |
| 415 | // Below routines for atomic UPDATE are listed |
| 416 | // |
| 417 | |
| 418 | // 1-byte |
| 419 | void __kmpc_atomic_fixed1_add( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 420 | void __kmpc_atomic_fixed1_andb( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 421 | void __kmpc_atomic_fixed1_div( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 422 | void __kmpc_atomic_fixed1u_div( ident_t *id_ref, int gtid, unsigned char * lhs, unsigned char rhs ); |
| 423 | void __kmpc_atomic_fixed1_mul( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 424 | void __kmpc_atomic_fixed1_orb( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 425 | void __kmpc_atomic_fixed1_shl( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 426 | void __kmpc_atomic_fixed1_shr( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 427 | void __kmpc_atomic_fixed1u_shr( ident_t *id_ref, int gtid, unsigned char * lhs, unsigned char rhs ); |
| 428 | void __kmpc_atomic_fixed1_sub( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 429 | void __kmpc_atomic_fixed1_xor( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 430 | // 2-byte |
| 431 | void __kmpc_atomic_fixed2_add( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 432 | void __kmpc_atomic_fixed2_andb( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 433 | void __kmpc_atomic_fixed2_div( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 434 | void __kmpc_atomic_fixed2u_div( ident_t *id_ref, int gtid, unsigned short * lhs, unsigned short rhs ); |
| 435 | void __kmpc_atomic_fixed2_mul( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 436 | void __kmpc_atomic_fixed2_orb( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 437 | void __kmpc_atomic_fixed2_shl( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 438 | void __kmpc_atomic_fixed2_shr( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 439 | void __kmpc_atomic_fixed2u_shr( ident_t *id_ref, int gtid, unsigned short * lhs, unsigned short rhs ); |
| 440 | void __kmpc_atomic_fixed2_sub( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 441 | void __kmpc_atomic_fixed2_xor( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 442 | // 4-byte add / sub fixed |
| 443 | void __kmpc_atomic_fixed4_add( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 444 | void __kmpc_atomic_fixed4_sub( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 445 | // 4-byte add / sub float |
| 446 | void __kmpc_atomic_float4_add( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs ); |
| 447 | void __kmpc_atomic_float4_sub( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs ); |
| 448 | // 8-byte add / sub fixed |
| 449 | void __kmpc_atomic_fixed8_add( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 450 | void __kmpc_atomic_fixed8_sub( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 451 | // 8-byte add / sub float |
| 452 | void __kmpc_atomic_float8_add( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs ); |
| 453 | void __kmpc_atomic_float8_sub( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs ); |
| 454 | // 4-byte fixed |
| 455 | void __kmpc_atomic_fixed4_andb( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 456 | void __kmpc_atomic_fixed4_div( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 457 | void __kmpc_atomic_fixed4u_div( ident_t *id_ref, int gtid, kmp_uint32 * lhs, kmp_uint32 rhs ); |
| 458 | void __kmpc_atomic_fixed4_mul( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 459 | void __kmpc_atomic_fixed4_orb( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 460 | void __kmpc_atomic_fixed4_shl( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 461 | void __kmpc_atomic_fixed4_shr( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 462 | void __kmpc_atomic_fixed4u_shr( ident_t *id_ref, int gtid, kmp_uint32 * lhs, kmp_uint32 rhs ); |
| 463 | void __kmpc_atomic_fixed4_xor( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 464 | // 8-byte fixed |
| 465 | void __kmpc_atomic_fixed8_andb( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 466 | void __kmpc_atomic_fixed8_div( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 467 | void __kmpc_atomic_fixed8u_div( ident_t *id_ref, int gtid, kmp_uint64 * lhs, kmp_uint64 rhs ); |
| 468 | void __kmpc_atomic_fixed8_mul( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 469 | void __kmpc_atomic_fixed8_orb( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 470 | void __kmpc_atomic_fixed8_shl( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 471 | void __kmpc_atomic_fixed8_shr( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 472 | void __kmpc_atomic_fixed8u_shr( ident_t *id_ref, int gtid, kmp_uint64 * lhs, kmp_uint64 rhs ); |
| 473 | void __kmpc_atomic_fixed8_xor( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 474 | // 4-byte float |
| 475 | void __kmpc_atomic_float4_div( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs ); |
| 476 | void __kmpc_atomic_float4_mul( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs ); |
| 477 | // 8-byte float |
| 478 | void __kmpc_atomic_float8_div( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs ); |
| 479 | void __kmpc_atomic_float8_mul( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs ); |
| 480 | // 1-, 2-, 4-, 8-byte logical (&&, ||) |
| 481 | void __kmpc_atomic_fixed1_andl( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 482 | void __kmpc_atomic_fixed1_orl( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 483 | void __kmpc_atomic_fixed2_andl( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 484 | void __kmpc_atomic_fixed2_orl( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 485 | void __kmpc_atomic_fixed4_andl( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 486 | void __kmpc_atomic_fixed4_orl( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 487 | void __kmpc_atomic_fixed8_andl( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 488 | void __kmpc_atomic_fixed8_orl( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 489 | // MIN / MAX |
| 490 | void __kmpc_atomic_fixed1_max( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 491 | void __kmpc_atomic_fixed1_min( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 492 | void __kmpc_atomic_fixed2_max( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 493 | void __kmpc_atomic_fixed2_min( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 494 | void __kmpc_atomic_fixed4_max( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 495 | void __kmpc_atomic_fixed4_min( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 496 | void __kmpc_atomic_fixed8_max( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 497 | void __kmpc_atomic_fixed8_min( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 498 | void __kmpc_atomic_float4_max( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs ); |
| 499 | void __kmpc_atomic_float4_min( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs ); |
| 500 | void __kmpc_atomic_float8_max( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs ); |
| 501 | void __kmpc_atomic_float8_min( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 502 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 503 | void __kmpc_atomic_float16_max( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
| 504 | void __kmpc_atomic_float16_min( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
| 505 | #if ( KMP_ARCH_X86 ) |
| 506 | // Routines with 16-byte arguments aligned to 16-byte boundary; IA-32 architecture only |
| 507 | void __kmpc_atomic_float16_max_a16( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 508 | void __kmpc_atomic_float16_min_a16( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 509 | #endif |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 510 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 511 | // .NEQV. (same as xor) |
| 512 | void __kmpc_atomic_fixed1_neqv( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 513 | void __kmpc_atomic_fixed2_neqv( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 514 | void __kmpc_atomic_fixed4_neqv( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 515 | void __kmpc_atomic_fixed8_neqv( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 516 | // .EQV. (same as ~xor) |
| 517 | void __kmpc_atomic_fixed1_eqv( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 518 | void __kmpc_atomic_fixed2_eqv( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 519 | void __kmpc_atomic_fixed4_eqv( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 520 | void __kmpc_atomic_fixed8_eqv( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 521 | // long double type |
| 522 | void __kmpc_atomic_float10_add( ident_t *id_ref, int gtid, long double * lhs, long double rhs ); |
| 523 | void __kmpc_atomic_float10_sub( ident_t *id_ref, int gtid, long double * lhs, long double rhs ); |
| 524 | void __kmpc_atomic_float10_mul( ident_t *id_ref, int gtid, long double * lhs, long double rhs ); |
| 525 | void __kmpc_atomic_float10_div( ident_t *id_ref, int gtid, long double * lhs, long double rhs ); |
| 526 | // _Quad type |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 527 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 528 | void __kmpc_atomic_float16_add( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
| 529 | void __kmpc_atomic_float16_sub( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
| 530 | void __kmpc_atomic_float16_mul( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
| 531 | void __kmpc_atomic_float16_div( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
| 532 | #if ( KMP_ARCH_X86 ) |
| 533 | // Routines with 16-byte arguments aligned to 16-byte boundary |
| 534 | void __kmpc_atomic_float16_add_a16( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 535 | void __kmpc_atomic_float16_sub_a16( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 536 | void __kmpc_atomic_float16_mul_a16( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 537 | void __kmpc_atomic_float16_div_a16( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 538 | #endif |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 539 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 540 | // routines for complex types |
| 541 | void __kmpc_atomic_cmplx4_add( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs ); |
| 542 | void __kmpc_atomic_cmplx4_sub( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs ); |
| 543 | void __kmpc_atomic_cmplx4_mul( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs ); |
| 544 | void __kmpc_atomic_cmplx4_div( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs ); |
| 545 | void __kmpc_atomic_cmplx8_add( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs ); |
| 546 | void __kmpc_atomic_cmplx8_sub( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs ); |
| 547 | void __kmpc_atomic_cmplx8_mul( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs ); |
| 548 | void __kmpc_atomic_cmplx8_div( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs ); |
| 549 | void __kmpc_atomic_cmplx10_add( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs ); |
| 550 | void __kmpc_atomic_cmplx10_sub( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs ); |
| 551 | void __kmpc_atomic_cmplx10_mul( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs ); |
| 552 | void __kmpc_atomic_cmplx10_div( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 553 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 554 | void __kmpc_atomic_cmplx16_add( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs ); |
| 555 | void __kmpc_atomic_cmplx16_sub( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs ); |
| 556 | void __kmpc_atomic_cmplx16_mul( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs ); |
| 557 | void __kmpc_atomic_cmplx16_div( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs ); |
| 558 | #if ( KMP_ARCH_X86 ) |
| 559 | // Routines with 16-byte arguments aligned to 16-byte boundary |
| 560 | void __kmpc_atomic_cmplx16_add_a16( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs ); |
| 561 | void __kmpc_atomic_cmplx16_sub_a16( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs ); |
| 562 | void __kmpc_atomic_cmplx16_mul_a16( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs ); |
| 563 | void __kmpc_atomic_cmplx16_div_a16( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs ); |
| 564 | #endif |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 565 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 566 | |
| 567 | #if OMP_40_ENABLED |
| 568 | |
| 569 | // OpenMP 4.0: x = expr binop x for non-commutative operations. |
| 570 | // Supported only on IA-32 architecture and Intel(R) 64 |
| 571 | #if KMP_ARCH_X86 || KMP_ARCH_X86_64 |
| 572 | |
| 573 | void __kmpc_atomic_fixed1_sub_rev( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 574 | void __kmpc_atomic_fixed1_div_rev( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 575 | void __kmpc_atomic_fixed1u_div_rev( ident_t *id_ref, int gtid, unsigned char * lhs, unsigned char rhs ); |
| 576 | void __kmpc_atomic_fixed1_shl_rev( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 577 | void __kmpc_atomic_fixed1_shr_rev( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 578 | void __kmpc_atomic_fixed1u_shr_rev( ident_t *id_ref, int gtid, unsigned char * lhs, unsigned char rhs ); |
| 579 | void __kmpc_atomic_fixed2_sub_rev( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 580 | void __kmpc_atomic_fixed2_div_rev( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 581 | void __kmpc_atomic_fixed2u_div_rev( ident_t *id_ref, int gtid, unsigned short * lhs, unsigned short rhs ); |
| 582 | void __kmpc_atomic_fixed2_shl_rev( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 583 | void __kmpc_atomic_fixed2_shr_rev( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 584 | void __kmpc_atomic_fixed2u_shr_rev( ident_t *id_ref, int gtid, unsigned short * lhs, unsigned short rhs ); |
| 585 | void __kmpc_atomic_fixed4_sub_rev( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 586 | void __kmpc_atomic_fixed4_div_rev( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 587 | void __kmpc_atomic_fixed4u_div_rev( ident_t *id_ref, int gtid, kmp_uint32 * lhs, kmp_uint32 rhs ); |
| 588 | void __kmpc_atomic_fixed4_shl_rev( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 589 | void __kmpc_atomic_fixed4_shr_rev( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 590 | void __kmpc_atomic_fixed4u_shr_rev( ident_t *id_ref, int gtid, kmp_uint32 * lhs, kmp_uint32 rhs ); |
| 591 | void __kmpc_atomic_fixed8_sub_rev( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 592 | void __kmpc_atomic_fixed8_div_rev( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 593 | void __kmpc_atomic_fixed8u_div_rev( ident_t *id_ref, int gtid, kmp_uint64 * lhs, kmp_uint64 rhs ); |
| 594 | void __kmpc_atomic_fixed8_shl_rev( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 595 | void __kmpc_atomic_fixed8_shr_rev( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 596 | void __kmpc_atomic_fixed8u_shr_rev( ident_t *id_ref, int gtid, kmp_uint64 * lhs, kmp_uint64 rhs ); |
| 597 | void __kmpc_atomic_float4_sub_rev( ident_t *id_ref, int gtid, float * lhs, float rhs ); |
| 598 | void __kmpc_atomic_float4_div_rev( ident_t *id_ref, int gtid, float * lhs, float rhs ); |
| 599 | void __kmpc_atomic_float8_sub_rev( ident_t *id_ref, int gtid, double * lhs, double rhs ); |
| 600 | void __kmpc_atomic_float8_div_rev( ident_t *id_ref, int gtid, double * lhs, double rhs ); |
| 601 | void __kmpc_atomic_float10_sub_rev( ident_t *id_ref, int gtid, long double * lhs, long double rhs ); |
| 602 | void __kmpc_atomic_float10_div_rev( ident_t *id_ref, int gtid, long double * lhs, long double rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 603 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 604 | void __kmpc_atomic_float16_sub_rev( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
| 605 | void __kmpc_atomic_float16_div_rev( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 606 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 607 | void __kmpc_atomic_cmplx4_sub_rev( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs ); |
| 608 | void __kmpc_atomic_cmplx4_div_rev( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs ); |
| 609 | void __kmpc_atomic_cmplx8_sub_rev( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs ); |
| 610 | void __kmpc_atomic_cmplx8_div_rev( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs ); |
| 611 | void __kmpc_atomic_cmplx10_sub_rev( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs ); |
| 612 | void __kmpc_atomic_cmplx10_div_rev( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 613 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 614 | void __kmpc_atomic_cmplx16_sub_rev( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs ); |
| 615 | void __kmpc_atomic_cmplx16_div_rev( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs ); |
| 616 | #if ( KMP_ARCH_X86 ) |
| 617 | // Routines with 16-byte arguments aligned to 16-byte boundary |
| 618 | void __kmpc_atomic_float16_sub_a16_rev( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 619 | void __kmpc_atomic_float16_div_a16_rev( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 620 | void __kmpc_atomic_cmplx16_sub_a16_rev( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs ); |
| 621 | void __kmpc_atomic_cmplx16_div_a16_rev( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs ); |
| 622 | #endif |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 623 | #endif // KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 624 | |
| 625 | #endif //KMP_ARCH_X86 || KMP_ARCH_X86_64 |
| 626 | |
| 627 | #endif //OMP_40_ENABLED |
| 628 | |
| 629 | // routines for mixed types |
| 630 | |
| 631 | // RHS=float8 |
| 632 | void __kmpc_atomic_fixed1_mul_float8( ident_t *id_ref, int gtid, char * lhs, kmp_real64 rhs ); |
| 633 | void __kmpc_atomic_fixed1_div_float8( ident_t *id_ref, int gtid, char * lhs, kmp_real64 rhs ); |
| 634 | void __kmpc_atomic_fixed2_mul_float8( ident_t *id_ref, int gtid, short * lhs, kmp_real64 rhs ); |
| 635 | void __kmpc_atomic_fixed2_div_float8( ident_t *id_ref, int gtid, short * lhs, kmp_real64 rhs ); |
| 636 | void __kmpc_atomic_fixed4_mul_float8( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_real64 rhs ); |
| 637 | void __kmpc_atomic_fixed4_div_float8( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_real64 rhs ); |
| 638 | void __kmpc_atomic_fixed8_mul_float8( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_real64 rhs ); |
| 639 | void __kmpc_atomic_fixed8_div_float8( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_real64 rhs ); |
| 640 | void __kmpc_atomic_float4_add_float8( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real64 rhs ); |
| 641 | void __kmpc_atomic_float4_sub_float8( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real64 rhs ); |
| 642 | void __kmpc_atomic_float4_mul_float8( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real64 rhs ); |
| 643 | void __kmpc_atomic_float4_div_float8( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real64 rhs ); |
| 644 | |
| 645 | // RHS=float16 (deprecated, to be removed when we are sure the compiler does not use them) |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 646 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 647 | void __kmpc_atomic_fixed1_add_fp( ident_t *id_ref, int gtid, char * lhs, _Quad rhs ); |
| 648 | void __kmpc_atomic_fixed1_sub_fp( ident_t *id_ref, int gtid, char * lhs, _Quad rhs ); |
| 649 | void __kmpc_atomic_fixed1_mul_fp( ident_t *id_ref, int gtid, char * lhs, _Quad rhs ); |
| 650 | void __kmpc_atomic_fixed1_div_fp( ident_t *id_ref, int gtid, char * lhs, _Quad rhs ); |
| 651 | void __kmpc_atomic_fixed1u_div_fp( ident_t *id_ref, int gtid, unsigned char * lhs, _Quad rhs ); |
| 652 | |
| 653 | void __kmpc_atomic_fixed2_add_fp( ident_t *id_ref, int gtid, short * lhs, _Quad rhs ); |
| 654 | void __kmpc_atomic_fixed2_sub_fp( ident_t *id_ref, int gtid, short * lhs, _Quad rhs ); |
| 655 | void __kmpc_atomic_fixed2_mul_fp( ident_t *id_ref, int gtid, short * lhs, _Quad rhs ); |
| 656 | void __kmpc_atomic_fixed2_div_fp( ident_t *id_ref, int gtid, short * lhs, _Quad rhs ); |
| 657 | void __kmpc_atomic_fixed2u_div_fp( ident_t *id_ref, int gtid, unsigned short * lhs, _Quad rhs ); |
| 658 | |
| 659 | void __kmpc_atomic_fixed4_add_fp( ident_t *id_ref, int gtid, kmp_int32 * lhs, _Quad rhs ); |
| 660 | void __kmpc_atomic_fixed4_sub_fp( ident_t *id_ref, int gtid, kmp_int32 * lhs, _Quad rhs ); |
| 661 | void __kmpc_atomic_fixed4_mul_fp( ident_t *id_ref, int gtid, kmp_int32 * lhs, _Quad rhs ); |
| 662 | void __kmpc_atomic_fixed4_div_fp( ident_t *id_ref, int gtid, kmp_int32 * lhs, _Quad rhs ); |
| 663 | void __kmpc_atomic_fixed4u_div_fp( ident_t *id_ref, int gtid, kmp_uint32 * lhs, _Quad rhs ); |
| 664 | |
| 665 | void __kmpc_atomic_fixed8_add_fp( ident_t *id_ref, int gtid, kmp_int64 * lhs, _Quad rhs ); |
| 666 | void __kmpc_atomic_fixed8_sub_fp( ident_t *id_ref, int gtid, kmp_int64 * lhs, _Quad rhs ); |
| 667 | void __kmpc_atomic_fixed8_mul_fp( ident_t *id_ref, int gtid, kmp_int64 * lhs, _Quad rhs ); |
| 668 | void __kmpc_atomic_fixed8_div_fp( ident_t *id_ref, int gtid, kmp_int64 * lhs, _Quad rhs ); |
| 669 | void __kmpc_atomic_fixed8u_div_fp( ident_t *id_ref, int gtid, kmp_uint64 * lhs, _Quad rhs ); |
| 670 | |
| 671 | void __kmpc_atomic_float4_add_fp( ident_t *id_ref, int gtid, kmp_real32 * lhs, _Quad rhs ); |
| 672 | void __kmpc_atomic_float4_sub_fp( ident_t *id_ref, int gtid, kmp_real32 * lhs, _Quad rhs ); |
| 673 | void __kmpc_atomic_float4_mul_fp( ident_t *id_ref, int gtid, kmp_real32 * lhs, _Quad rhs ); |
| 674 | void __kmpc_atomic_float4_div_fp( ident_t *id_ref, int gtid, kmp_real32 * lhs, _Quad rhs ); |
| 675 | |
| 676 | void __kmpc_atomic_float8_add_fp( ident_t *id_ref, int gtid, kmp_real64 * lhs, _Quad rhs ); |
| 677 | void __kmpc_atomic_float8_sub_fp( ident_t *id_ref, int gtid, kmp_real64 * lhs, _Quad rhs ); |
| 678 | void __kmpc_atomic_float8_mul_fp( ident_t *id_ref, int gtid, kmp_real64 * lhs, _Quad rhs ); |
| 679 | void __kmpc_atomic_float8_div_fp( ident_t *id_ref, int gtid, kmp_real64 * lhs, _Quad rhs ); |
| 680 | |
| 681 | void __kmpc_atomic_float10_add_fp( ident_t *id_ref, int gtid, long double * lhs, _Quad rhs ); |
| 682 | void __kmpc_atomic_float10_sub_fp( ident_t *id_ref, int gtid, long double * lhs, _Quad rhs ); |
| 683 | void __kmpc_atomic_float10_mul_fp( ident_t *id_ref, int gtid, long double * lhs, _Quad rhs ); |
| 684 | void __kmpc_atomic_float10_div_fp( ident_t *id_ref, int gtid, long double * lhs, _Quad rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 685 | #endif // KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 686 | |
| 687 | // RHS=cmplx8 |
| 688 | void __kmpc_atomic_cmplx4_add_cmplx8( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx64 rhs ); |
| 689 | void __kmpc_atomic_cmplx4_sub_cmplx8( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx64 rhs ); |
| 690 | void __kmpc_atomic_cmplx4_mul_cmplx8( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx64 rhs ); |
| 691 | void __kmpc_atomic_cmplx4_div_cmplx8( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx64 rhs ); |
| 692 | |
| 693 | // generic atomic routines |
| 694 | void __kmpc_atomic_1( ident_t *id_ref, int gtid, void* lhs, void* rhs, void (*f)( void *, void *, void * ) ); |
| 695 | void __kmpc_atomic_2( ident_t *id_ref, int gtid, void* lhs, void* rhs, void (*f)( void *, void *, void * ) ); |
| 696 | void __kmpc_atomic_4( ident_t *id_ref, int gtid, void* lhs, void* rhs, void (*f)( void *, void *, void * ) ); |
| 697 | void __kmpc_atomic_8( ident_t *id_ref, int gtid, void* lhs, void* rhs, void (*f)( void *, void *, void * ) ); |
| 698 | void __kmpc_atomic_10( ident_t *id_ref, int gtid, void* lhs, void* rhs, void (*f)( void *, void *, void * ) ); |
| 699 | void __kmpc_atomic_16( ident_t *id_ref, int gtid, void* lhs, void* rhs, void (*f)( void *, void *, void * ) ); |
| 700 | void __kmpc_atomic_20( ident_t *id_ref, int gtid, void* lhs, void* rhs, void (*f)( void *, void *, void * ) ); |
| 701 | void __kmpc_atomic_32( ident_t *id_ref, int gtid, void* lhs, void* rhs, void (*f)( void *, void *, void * ) ); |
| 702 | |
| 703 | // READ, WRITE, CAPTURE are supported only on IA-32 architecture and Intel(R) 64 |
| 704 | #if KMP_ARCH_X86 || KMP_ARCH_X86_64 |
| 705 | |
| 706 | // |
| 707 | // Below routines for atomic READ are listed |
| 708 | // |
| 709 | |
| 710 | char __kmpc_atomic_fixed1_rd( ident_t *id_ref, int gtid, char * loc ); |
| 711 | short __kmpc_atomic_fixed2_rd( ident_t *id_ref, int gtid, short * loc ); |
| 712 | kmp_int32 __kmpc_atomic_fixed4_rd( ident_t *id_ref, int gtid, kmp_int32 * loc ); |
| 713 | kmp_int64 __kmpc_atomic_fixed8_rd( ident_t *id_ref, int gtid, kmp_int64 * loc ); |
| 714 | kmp_real32 __kmpc_atomic_float4_rd( ident_t *id_ref, int gtid, kmp_real32 * loc ); |
| 715 | kmp_real64 __kmpc_atomic_float8_rd( ident_t *id_ref, int gtid, kmp_real64 * loc ); |
| 716 | long double __kmpc_atomic_float10_rd( ident_t *id_ref, int gtid, long double * loc ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 717 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 718 | QUAD_LEGACY __kmpc_atomic_float16_rd( ident_t *id_ref, int gtid, QUAD_LEGACY * loc ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 719 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 720 | // Fix for CQ220361: cmplx4 READ will return void on Windows* OS; read value will be |
| 721 | // returned through an additional parameter |
| 722 | #if ( KMP_OS_WINDOWS ) |
| 723 | void __kmpc_atomic_cmplx4_rd( kmp_cmplx32 * out, ident_t *id_ref, int gtid, kmp_cmplx32 * loc ); |
| 724 | #else |
| 725 | kmp_cmplx32 __kmpc_atomic_cmplx4_rd( ident_t *id_ref, int gtid, kmp_cmplx32 * loc ); |
| 726 | #endif |
| 727 | kmp_cmplx64 __kmpc_atomic_cmplx8_rd( ident_t *id_ref, int gtid, kmp_cmplx64 * loc ); |
| 728 | kmp_cmplx80 __kmpc_atomic_cmplx10_rd( ident_t *id_ref, int gtid, kmp_cmplx80 * loc ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 729 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 730 | CPLX128_LEG __kmpc_atomic_cmplx16_rd( ident_t *id_ref, int gtid, CPLX128_LEG * loc ); |
| 731 | #if ( KMP_ARCH_X86 ) |
| 732 | // Routines with 16-byte arguments aligned to 16-byte boundary |
| 733 | Quad_a16_t __kmpc_atomic_float16_a16_rd( ident_t * id_ref, int gtid, Quad_a16_t * loc ); |
| 734 | kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_a16_rd( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * loc ); |
| 735 | #endif |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 736 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 737 | |
| 738 | |
| 739 | // |
| 740 | // Below routines for atomic WRITE are listed |
| 741 | // |
| 742 | |
| 743 | void __kmpc_atomic_fixed1_wr( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 744 | void __kmpc_atomic_fixed2_wr( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 745 | void __kmpc_atomic_fixed4_wr( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 746 | void __kmpc_atomic_fixed8_wr( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 747 | void __kmpc_atomic_float4_wr( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs ); |
| 748 | void __kmpc_atomic_float8_wr( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs ); |
| 749 | void __kmpc_atomic_float10_wr( ident_t *id_ref, int gtid, long double * lhs, long double rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 750 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 751 | void __kmpc_atomic_float16_wr( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 752 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 753 | void __kmpc_atomic_cmplx4_wr( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs ); |
| 754 | void __kmpc_atomic_cmplx8_wr( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs ); |
| 755 | void __kmpc_atomic_cmplx10_wr( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 756 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 757 | void __kmpc_atomic_cmplx16_wr( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs ); |
| 758 | #if ( KMP_ARCH_X86 ) |
| 759 | // Routines with 16-byte arguments aligned to 16-byte boundary |
| 760 | void __kmpc_atomic_float16_a16_wr( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 761 | void __kmpc_atomic_cmplx16_a16_wr( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs ); |
| 762 | #endif |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 763 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 764 | |
| 765 | // |
| 766 | // Below routines for atomic CAPTURE are listed |
| 767 | // |
| 768 | |
| 769 | // 1-byte |
| 770 | char __kmpc_atomic_fixed1_add_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 771 | char __kmpc_atomic_fixed1_andb_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 772 | char __kmpc_atomic_fixed1_div_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 773 | unsigned char __kmpc_atomic_fixed1u_div_cpt( ident_t *id_ref, int gtid, unsigned char * lhs, unsigned char rhs, int flag); |
| 774 | char __kmpc_atomic_fixed1_mul_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 775 | char __kmpc_atomic_fixed1_orb_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 776 | char __kmpc_atomic_fixed1_shl_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 777 | char __kmpc_atomic_fixed1_shr_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 778 | unsigned char __kmpc_atomic_fixed1u_shr_cpt( ident_t *id_ref, int gtid, unsigned char * lhs, unsigned char rhs, int flag); |
| 779 | char __kmpc_atomic_fixed1_sub_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 780 | char __kmpc_atomic_fixed1_xor_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 781 | // 2-byte |
| 782 | short __kmpc_atomic_fixed2_add_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 783 | short __kmpc_atomic_fixed2_andb_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 784 | short __kmpc_atomic_fixed2_div_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 785 | unsigned short __kmpc_atomic_fixed2u_div_cpt( ident_t *id_ref, int gtid, unsigned short * lhs, unsigned short rhs, int flag); |
| 786 | short __kmpc_atomic_fixed2_mul_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 787 | short __kmpc_atomic_fixed2_orb_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 788 | short __kmpc_atomic_fixed2_shl_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 789 | short __kmpc_atomic_fixed2_shr_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 790 | unsigned short __kmpc_atomic_fixed2u_shr_cpt( ident_t *id_ref, int gtid, unsigned short * lhs, unsigned short rhs, int flag); |
| 791 | short __kmpc_atomic_fixed2_sub_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 792 | short __kmpc_atomic_fixed2_xor_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 793 | // 4-byte add / sub fixed |
| 794 | kmp_int32 __kmpc_atomic_fixed4_add_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 795 | kmp_int32 __kmpc_atomic_fixed4_sub_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 796 | // 4-byte add / sub float |
| 797 | kmp_real32 __kmpc_atomic_float4_add_cpt( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs, int flag); |
| 798 | kmp_real32 __kmpc_atomic_float4_sub_cpt( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs, int flag); |
| 799 | // 8-byte add / sub fixed |
| 800 | kmp_int64 __kmpc_atomic_fixed8_add_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 801 | kmp_int64 __kmpc_atomic_fixed8_sub_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 802 | // 8-byte add / sub float |
| 803 | kmp_real64 __kmpc_atomic_float8_add_cpt( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs, int flag); |
| 804 | kmp_real64 __kmpc_atomic_float8_sub_cpt( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs, int flag); |
| 805 | // 4-byte fixed |
| 806 | kmp_int32 __kmpc_atomic_fixed4_andb_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 807 | kmp_int32 __kmpc_atomic_fixed4_div_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 808 | kmp_uint32 __kmpc_atomic_fixed4u_div_cpt( ident_t *id_ref, int gtid, kmp_uint32 * lhs, kmp_uint32 rhs, int flag); |
| 809 | kmp_int32 __kmpc_atomic_fixed4_mul_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 810 | kmp_int32 __kmpc_atomic_fixed4_orb_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 811 | kmp_int32 __kmpc_atomic_fixed4_shl_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 812 | kmp_int32 __kmpc_atomic_fixed4_shr_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 813 | kmp_uint32 __kmpc_atomic_fixed4u_shr_cpt( ident_t *id_ref, int gtid, kmp_uint32 * lhs, kmp_uint32 rhs, int flag); |
| 814 | kmp_int32 __kmpc_atomic_fixed4_xor_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 815 | // 8-byte fixed |
| 816 | kmp_int64 __kmpc_atomic_fixed8_andb_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 817 | kmp_int64 __kmpc_atomic_fixed8_div_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 818 | kmp_uint64 __kmpc_atomic_fixed8u_div_cpt( ident_t *id_ref, int gtid, kmp_uint64 * lhs, kmp_uint64 rhs, int flag); |
| 819 | kmp_int64 __kmpc_atomic_fixed8_mul_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 820 | kmp_int64 __kmpc_atomic_fixed8_orb_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 821 | kmp_int64 __kmpc_atomic_fixed8_shl_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 822 | kmp_int64 __kmpc_atomic_fixed8_shr_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 823 | kmp_uint64 __kmpc_atomic_fixed8u_shr_cpt( ident_t *id_ref, int gtid, kmp_uint64 * lhs, kmp_uint64 rhs, int flag); |
| 824 | kmp_int64 __kmpc_atomic_fixed8_xor_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 825 | // 4-byte float |
| 826 | kmp_real32 __kmpc_atomic_float4_div_cpt( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs, int flag); |
| 827 | kmp_real32 __kmpc_atomic_float4_mul_cpt( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs, int flag); |
| 828 | // 8-byte float |
| 829 | kmp_real64 __kmpc_atomic_float8_div_cpt( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs, int flag); |
| 830 | kmp_real64 __kmpc_atomic_float8_mul_cpt( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs, int flag); |
| 831 | // 1-, 2-, 4-, 8-byte logical (&&, ||) |
| 832 | char __kmpc_atomic_fixed1_andl_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 833 | char __kmpc_atomic_fixed1_orl_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 834 | short __kmpc_atomic_fixed2_andl_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 835 | short __kmpc_atomic_fixed2_orl_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 836 | kmp_int32 __kmpc_atomic_fixed4_andl_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 837 | kmp_int32 __kmpc_atomic_fixed4_orl_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 838 | kmp_int64 __kmpc_atomic_fixed8_andl_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 839 | kmp_int64 __kmpc_atomic_fixed8_orl_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 840 | // MIN / MAX |
| 841 | char __kmpc_atomic_fixed1_max_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 842 | char __kmpc_atomic_fixed1_min_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 843 | short __kmpc_atomic_fixed2_max_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 844 | short __kmpc_atomic_fixed2_min_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 845 | kmp_int32 __kmpc_atomic_fixed4_max_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 846 | kmp_int32 __kmpc_atomic_fixed4_min_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 847 | kmp_int64 __kmpc_atomic_fixed8_max_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 848 | kmp_int64 __kmpc_atomic_fixed8_min_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 849 | kmp_real32 __kmpc_atomic_float4_max_cpt( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs, int flag); |
| 850 | kmp_real32 __kmpc_atomic_float4_min_cpt( ident_t *id_ref, int gtid, kmp_real32 * lhs, kmp_real32 rhs, int flag); |
| 851 | kmp_real64 __kmpc_atomic_float8_max_cpt( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs, int flag); |
| 852 | kmp_real64 __kmpc_atomic_float8_min_cpt( ident_t *id_ref, int gtid, kmp_real64 * lhs, kmp_real64 rhs, int flag); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 853 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 854 | QUAD_LEGACY __kmpc_atomic_float16_max_cpt( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs, int flag); |
| 855 | QUAD_LEGACY __kmpc_atomic_float16_min_cpt( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs, int flag); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 856 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 857 | // .NEQV. (same as xor) |
| 858 | char __kmpc_atomic_fixed1_neqv_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 859 | short __kmpc_atomic_fixed2_neqv_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 860 | kmp_int32 __kmpc_atomic_fixed4_neqv_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 861 | kmp_int64 __kmpc_atomic_fixed8_neqv_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 862 | // .EQV. (same as ~xor) |
| 863 | char __kmpc_atomic_fixed1_eqv_cpt( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag); |
| 864 | short __kmpc_atomic_fixed2_eqv_cpt( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag); |
| 865 | kmp_int32 __kmpc_atomic_fixed4_eqv_cpt( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag); |
| 866 | kmp_int64 __kmpc_atomic_fixed8_eqv_cpt( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag); |
| 867 | // long double type |
| 868 | long double __kmpc_atomic_float10_add_cpt( ident_t *id_ref, int gtid, long double * lhs, long double rhs, int flag); |
| 869 | long double __kmpc_atomic_float10_sub_cpt( ident_t *id_ref, int gtid, long double * lhs, long double rhs, int flag); |
| 870 | long double __kmpc_atomic_float10_mul_cpt( ident_t *id_ref, int gtid, long double * lhs, long double rhs, int flag); |
| 871 | long double __kmpc_atomic_float10_div_cpt( ident_t *id_ref, int gtid, long double * lhs, long double rhs, int flag); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 872 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 873 | // _Quad type |
| 874 | QUAD_LEGACY __kmpc_atomic_float16_add_cpt( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs, int flag); |
| 875 | QUAD_LEGACY __kmpc_atomic_float16_sub_cpt( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs, int flag); |
| 876 | QUAD_LEGACY __kmpc_atomic_float16_mul_cpt( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs, int flag); |
| 877 | QUAD_LEGACY __kmpc_atomic_float16_div_cpt( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs, int flag); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 878 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 879 | // routines for complex types |
| 880 | // Workaround for cmplx4 routines - return void; captured value is returned via the argument |
| 881 | void __kmpc_atomic_cmplx4_add_cpt( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs, kmp_cmplx32 * out, int flag); |
| 882 | void __kmpc_atomic_cmplx4_sub_cpt( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs, kmp_cmplx32 * out, int flag); |
| 883 | void __kmpc_atomic_cmplx4_mul_cpt( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs, kmp_cmplx32 * out, int flag); |
| 884 | void __kmpc_atomic_cmplx4_div_cpt( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs, kmp_cmplx32 * out, int flag); |
| 885 | |
| 886 | kmp_cmplx64 __kmpc_atomic_cmplx8_add_cpt( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs, int flag); |
| 887 | kmp_cmplx64 __kmpc_atomic_cmplx8_sub_cpt( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs, int flag); |
| 888 | kmp_cmplx64 __kmpc_atomic_cmplx8_mul_cpt( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs, int flag); |
| 889 | kmp_cmplx64 __kmpc_atomic_cmplx8_div_cpt( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs, int flag); |
| 890 | kmp_cmplx80 __kmpc_atomic_cmplx10_add_cpt( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs, int flag); |
| 891 | kmp_cmplx80 __kmpc_atomic_cmplx10_sub_cpt( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs, int flag); |
| 892 | kmp_cmplx80 __kmpc_atomic_cmplx10_mul_cpt( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs, int flag); |
| 893 | kmp_cmplx80 __kmpc_atomic_cmplx10_div_cpt( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs, int flag); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 894 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 895 | CPLX128_LEG __kmpc_atomic_cmplx16_add_cpt( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs, int flag); |
| 896 | CPLX128_LEG __kmpc_atomic_cmplx16_sub_cpt( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs, int flag); |
| 897 | CPLX128_LEG __kmpc_atomic_cmplx16_mul_cpt( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs, int flag); |
| 898 | CPLX128_LEG __kmpc_atomic_cmplx16_div_cpt( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs, int flag); |
| 899 | #if ( KMP_ARCH_X86 ) |
| 900 | // Routines with 16-byte arguments aligned to 16-byte boundary |
| 901 | Quad_a16_t __kmpc_atomic_float16_add_a16_cpt( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs, int flag); |
| 902 | Quad_a16_t __kmpc_atomic_float16_sub_a16_cpt( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs, int flag); |
| 903 | Quad_a16_t __kmpc_atomic_float16_mul_a16_cpt( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs, int flag); |
| 904 | Quad_a16_t __kmpc_atomic_float16_div_a16_cpt( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs, int flag); |
| 905 | Quad_a16_t __kmpc_atomic_float16_max_a16_cpt( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs, int flag); |
| 906 | Quad_a16_t __kmpc_atomic_float16_min_a16_cpt( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs, int flag); |
| 907 | kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_add_a16_cpt( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs, int flag); |
| 908 | kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_sub_a16_cpt( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs, int flag); |
| 909 | kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_mul_a16_cpt( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs, int flag); |
| 910 | kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_div_a16_cpt( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs, int flag); |
| 911 | #endif |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 912 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 913 | |
| 914 | void __kmpc_atomic_start(void); |
| 915 | void __kmpc_atomic_end(void); |
| 916 | |
| 917 | #if OMP_40_ENABLED |
| 918 | |
| 919 | // OpenMP 4.0: v = x = expr binop x; { v = x; x = expr binop x; } { x = expr binop x; v = x; } for non-commutative operations. |
| 920 | |
| 921 | char __kmpc_atomic_fixed1_sub_cpt_rev( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag ); |
| 922 | char __kmpc_atomic_fixed1_div_cpt_rev( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag ); |
| 923 | unsigned char __kmpc_atomic_fixed1u_div_cpt_rev( ident_t *id_ref, int gtid, unsigned char * lhs, unsigned char rhs, int flag ); |
| 924 | char __kmpc_atomic_fixed1_shl_cpt_rev( ident_t *id_ref, int gtid, char * lhs, char rhs , int flag); |
| 925 | char __kmpc_atomic_fixed1_shr_cpt_rev( ident_t *id_ref, int gtid, char * lhs, char rhs, int flag ); |
| 926 | unsigned char __kmpc_atomic_fixed1u_shr_cpt_rev( ident_t *id_ref, int gtid, unsigned char * lhs, unsigned char rhs, int flag ); |
| 927 | short __kmpc_atomic_fixed2_sub_cpt_rev( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag ); |
| 928 | short __kmpc_atomic_fixed2_div_cpt_rev( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag ); |
| 929 | unsigned short __kmpc_atomic_fixed2u_div_cpt_rev( ident_t *id_ref, int gtid, unsigned short * lhs, unsigned short rhs, int flag ); |
| 930 | short __kmpc_atomic_fixed2_shl_cpt_rev( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag ); |
| 931 | short __kmpc_atomic_fixed2_shr_cpt_rev( ident_t *id_ref, int gtid, short * lhs, short rhs, int flag ); |
| 932 | unsigned short __kmpc_atomic_fixed2u_shr_cpt_rev( ident_t *id_ref, int gtid, unsigned short * lhs, unsigned short rhs, int flag ); |
| 933 | kmp_int32 __kmpc_atomic_fixed4_sub_cpt_rev( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag ); |
| 934 | kmp_int32 __kmpc_atomic_fixed4_div_cpt_rev( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag ); |
| 935 | kmp_uint32 __kmpc_atomic_fixed4u_div_cpt_rev( ident_t *id_ref, int gtid, kmp_uint32 * lhs, kmp_uint32 rhs, int flag ); |
| 936 | kmp_int32 __kmpc_atomic_fixed4_shl_cpt_rev( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag ); |
| 937 | kmp_int32 __kmpc_atomic_fixed4_shr_cpt_rev( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs, int flag ); |
| 938 | kmp_uint32 __kmpc_atomic_fixed4u_shr_cpt_rev( ident_t *id_ref, int gtid, kmp_uint32 * lhs, kmp_uint32 rhs, int flag ); |
| 939 | kmp_int64 __kmpc_atomic_fixed8_sub_cpt_rev( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag ); |
| 940 | kmp_int64 __kmpc_atomic_fixed8_div_cpt_rev( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag ); |
| 941 | kmp_uint64 __kmpc_atomic_fixed8u_div_cpt_rev( ident_t *id_ref, int gtid, kmp_uint64 * lhs, kmp_uint64 rhs, int flag ); |
| 942 | kmp_int64 __kmpc_atomic_fixed8_shl_cpt_rev( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag ); |
| 943 | kmp_int64 __kmpc_atomic_fixed8_shr_cpt_rev( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs, int flag ); |
| 944 | kmp_uint64 __kmpc_atomic_fixed8u_shr_cpt_rev( ident_t *id_ref, int gtid, kmp_uint64 * lhs, kmp_uint64 rhs, int flag ); |
| 945 | float __kmpc_atomic_float4_sub_cpt_rev( ident_t *id_ref, int gtid, float * lhs, float rhs, int flag ); |
| 946 | float __kmpc_atomic_float4_div_cpt_rev( ident_t *id_ref, int gtid, float * lhs, float rhs, int flag ); |
| 947 | double __kmpc_atomic_float8_sub_cpt_rev( ident_t *id_ref, int gtid, double * lhs, double rhs, int flag ); |
| 948 | double __kmpc_atomic_float8_div_cpt_rev( ident_t *id_ref, int gtid, double * lhs, double rhs, int flag ); |
| 949 | long double __kmpc_atomic_float10_sub_cpt_rev( ident_t *id_ref, int gtid, long double * lhs, long double rhs, int flag ); |
| 950 | long double __kmpc_atomic_float10_div_cpt_rev( ident_t *id_ref, int gtid, long double * lhs, long double rhs, int flag ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 951 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 952 | QUAD_LEGACY __kmpc_atomic_float16_sub_cpt_rev( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs, int flag ); |
| 953 | QUAD_LEGACY __kmpc_atomic_float16_div_cpt_rev( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs, int flag ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 954 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 955 | // Workaround for cmplx4 routines - return void; captured value is returned via the argument |
| 956 | void __kmpc_atomic_cmplx4_sub_cpt_rev( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs, kmp_cmplx32 * out, int flag ); |
| 957 | void __kmpc_atomic_cmplx4_div_cpt_rev( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs, kmp_cmplx32 * out, int flag ); |
| 958 | kmp_cmplx64 __kmpc_atomic_cmplx8_sub_cpt_rev( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs, int flag ); |
| 959 | kmp_cmplx64 __kmpc_atomic_cmplx8_div_cpt_rev( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs, int flag ); |
| 960 | kmp_cmplx80 __kmpc_atomic_cmplx10_sub_cpt_rev( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs, int flag ); |
| 961 | kmp_cmplx80 __kmpc_atomic_cmplx10_div_cpt_rev( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs, int flag ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 962 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 963 | CPLX128_LEG __kmpc_atomic_cmplx16_sub_cpt_rev( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs, int flag ); |
| 964 | CPLX128_LEG __kmpc_atomic_cmplx16_div_cpt_rev( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs, int flag ); |
| 965 | #if ( KMP_ARCH_X86 ) |
| 966 | Quad_a16_t __kmpc_atomic_float16_sub_a16_cpt_rev( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs, int flag ); |
| 967 | Quad_a16_t __kmpc_atomic_float16_div_a16_cpt_rev( ident_t * id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs, int flag ); |
| 968 | kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_sub_a16_cpt_rev( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs, int flag ); |
| 969 | kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_div_a16_cpt_rev( ident_t * id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs, int flag ); |
| 970 | #endif |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 971 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 972 | |
| 973 | // OpenMP 4.0 Capture-write (swap): {v = x; x = expr;} |
| 974 | char __kmpc_atomic_fixed1_swp( ident_t *id_ref, int gtid, char * lhs, char rhs ); |
| 975 | short __kmpc_atomic_fixed2_swp( ident_t *id_ref, int gtid, short * lhs, short rhs ); |
| 976 | kmp_int32 __kmpc_atomic_fixed4_swp( ident_t *id_ref, int gtid, kmp_int32 * lhs, kmp_int32 rhs ); |
| 977 | kmp_int64 __kmpc_atomic_fixed8_swp( ident_t *id_ref, int gtid, kmp_int64 * lhs, kmp_int64 rhs ); |
| 978 | float __kmpc_atomic_float4_swp( ident_t *id_ref, int gtid, float * lhs, float rhs ); |
| 979 | double __kmpc_atomic_float8_swp( ident_t *id_ref, int gtid, double * lhs, double rhs ); |
| 980 | long double __kmpc_atomic_float10_swp( ident_t *id_ref, int gtid, long double * lhs, long double rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 981 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 982 | QUAD_LEGACY __kmpc_atomic_float16_swp( ident_t *id_ref, int gtid, QUAD_LEGACY * lhs, QUAD_LEGACY rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 983 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 984 | // !!! TODO: check if we need a workaround here |
| 985 | void __kmpc_atomic_cmplx4_swp( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs, kmp_cmplx32 * out ); |
| 986 | //kmp_cmplx32 __kmpc_atomic_cmplx4_swp( ident_t *id_ref, int gtid, kmp_cmplx32 * lhs, kmp_cmplx32 rhs ); |
| 987 | |
| 988 | kmp_cmplx64 __kmpc_atomic_cmplx8_swp( ident_t *id_ref, int gtid, kmp_cmplx64 * lhs, kmp_cmplx64 rhs ); |
| 989 | kmp_cmplx80 __kmpc_atomic_cmplx10_swp( ident_t *id_ref, int gtid, kmp_cmplx80 * lhs, kmp_cmplx80 rhs ); |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 990 | #if KMP_HAVE_QUAD |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 991 | CPLX128_LEG __kmpc_atomic_cmplx16_swp( ident_t *id_ref, int gtid, CPLX128_LEG * lhs, CPLX128_LEG rhs ); |
| 992 | #if ( KMP_ARCH_X86 ) |
| 993 | Quad_a16_t __kmpc_atomic_float16_a16_swp( ident_t *id_ref, int gtid, Quad_a16_t * lhs, Quad_a16_t rhs ); |
| 994 | kmp_cmplx128_a16_t __kmpc_atomic_cmplx16_a16_swp( ident_t *id_ref, int gtid, kmp_cmplx128_a16_t * lhs, kmp_cmplx128_a16_t rhs ); |
| 995 | #endif |
Jim Cownie | 181b4bb | 2013-12-23 17:28:57 +0000 | [diff] [blame^] | 996 | #endif |
Jim Cownie | 5e8470a | 2013-09-27 10:38:44 +0000 | [diff] [blame] | 997 | |
| 998 | // End of OpenMP 4.0 capture |
| 999 | |
| 1000 | #endif //OMP_40_ENABLED |
| 1001 | |
| 1002 | #endif //KMP_ARCH_X86 || KMP_ARCH_X86_64 |
| 1003 | |
| 1004 | /* ------------------------------------------------------------------------ */ |
| 1005 | /* ------------------------------------------------------------------------ */ |
| 1006 | |
| 1007 | #ifdef __cplusplus |
| 1008 | } // extern "C" |
| 1009 | #endif |
| 1010 | |
| 1011 | #endif /* KMP_ATOMIC_H */ |
| 1012 | |
| 1013 | // end of file |