include: Add ReadNoFence64 inline helpers.

This commit is contained in:
Rémi Bernon 2023-06-16 09:58:53 +02:00 committed by Alexandre Julliard
parent fac940dfac
commit f82b1c1fcf

View file

@ -7082,11 +7082,14 @@ static FORCEINLINE void MemoryBarrier(void)
*/
#if _MSC_VER >= 1700
#pragma intrinsic(__iso_volatile_load32)
#pragma intrinsic(__iso_volatile_load64)
#pragma intrinsic(__iso_volatile_store32)
#define __WINE_LOAD32_NO_FENCE(src) (__iso_volatile_load32(src))
#define __WINE_LOAD64_NO_FENCE(src) (__iso_volatile_load64(src))
#define __WINE_STORE32_NO_FENCE(dest, value) (__iso_volatile_store32(dest, value))
#else /* _MSC_VER >= 1700 */
#define __WINE_LOAD32_NO_FENCE(src) (*(src))
#define __WINE_LOAD64_NO_FENCE(src) (*(src))
#define __WINE_STORE32_NO_FENCE(dest, value) ((void)(*(dest) = (value)))
#endif /* _MSC_VER >= 1700 */
@ -7120,6 +7123,12 @@ static FORCEINLINE LONG ReadNoFence( LONG const volatile *src )
return value;
}
static FORCEINLINE LONG64 ReadNoFence64( LONG64 const volatile *src )
{
LONG64 value = __WINE_LOAD64_NO_FENCE( (__int64 const volatile *)src );
return value;
}
static FORCEINLINE void WriteRelease( LONG volatile *dest, LONG value )
{
__wine_memory_barrier_acq_rel();
@ -7306,6 +7315,13 @@ static FORCEINLINE LONG ReadNoFence( LONG const volatile *src )
return value;
}
static FORCEINLINE LONG64 ReadNoFence64( LONG64 const volatile *src )
{
LONG64 value;
__WINE_ATOMIC_LOAD_RELAXED( src, &value );
return value;
}
static FORCEINLINE void WriteRelease( LONG volatile *dest, LONG value )
{
__WINE_ATOMIC_STORE_RELEASE( dest, &value );