Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions stl/inc/atomic
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics
return reinterpret_cast<_Ty&>(_As_bytes);
}

#ifdef _M_IX86
#if defined(_M_IX86) && defined(__clang__) // TRANSITION, LLVM-46595
_Ty exchange(const _Ty _Value, const memory_order _Order = memory_order_seq_cst) noexcept {
// exchange with (effectively) sequential consistency
_Ty _Temp{load()};
Expand All @@ -737,15 +737,15 @@ struct _Atomic_storage<_Ty, 8> { // lock-free using 8-byte intrinsics

return _Temp;
}
#else // ^^^ _M_IX86 / !_M_IX86 vvv
#else // ^^^ defined(_M_IX86) && defined(__clang__), LLVM-46595 / !defined(_M_IX86) || !defined(__clang__) vvv
_Ty exchange(const _Ty _Value, const memory_order _Order = memory_order_seq_cst) noexcept {
// exchange with given memory order
long long _As_bytes;
_ATOMIC_CHOOSE_INTRINSIC(_Order, _As_bytes, _InterlockedExchange64, _Atomic_address_as<long long>(_Storage),
_Atomic_reinterpret_as<long long>(_Value));
return reinterpret_cast<_Ty&>(_As_bytes);
}
#endif // _M_IX86
#endif // ^^^ !defined(_M_IX86) || !defined(__clang__) ^^^

bool compare_exchange_strong(_Ty& _Expected, const _Ty _Desired,
const memory_order _Order = memory_order_seq_cst) noexcept { // CAS with given memory order
Expand Down Expand Up @@ -1067,7 +1067,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper
using _Base::_Base;
#endif // ^^^ no workaround ^^^

#ifdef _M_IX86
#if defined(_M_IX86) && defined(__clang__) // TRANSITION, LLVM-46595
_Ty fetch_add(const _Ty _Operand, const memory_order _Order = memory_order_seq_cst) noexcept {
// effectively sequential consistency
_Ty _Temp{this->load()};
Expand Down Expand Up @@ -1120,7 +1120,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper
return fetch_add(static_cast<_Ty>(-1)) - static_cast<_Ty>(1);
}

#else // ^^^ _M_IX86 / !_M_IX86 vvv
#else // ^^^ defined(_M_IX86) && defined(__clang__), LLVM-46595 / !defined(_M_IX86) || !defined(__clang__) vvv
_Ty fetch_add(const _Ty _Operand, const memory_order _Order = memory_order_seq_cst) noexcept {
long long _Result;
_ATOMIC_CHOOSE_INTRINSIC(_Order, _Result, _InterlockedExchangeAdd64,
Expand Down Expand Up @@ -1170,7 +1170,7 @@ struct _Atomic_integral<_Ty, 8> : _Atomic_storage<_Ty> { // atomic integral oper
_Ty operator--() noexcept {
return static_cast<_Ty>(_InterlockedDecrement64(_Atomic_address_as<long long>(this->_Storage)));
}
#endif // _M_IX86
#endif // ^^^ !defined(_M_IX86) || !defined(__clang__) ^^^
};

#if 1 // TRANSITION, ABI
Expand Down