diff --git a/openmp/runtime/src/dllexports b/openmp/runtime/src/dllexports --- a/openmp/runtime/src/dllexports +++ b/openmp/runtime/src/dllexports @@ -1243,7 +1243,6 @@ %ifdef IS_IA_ARCH __kmpc_atomic_float10_max 2139 __kmpc_atomic_float10_min 2140 - %endif __kmpc_atomic_float10_max_cpt 2141 __kmpc_atomic_float10_min_cpt 2142 @@ -1263,6 +1262,7 @@ __kmpc_atomic_val_2_cas_cpt 2156 __kmpc_atomic_val_4_cas_cpt 2157 __kmpc_atomic_val_8_cas_cpt 2158 + %endif %endif diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h --- a/openmp/runtime/src/kmp_os.h +++ b/openmp/runtime/src/kmp_os.h @@ -618,6 +618,54 @@ // *)&v); return *(kmp_real64 *)&tmp; // } +#elif KMP_ARCH_AARCH64 && defined(__GNUC__) + +/* cast p to correct type so that proper intrinsic will be used */ +#define KMP_TEST_THEN_INC64(p) \ + __sync_fetch_and_add((volatile kmp_int64 *)(p), 1LL) +#define KMP_TEST_THEN_INC_ACQ64(p) \ + __sync_fetch_and_add((volatile kmp_int64 *)(p), 1LL) +#define KMP_TEST_THEN_ADD4_64(p) \ + __sync_fetch_and_add((volatile kmp_int64 *)(p), 4LL) +#define KMP_TEST_THEN_ADD4_ACQ64(p) \ + __sync_fetch_and_add((volatile kmp_int64 *)(p), 4LL) +#define KMP_TEST_THEN_DEC64(p) \ + __sync_fetch_and_sub((volatile kmp_int64 *)(p), 1LL) +#define KMP_TEST_THEN_DEC_ACQ64(p) \ + __sync_fetch_and_sub((volatile kmp_int64 *)(p), 1LL) +#define KMP_TEST_THEN_ADD64(p, v) \ + __sync_fetch_and_add((volatile kmp_int64 *)(p), (kmp_int64)(v)) +#define KMP_COMPARE_AND_STORE_ACQ8(p, cv, sv) \ + __sync_bool_compare_and_swap((volatile kmp_uint8 *)(p), (kmp_uint8)(cv), \ + (kmp_uint8)(sv)) +#define KMP_COMPARE_AND_STORE_REL8(p, cv, sv) \ + __sync_bool_compare_and_swap((volatile kmp_uint8 *)(p), (kmp_uint8)(cv), \ + (kmp_uint8)(sv)) +#define KMP_COMPARE_AND_STORE_ACQ16(p, cv, sv) \ + __sync_bool_compare_and_swap((volatile kmp_uint16 *)(p), (kmp_uint16)(cv), \ + (kmp_uint16)(sv)) +#define KMP_COMPARE_AND_STORE_REL16(p, cv, sv) \ + __sync_bool_compare_and_swap((volatile kmp_uint16 *)(p), (kmp_uint16)(cv), \ + (kmp_uint16)(sv)) +#define KMP_COMPARE_AND_STORE_ACQ32(p, cv, sv) \ + __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv), \ + (kmp_uint32)(sv)) +#define KMP_COMPARE_AND_STORE_REL32(p, cv, sv) \ + __sync_bool_compare_and_swap((volatile kmp_uint32 *)(p), (kmp_uint32)(cv), \ + (kmp_uint32)(sv)) +#define KMP_COMPARE_AND_STORE_ACQ64(p, cv, sv) \ + __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv), \ + (kmp_uint64)(sv)) +#define KMP_COMPARE_AND_STORE_REL64(p, cv, sv) \ + __sync_bool_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv), \ + (kmp_uint64)(sv)) +#define KMP_COMPARE_AND_STORE_RET64(p, cv, sv) \ + __sync_val_compare_and_swap((volatile kmp_uint64 *)(p), (kmp_uint64)(cv), \ + (kmp_uint64)(sv)) +#define KMP_COMPARE_AND_STORE_PTR(p, cv, sv) \ + __sync_bool_compare_and_swap((void *volatile *)(p), (void *)(cv), \ + (void *)(sv)) + #else // !KMP_ARCH_AARCH64 // Routines that we still need to implement in assembly. diff --git a/openmp/runtime/src/kmp_utility.cpp b/openmp/runtime/src/kmp_utility.cpp --- a/openmp/runtime/src/kmp_utility.cpp +++ b/openmp/runtime/src/kmp_utility.cpp @@ -370,7 +370,7 @@ case 'I': case 'i': { pid_t id = getpid(); -#if KMP_ARCH_X86_64 && defined(__MINGW32__) +#if (KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && defined(__MINGW32__) snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*lld", width, id); #else snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*d", width, id);