16#if defined( MI_ARCH_X86) && (defined( MI_COMPILER_GCC) || defined( MI_COMPILER_ICC))
17# define MI_ATOM32_X86GCC
40#ifndef MI_ATOM32_X86GCC
70 operator Uint32()
const {
return m_value; }
76#ifdef MI_ATOM32_X86GCC
81 std::atomic_uint32_t m_value;
85#ifndef MI_FOR_DOXYGEN_ONLY
87#ifdef MI_ATOM32_X86GCC
96 :
"=&r"( retval),
"+m"( m_value)
109 "lock; xaddl %0,%1\n"
111 :
"=&r"( retval),
"+m"( m_value)
123 "lock; xaddl %0,%1\n"
125 :
"=&r"( retval),
"+m"( m_value)
137 "lock; xaddl %0,%1\n"
138 :
"=&r"( retval),
"+m"( m_value)
150 "lock; xaddl %0,%1\n"
152 :
"=&r"( retval),
"+m"( m_value)
164 "lock; xaddl %0,%1\n"
165 :
"=&r"( retval),
"+m"( m_value)
178 "lock; cmpxchg %2,%1\n"
180 :
"=&a"( retval),
"+m"( m_value)
189inline Atom32::Atom32(
const Atom32& other) : m_value( other.m_value.load()) { }
193 m_value = rhs.m_value.load();
231 return m_value.exchange( rhs);
236#undef MI_ATOM32_X86GCC
A 32-bit unsigned counter with atomic arithmetic, increments, and decrements.
Definition: atom.h:32
Configuration of the Base API.
Uint32 operator-=(const Uint32 rhs)
Subtracts rhs from the counter.
Uint32 operator--(int)
Decrements the counter by one (post-decrement).
Atom32()
The default constructor initializes the counter to zero.
Definition: atom.h:35
Uint32 operator+=(const Uint32 rhs)
Adds rhs to the counter.
Uint32 operator=(const Uint32 rhs)
Assigns rhs to the counter.
Definition: atom.h:49
Uint32 operator++(int)
Increments the counter by one (post-increment).
Atom32(const Uint32 value)
This constructor initializes the counter to value.
Definition: atom.h:38
Atom32(const Atom32 &other)
The copy constructor assigns the value of other to the counter.
Uint32 operator++()
Increments the counter by one (pre-increment).
Atom32 & operator=(const Atom32 &rhs)
Assigns the value of rhs to the counter.
Uint32 swap(const Uint32 rhs)
Assigns rhs to the counter and returns the old value of counter.
Uint32 operator--()
Decrements the counter by one (pre-decrement).
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5