pull/1/head
xiaofeng@google.com 11 years ago
parent 3aa5ea95a9
commit e7f2937962
  1. 26
      src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h

@ -117,10 +117,8 @@ inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr,
inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
Atomic32 increment) { Atomic32 increment) {
Atomic32 result;
MemoryBarrier(); MemoryBarrier();
result = NoBarrier_AtomicIncrement(ptr, increment); Atomic32 result = NoBarrier_AtomicIncrement(ptr, increment);
MemoryBarrier(); MemoryBarrier();
return result; return result;
@ -129,9 +127,7 @@ inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr,
inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value, Atomic32 old_value,
Atomic32 new_value) { Atomic32 new_value) {
Atomic32 prev; Atomic32 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
MemoryBarrier(); MemoryBarrier();
return prev; return prev;
@ -140,10 +136,8 @@ inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr,
inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr,
Atomic32 old_value, Atomic32 old_value,
Atomic32 new_value) { Atomic32 new_value) {
Atomic32 prev;
MemoryBarrier(); MemoryBarrier();
prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value); Atomic32 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
return prev; return prev;
} }
@ -259,10 +253,8 @@ inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr,
inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
Atomic64 increment) { Atomic64 increment) {
Atomic64 result;
MemoryBarrier(); MemoryBarrier();
result = NoBarrier_AtomicIncrement(ptr, increment); Atomic64 result = NoBarrier_AtomicIncrement(ptr, increment);
MemoryBarrier(); MemoryBarrier();
return result; return result;
@ -271,9 +263,7 @@ inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr,
inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value, Atomic64 old_value,
Atomic64 new_value) { Atomic64 new_value) {
Atomic64 prev; Atomic64 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
MemoryBarrier(); MemoryBarrier();
return prev; return prev;
@ -282,10 +272,8 @@ inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr,
inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr,
Atomic64 old_value, Atomic64 old_value,
Atomic64 new_value) { Atomic64 new_value) {
Atomic64 prev;
MemoryBarrier(); MemoryBarrier();
prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value); Atomic64 prev = NoBarrier_CompareAndSwap(ptr, old_value, new_value);
return prev; return prev;
} }
@ -313,7 +301,7 @@ inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) {
} }
inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) { inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) {
Atomic32 value; Atomic64 value;
__asm__ __volatile__ ( // NOLINT __asm__ __volatile__ ( // NOLINT
"ldar %x[value], %[ptr] \n\t" "ldar %x[value], %[ptr] \n\t"

Loading…
Cancel
Save