[Openmp-commits] [PATCH] D137168: [OpenMP][mingw] Fix build for aarch64 target
Alvin Wong via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Nov 2 00:55:01 PDT 2022
alvinhochun updated this revision to Diff 472521.
alvinhochun edited the summary of this revision.
alvinhochun added a comment.
Changed to make AArch64 + Windows + GNUC reuse existing macros implemented with
`__sync` builtins instead of making a copy of them. This should be functionally
equivalent because mingw-w64 implements a lot of the `Interlocked*` functions
with the `__sync` builtins anyway.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137168/new/
https://reviews.llvm.org/D137168
Files:
openmp/runtime/src/dllexports
openmp/runtime/src/kmp_os.h
openmp/runtime/src/kmp_utility.cpp
Index: openmp/runtime/src/kmp_utility.cpp
===================================================================
--- openmp/runtime/src/kmp_utility.cpp
+++ 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);
Index: openmp/runtime/src/kmp_os.h
===================================================================
--- openmp/runtime/src/kmp_os.h
+++ openmp/runtime/src/kmp_os.h
@@ -456,7 +456,7 @@
// Synchronization primitives
-#if KMP_ASM_INTRINS && KMP_OS_WINDOWS
+#if KMP_ASM_INTRINS && KMP_OS_WINDOWS && !(KMP_ARCH_AARCH64 && defined(__GNUC__))
#if KMP_MSVC_COMPAT && !KMP_COMPILER_CLANG
#pragma intrinsic(InterlockedExchangeAdd)
Index: openmp/runtime/src/dllexports
===================================================================
--- openmp/runtime/src/dllexports
+++ 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137168.472521.patch
Type: text/x-patch
Size: 1609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221102/cc98dddc/attachment-0001.bin>
More information about the Openmp-commits
mailing list