33 #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM64_GCC_H_
34 #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM64_GCC_H_
41 __asm__ __volatile__ (
"dmb ish" :::
"memory");
58 __asm__ __volatile__ (
60 "ldxr %w[prev], %[ptr] \n\t"
61 "cmp %w[prev], %w[old_value] \n\t"
63 "stxr %w[temp], %w[new_value], %[ptr] \n\t"
64 "cbnz %w[temp], 0b \n\t"
69 : [old_value]
"IJr" (old_value),
70 [new_value]
"r" (new_value)
82 __asm__ __volatile__ (
84 "ldxr %w[result], %[ptr] \n\t"
85 "stxr %w[temp], %w[new_value], %[ptr] \n\t"
86 "cbnz %w[temp], 0b \n\t"
87 : [result]
"=&r" (result),
90 : [new_value]
"r" (new_value)
102 __asm__ __volatile__ (
104 "ldxr %w[result], %[ptr] \n\t"
105 "add %w[result], %w[result], %w[increment]\n\t"
106 "stxr %w[temp], %w[result], %[ptr] \n\t"
107 "cbnz %w[temp], 0b \n\t"
108 : [result]
"=&r" (result),
111 : [increment]
"IJr" (increment)
155 __asm__ __volatile__ (
156 "stlr %w[value], %[ptr] \n\t"
170 __asm__ __volatile__ (
171 "ldar %w[value], %[ptr] \n\t"
172 : [value]
"=r" (value)
190 Atomic64 new_value) {
194 __asm__ __volatile__ (
196 "ldxr %[prev], %[ptr] \n\t"
197 "cmp %[prev], %[old_value] \n\t"
199 "stxr %w[temp], %[new_value], %[ptr] \n\t"
200 "cbnz %w[temp], 0b \n\t"
202 : [prev]
"=&r" (prev),
205 : [old_value]
"IJr" (old_value),
206 [new_value]
"r" (new_value)
214 Atomic64 new_value) {
218 __asm__ __volatile__ (
220 "ldxr %[result], %[ptr] \n\t"
221 "stxr %w[temp], %[new_value], %[ptr] \n\t"
222 "cbnz %w[temp], 0b \n\t"
223 : [result]
"=&r" (result),
226 : [new_value]
"r" (new_value)
234 Atomic64 increment) {
238 __asm__ __volatile__ (
240 "ldxr %[result], %[ptr] \n\t"
241 "add %[result], %[result], %[increment] \n\t"
242 "stxr %w[temp], %[result], %[ptr] \n\t"
243 "cbnz %w[temp], 0b \n\t"
244 : [result]
"=&r" (result),
247 : [increment]
"IJr" (increment)
255 Atomic64 increment) {
265 Atomic64 new_value) {
274 Atomic64 new_value) {
291 __asm__ __volatile__ (
292 "stlr %x[value], %[ptr] \n\t"
306 __asm__ __volatile__ (
307 "ldar %x[value], %[ptr] \n\t"
308 : [value]
"=r" (value)
325 #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_ARM64_GCC_H_
Atomic32 Acquire_Load(volatile const Atomic32 *ptr)
Definition: atomicops_internals_arm64_gcc.h:167
void Acquire_Store(volatile Atomic32 *ptr, Atomic32 value)
Definition: atomicops_internals_arm64_gcc.h:149
Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)
Definition: atomicops_internals_arm64_gcc.h:52
void Release_Store(volatile Atomic32 *ptr, Atomic32 value)
Definition: atomicops_internals_arm64_gcc.h:154
Atomic32 Release_Load(volatile const Atomic32 *ptr)
Definition: atomicops_internals_arm64_gcc.h:180
Definition: document.h:390
int32 Atomic32
Definition: atomicops.h:65
int prev(int i, int n)
Definition: RecastContour.cpp:468
Atomic32 Release_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)
Definition: atomicops_internals_arm64_gcc.h:136
Atomic32 Barrier_AtomicIncrement(volatile Atomic32 *ptr, Atomic32 increment)
Definition: atomicops_internals_arm64_gcc.h:118
Definition: BnetFileGenerator.h:47
Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32 *ptr, Atomic32 increment)
Definition: atomicops_internals_arm64_gcc.h:97
signed int int32_t
Definition: stdint.h:77
const FieldDescriptor value
Definition: descriptor.h:1522
Atomic32 NoBarrier_AtomicExchange(volatile Atomic32 *ptr, Atomic32 new_value)
Definition: atomicops_internals_arm64_gcc.h:77
void NoBarrier_Store(volatile Atomic32 *ptr, Atomic32 value)
Definition: atomicops_internals_arm64_gcc.h:145
Atomic32 NoBarrier_Load(volatile const Atomic32 *ptr)
Definition: atomicops_internals_arm64_gcc.h:163
Atomic32 Acquire_CompareAndSwap(volatile Atomic32 *ptr, Atomic32 old_value, Atomic32 new_value)
Definition: atomicops_internals_arm64_gcc.h:127
void MemoryBarrier()
Definition: atomicops_internals_arm64_gcc.h:40