equal
deleted
inserted
replaced
81 return rv; |
81 return rv; |
82 } |
82 } |
83 |
83 |
84 template<> |
84 template<> |
85 template<typename T> |
85 template<typename T> |
86 inline T Atomic::PlatformXchg<4>::operator()(T exchange_value, |
86 inline T Atomic::PlatformXchg<4>::operator()(T volatile* dest, |
87 T volatile* dest, |
87 T exchange_value, |
88 atomic_memory_order order) const { |
88 atomic_memory_order order) const { |
89 STATIC_ASSERT(4 == sizeof(T)); |
89 STATIC_ASSERT(4 == sizeof(T)); |
90 T rv = exchange_value; |
90 T rv = exchange_value; |
91 __asm__ volatile( |
91 __asm__ volatile( |
92 " swap [%2],%1\n\t" |
92 " swap [%2],%1\n\t" |
96 return rv; |
96 return rv; |
97 } |
97 } |
98 |
98 |
99 template<> |
99 template<> |
100 template<typename T> |
100 template<typename T> |
101 inline T Atomic::PlatformXchg<8>::operator()(T exchange_value, |
101 inline T Atomic::PlatformXchg<8>::operator()(T volatile* dest, |
102 T volatile* dest, |
102 T exchange_value, |
103 atomic_memory_order order) const { |
103 atomic_memory_order order) const { |
104 STATIC_ASSERT(8 == sizeof(T)); |
104 STATIC_ASSERT(8 == sizeof(T)); |
105 T rv = exchange_value; |
105 T rv = exchange_value; |
106 __asm__ volatile( |
106 __asm__ volatile( |
107 "1:\n\t" |
107 "1:\n\t" |