Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Mar 2019 21:04:29 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345283 - in head: contrib/openmp/runtime/src lib
Message-ID:  <201903182104.x2IL4T83007900@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Mon Mar 18 21:04:28 2019
New Revision: 345283
URL: https://svnweb.freebsd.org/changeset/base/345283

Log:
  Enable building libomp.so for 32-bit x86.  This is done by selectively
  enabling the functions that save and restore MXCSR, since access to this
  register requires SSE support.
  
  Note that you may run into other issues with OpenMP on i386, since this
  *not* yet supported upstream, and certainly not extensively tested.
  
  PR:		236062, 236582
  MFC after:	1 month
  X-MFC-With:	r344779

Modified:
  head/contrib/openmp/runtime/src/kmp.h
  head/contrib/openmp/runtime/src/kmp_runtime.cpp
  head/lib/Makefile

Modified: head/contrib/openmp/runtime/src/kmp.h
==============================================================================
--- head/contrib/openmp/runtime/src/kmp.h	Mon Mar 18 19:56:00 2019	(r345282)
+++ head/contrib/openmp/runtime/src/kmp.h	Mon Mar 18 21:04:28 2019	(r345283)
@@ -3666,8 +3666,13 @@ extern int __kmp_read_from_file(char const *path, char
 
 extern void __kmp_query_cpuid(kmp_cpuinfo_t *p);
 
-#define __kmp_load_mxcsr(p) _mm_setcsr(*(p))
+#if __SSE__
+static inline void __kmp_load_mxcsr(const kmp_uint32 *p) { _mm_setcsr(*(p)); }
 static inline void __kmp_store_mxcsr(kmp_uint32 *p) { *p = _mm_getcsr(); }
+#else
+static inline void __kmp_load_mxcsr(const kmp_uint32 *) {}
+static inline void __kmp_store_mxcsr(kmp_uint32 *) {}
+#endif
 
 extern void __kmp_load_x87_fpu_control_word(kmp_int16 *p);
 extern void __kmp_store_x87_fpu_control_word(kmp_int16 *p);

Modified: head/contrib/openmp/runtime/src/kmp_runtime.cpp
==============================================================================
--- head/contrib/openmp/runtime/src/kmp_runtime.cpp	Mon Mar 18 19:56:00 2019	(r345282)
+++ head/contrib/openmp/runtime/src/kmp_runtime.cpp	Mon Mar 18 21:04:28 2019	(r345283)
@@ -8104,7 +8104,7 @@ __kmp_determine_reduction_method(
 
 #elif KMP_ARCH_X86 || KMP_ARCH_ARM || KMP_ARCH_AARCH || KMP_ARCH_MIPS
 
-#if KMP_OS_LINUX || KMP_OS_WINDOWS || KMP_OS_HURD
+#if KMP_OS_LINUX || KMP_OS_FREEBSD || KMP_OS_WINDOWS || KMP_OS_HURD
 
     // basic tuning
 

Modified: head/lib/Makefile
==============================================================================
--- head/lib/Makefile	Mon Mar 18 19:56:00 2019	(r345282)
+++ head/lib/Makefile	Mon Mar 18 21:04:28 2019	(r345283)
@@ -196,9 +196,7 @@ _libproc=	libproc
 _librtld_db=	librtld_db
 .endif
 
-.if !defined(COMPAT_32BIT)
 SUBDIR.${MK_OPENMP}+=	libomp
-.endif
 SUBDIR.${MK_OPENSSL}+=	libmp
 SUBDIR.${MK_PMC}+=	libpmc libpmcstat
 SUBDIR.${MK_RADIUS_SUPPORT}+=	libradius



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903182104.x2IL4T83007900>