[Openmp-commits] [PATCH] D77333: OpenMP: Support FreeBSD on AArch64.

Brooks Davis via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Apr 2 13:00:54 PDT 2020


brooks created this revision.
brooks added a reviewer: OpenMP.
Herald added subscribers: openmp-commits, guansong, kristof.beyls, krytarowski, arichardson, yaxunl, emaste.
Herald added a reviewer: jdoerfert.
Herald added a project: OpenMP.

This incidentlly makes FreeBSD's x86_64 support follow Linux.  This seems
to work fine and is probably simpler than the current divergence.

This work was submitted by Greg V in FreeBSD's phabricator
https://reviews.freebsd.org/D21167 and I have applied a slightly
different version to our packaged version of llvm10.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77333

Files:
  openmp/runtime/src/kmp.h
  openmp/runtime/src/kmp_csupport.cpp
  openmp/runtime/src/kmp_gsupport.cpp
  openmp/runtime/src/kmp_runtime.cpp


Index: openmp/runtime/src/kmp_runtime.cpp
===================================================================
--- openmp/runtime/src/kmp_runtime.cpp
+++ openmp/runtime/src/kmp_runtime.cpp
@@ -1390,7 +1390,7 @@
                     enum fork_context_e call_context, // Intel, GNU, ...
                     kmp_int32 argc, microtask_t microtask, launch_t invoker,
 /* TODO: revert workaround for Intel(R) 64 tracker #96 */
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX)
                     va_list *ap
 #else
                     va_list ap
@@ -1506,7 +1506,7 @@
       argv = (void **)parent_team->t.t_argv;
       for (i = argc - 1; i >= 0; --i)
 /* TODO: revert workaround for Intel(R) 64 tracker #96 */
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX)
         *argv++ = va_arg(*ap, void *);
 #else
         *argv++ = va_arg(ap, void *);
@@ -1805,7 +1805,7 @@
           if (ap) {
             for (i = argc - 1; i >= 0; --i)
 // TODO: revert workaround for Intel(R) 64 tracker #96
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX)
               *argv++ = va_arg(*ap, void *);
 #else
               *argv++ = va_arg(ap, void *);
@@ -1841,7 +1841,7 @@
           argv = args;
           for (i = argc - 1; i >= 0; --i)
 // TODO: revert workaround for Intel(R) 64 tracker #96
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX)
             *argv++ = va_arg(*ap, void *);
 #else
             *argv++ = va_arg(ap, void *);
@@ -2131,7 +2131,7 @@
     if (ap) {
       for (i = argc - 1; i >= 0; --i) {
 // TODO: revert workaround for Intel(R) 64 tracker #96
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX)
         void *new_argv = va_arg(*ap, void *);
 #else
         void *new_argv = va_arg(ap, void *);
Index: openmp/runtime/src/kmp_gsupport.cpp
===================================================================
--- openmp/runtime/src/kmp_gsupport.cpp
+++ openmp/runtime/src/kmp_gsupport.cpp
@@ -377,7 +377,7 @@
 
   rc = __kmp_fork_call(loc, gtid, fork_context_gnu, argc, wrapper,
                        __kmp_invoke_task_func,
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX)
                        &ap
 #else
                        ap
Index: openmp/runtime/src/kmp_csupport.cpp
===================================================================
--- openmp/runtime/src/kmp_csupport.cpp
+++ openmp/runtime/src/kmp_csupport.cpp
@@ -309,7 +309,7 @@
                     VOLATILE_CAST(microtask_t) microtask, // "wrapped" task
                     VOLATILE_CAST(launch_t) __kmp_invoke_task_func,
 /* TODO: revert workaround for Intel(R) 64 tracker #96 */
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX)
                     &ap
 #else
                     ap
@@ -412,7 +412,7 @@
                   VOLATILE_CAST(microtask_t)
                       __kmp_teams_master, // "wrapped" task
                   VOLATILE_CAST(launch_t) __kmp_invoke_teams_master,
-#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX
+#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX)
                   &ap
 #else
                   ap
Index: openmp/runtime/src/kmp.h
===================================================================
--- openmp/runtime/src/kmp.h
+++ openmp/runtime/src/kmp.h
@@ -3464,7 +3464,7 @@
                            enum fork_context_e fork_context, kmp_int32 argc,
                            microtask_t microtask, launch_t invoker,
 /* TODO: revert workaround for Intel(R) 64 tracker #96 */
-#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && KMP_OS_LINUX
+#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && (KMP_OS_FREEBSD || KMP_OS_LINUX)
                            va_list *ap
 #else
                            va_list ap


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77333.254604.patch
Type: text/x-patch
Size: 4574 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200402/bd8dad03/attachment.bin>


More information about the Openmp-commits mailing list