summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-10-29 21:56:27 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-10-29 21:56:27 +0300
commitf2213c36d2d7d26f2f5466f45003d33f6d94ac62 (patch)
tree5418041f3811e6345bea65db3348985d4a792aa5
parent15144d440bb5b1293d0ab7e7d8bda07570e4f480 (diff)
downloadlibatomic_ops-f2213c36d2d7d26f2f5466f45003d33f6d94ac62.tar.gz
Always use 'mfence' for nop_full if target CPU supports SSE2 (MS VC/x86)
* src/atomic_ops/sysdeps/msftc/x86.h [!AO_USE_PENTIUM4_INSTRS && _M_IX86_FP>=2] (AO_USE_PENTIUM4_INSTRS): Define; add comment.
-rw-r--r--src/atomic_ops/sysdeps/msftc/x86.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/atomic_ops/sysdeps/msftc/x86.h b/src/atomic_ops/sysdeps/msftc/x86.h
index d18ac13..ba2400a 100644
--- a/src/atomic_ops/sysdeps/msftc/x86.h
+++ b/src/atomic_ops/sysdeps/msftc/x86.h
@@ -35,6 +35,11 @@
# define AO_ASSUME_WINDOWS98
#endif
+#if !defined(AO_USE_PENTIUM4_INSTRS) && _M_IX86_FP >= 2 /* SSE2 */
+ /* "mfence" is a part of SSE2 set (introduced on Intel Pentium 4). */
+# define AO_USE_PENTIUM4_INSTRS
+#endif
+
#define AO_T_IS_INT
#ifndef AO_USE_INTERLOCKED_INTRINSICS