Use all available atomic operations on Windows (including 64-bit operations on 32-bit platforms).

This commit is contained in:
Pale Moon
2016-09-11 17:07:35 +02:00
committed by roytam1
parent dadb9d382c
commit ed17be95ff
+2 -10
View File
@@ -504,11 +504,7 @@ struct AtomicIntrinsics<T*, Order> : public IntrinsicMemoryOps<T*, Order>,
/*
* Windows comes with a full complement of atomic operations.
* Unfortunately, most of those aren't available for Windows XP (even if
* the compiler supports intrinsics for them), which is the oldest
* version of Windows we support. Therefore, we only provide operations
* on 32-bit datatypes for 32-bit Windows versions; for 64-bit Windows
* versions, we support 64-bit datatypes as well.
* We'll provide as much as we can for Vista and above.
*/
# include <intrin.h>
@@ -586,7 +582,7 @@ struct PrimitiveIntrinsics<4>
{
/*
* _InterlockedExchangeSubtract isn't available before Windows 7,
* and we must support Windows XP.
* and we must support Windows Vista.
*/
return _InterlockedExchangeAdd(aPtr, -aVal);
}
@@ -622,8 +618,6 @@ struct PrimitiveIntrinsics<4>
}
};
# if defined(_M_X64)
# pragma intrinsic(_InterlockedExchangeAdd64)
# pragma intrinsic(_InterlockedOr64)
# pragma intrinsic(_InterlockedXor64)
@@ -680,8 +674,6 @@ struct PrimitiveIntrinsics<8>
}
};
# endif
# pragma intrinsic(_ReadWriteBarrier)
template<MemoryOrdering Order> struct Barrier;