summaryrefslogtreecommitdiff
path: root/src/atomic_ops/sysdeps/msftc/x86_64.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/atomic_ops/sysdeps/msftc/x86_64.h')
-rw-r--r--src/atomic_ops/sysdeps/msftc/x86_64.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/atomic_ops/sysdeps/msftc/x86_64.h b/src/atomic_ops/sysdeps/msftc/x86_64.h
index ed6eb0c..86fa2b7 100644
--- a/src/atomic_ops/sysdeps/msftc/x86_64.h
+++ b/src/atomic_ops/sysdeps/msftc/x86_64.h
@@ -114,6 +114,45 @@ AO_int_fetch_and_add_full(volatile unsigned int *p, unsigned int incr)
# define AO_HAVE_int_fetch_and_sub1_full
#endif /* !AO_PREFER_GENERALIZED */
+#if _MSC_VER > 1400
+# pragma intrinsic (_InterlockedAnd8)
+# pragma intrinsic (_InterlockedCompareExchange16)
+# pragma intrinsic (_InterlockedOr8)
+# pragma intrinsic (_InterlockedXor8)
+
+ AO_INLINE void
+ AO_char_and_full(volatile unsigned char *p, unsigned char value)
+ {
+ _InterlockedAnd8((char volatile *)p, value);
+ }
+# define AO_HAVE_char_and_full
+
+ AO_INLINE void
+ AO_char_or_full(volatile unsigned char *p, unsigned char value)
+ {
+ _InterlockedOr8((char volatile *)p, value);
+ }
+# define AO_HAVE_char_or_full
+
+ AO_INLINE void
+ AO_char_xor_full(volatile unsigned char *p, unsigned char value)
+ {
+ _InterlockedXor8((char volatile *)p, value);
+ }
+# define AO_HAVE_char_xor_full
+
+ AO_INLINE unsigned short
+ AO_short_fetch_compare_and_swap_full(volatile unsigned short *addr,
+ unsigned short old_val,
+ unsigned short new_val)
+ {
+ return _InterlockedCompareExchange16((short volatile *)addr,
+ new_val, old_val);
+ }
+# define AO_HAVE_short_fetch_compare_and_swap_full
+
+#endif /* _MSC_VER > 1400 */
+
#ifdef AO_ASM_X64_AVAILABLE
AO_INLINE unsigned char