[+] Atomic: Missing int32/64 msvc atomic decs

[*] Atomic: Normalize away externally-volatile attribute
This commit is contained in:
Reece Wilson 2022-11-17 23:26:48 +00:00
parent 0c3f6c4158
commit 122fc74a66

View File

@ -146,6 +146,18 @@ inline auline AuUInt32 AuAtomicUtils<AuUInt32>::Sub(AuUInt32 *in, AuUInt32 minue
return Add(in, AuUInt32(0) - minuend);
}
template <>
inline auline AuInt64 AuAtomicUtils<AuInt64>::Sub(AuInt64 *in, AuInt64 minuend)
{
return Add(in, AuInt64(0) - minuend);
}
template <>
inline auline AuInt32 AuAtomicUtils<AuInt32>::Sub(AuInt32 *in, AuInt32 minuend)
{
return Add(in, AuInt32(0) - minuend);
}
// TODO:
#if 0
template <>
@ -300,40 +312,82 @@ template <class T>
auline
T AuAtomicSet(T *in, AuUInt8 offset)
{
return AuAtomicUtils<AuRemoveVolatile_t<T>>::Set(in, offset);
return AuAtomicUtils<T>::Set(in, offset);
}
template <class T>
auline
T AuAtomicOr(T *in, T value)
{
return AuAtomicUtils<AuRemoveVolatile_t<T>>::Or(in, value);
return AuAtomicUtils<T>::Or(in, value);
}
template <class T>
auline
T AuAtomicAdd(T *in, T addend)
{
return AuAtomicUtils<AuRemoveVolatile_t<T>>::Add(in, addend);
return AuAtomicUtils<T>::Add(in, addend);
}
template <class T>
auline
T AuAtomicSub(T *in, T minuend)
{
return AuAtomicUtils<AuRemoveVolatile_t<T>>::Sub(in, minuend);
return AuAtomicUtils<T>::Sub(in, minuend);
}
template <class T>
auline
T AuAtomicCompareExchange(T *in, T replace, T compare)
{
return AuAtomicUtils<AuRemoveVolatile_t<T>>::CompareExchange(in, replace, compare);
return AuAtomicUtils<T>::CompareExchange(in, replace, compare);
}
template <class T>
auline
bool AuAtomicTestAndSet(T *in, AuUInt8 offset)
{
return AuAtomicUtils<AuRemoveVolatile_t<T>>::TestAndSet(in, offset);
return AuAtomicUtils<T>::TestAndSet(in, offset);
}
template <class T>
auline
T AuAtomicSet(volatile T *in, AuUInt8 offset)
{
return AuAtomicUtils<T>::Set(reinterpret_cast<T *>(in), offset);
}
template <class T>
auline
T AuAtomicOr(volatile T *in, T value)
{
return AuAtomicUtils<T>::Or(reinterpret_cast<T *>(in), value);
}
template <class T>
auline
T AuAtomicAdd(volatile T *in, T addend)
{
return AuAtomicUtils<T>::Add(reinterpret_cast<T *>(in), addend);
}
template <class T>
auline
T AuAtomicSub(volatile T *in, T minuend)
{
return AuAtomicUtils<T>::Sub(reinterpret_cast<T *>(in), minuend);
}
template <class T>
auline
T AuAtomicCompareExchange(volatile T *in, T replace, T compare)
{
return AuAtomicUtils<T>::CompareExchange(reinterpret_cast<T *>(in), replace, compare);
}
template <class T>
auline
bool AuAtomicTestAndSet(volatile T *in, AuUInt8 offset)
{
return AuAtomicUtils<T>::TestAndSet(reinterpret_cast<T *>(in), offset);
}