equal
deleted
inserted
replaced
122 template<> |
122 template<> |
123 struct Atomic::PlatformCmpxchg<1> : Atomic::CmpxchgByteUsingInt {}; |
123 struct Atomic::PlatformCmpxchg<1> : Atomic::CmpxchgByteUsingInt {}; |
124 |
124 |
125 template<> |
125 template<> |
126 template<typename T> |
126 template<typename T> |
127 inline T Atomic::PlatformCmpxchg<4>::operator()(T exchange_value, |
127 inline T Atomic::PlatformCmpxchg<4>::operator()(T volatile* dest, |
128 T volatile* dest, |
|
129 T compare_value, |
128 T compare_value, |
|
129 T exchange_value, |
130 atomic_memory_order order) const { |
130 atomic_memory_order order) const { |
131 STATIC_ASSERT(4 == sizeof(T)); |
131 STATIC_ASSERT(4 == sizeof(T)); |
132 T rv; |
132 T rv; |
133 __asm__ volatile( |
133 __asm__ volatile( |
134 " cas [%2], %3, %0" |
134 " cas [%2], %3, %0" |
138 return rv; |
138 return rv; |
139 } |
139 } |
140 |
140 |
141 template<> |
141 template<> |
142 template<typename T> |
142 template<typename T> |
143 inline T Atomic::PlatformCmpxchg<8>::operator()(T exchange_value, |
143 inline T Atomic::PlatformCmpxchg<8>::operator()(T volatile* dest, |
144 T volatile* dest, |
|
145 T compare_value, |
144 T compare_value, |
|
145 T exchange_value, |
146 atomic_memory_order order) const { |
146 atomic_memory_order order) const { |
147 STATIC_ASSERT(8 == sizeof(T)); |
147 STATIC_ASSERT(8 == sizeof(T)); |
148 T rv; |
148 T rv; |
149 __asm__ volatile( |
149 __asm__ volatile( |
150 " casx [%2], %3, %0" |
150 " casx [%2], %3, %0" |