[Openmp-commits] [PATCH] D60916: Add non-SSE wrapper for __kmp_{load, store}_mxcsr

Dimitry Andric via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon May 6 10:57:59 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rOMP360062: Add non-SSE wrapper for __kmp_{load,store}_mxcsr (authored by dim, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D60916?vs=197619&id=198308#toc

Repository:
  rOMP OpenMP

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60916/new/

https://reviews.llvm.org/D60916

Files:
  runtime/src/kmp.h


Index: runtime/src/kmp.h
===================================================================
--- runtime/src/kmp.h
+++ runtime/src/kmp.h
@@ -1243,16 +1243,22 @@
   __asm__ __volatile__("fnclex");
 #endif // KMP_MIC
 }
+#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 *p) {}
+static inline void __kmp_store_mxcsr(kmp_uint32 *p) { *p = 0; }
+#endif
 #else
 // Windows still has these as external functions in assembly file
 extern void __kmp_x86_cpuid(int mode, int mode2, struct kmp_cpuid *p);
 extern void __kmp_load_x87_fpu_control_word(const kmp_int16 *p);
 extern void __kmp_store_x87_fpu_control_word(kmp_int16 *p);
 extern void __kmp_clear_x87_fpu_status_word();
-#endif // KMP_OS_UNIX
-
-#define __kmp_load_mxcsr(p) _mm_setcsr(*(p))
+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(); }
+#endif // KMP_OS_UNIX
 
 #define KMP_X86_MXCSR_MASK 0xffffffc0 /* ignore status flags (6 lsb) */
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60916.198308.patch
Type: text/x-patch
Size: 1172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190506/64480da3/attachment.bin>


More information about the Openmp-commits mailing list