33 #ifndef GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_GCC_H_
34 #define GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_GCC_H_
51 #define ATOMICOPS_COMPILER_BARRIER() __asm__ __volatile__("" : : : "memory")
59 __asm__ __volatile__(
"lock; cmpxchgl %1,%2"
61 :
"q" (new_value),
"m" (*ptr),
"0" (old_value)
68 __asm__ __volatile__(
"xchgl %1,%0"
70 :
"m" (*ptr),
"0" (new_value)
78 __asm__ __volatile__(
"lock; xaddl %0,%1"
79 :
"+r" (temp),
"+m" (*ptr)
82 return temp + increment;
88 __asm__ __volatile__(
"lock; xaddl %0,%1"
89 :
"+r" (temp),
"+m" (*ptr)
93 __asm__ __volatile__(
"lfence" : : :
"memory");
95 return temp + increment;
103 __asm__ __volatile__(
"lfence" : : :
"memory");
118 #if defined(__x86_64__)
123 __asm__ __volatile__(
"mfence" : : :
"memory");
135 __asm__ __volatile__(
"mfence" : : :
"memory");
145 __asm__ __volatile__(
"mfence" : : :
"memory");
175 #if defined(__x86_64__)
181 Atomic64 new_value) {
183 __asm__ __volatile__(
"lock; cmpxchgq %1,%2"
185 :
"q" (new_value),
"m" (*ptr),
"0" (old_value)
191 Atomic64 new_value) {
192 __asm__ __volatile__(
"xchgq %1,%0"
194 :
"m" (*ptr),
"0" (new_value)
200 Atomic64 increment) {
201 Atomic64 temp = increment;
202 __asm__ __volatile__(
"lock; xaddq %0,%1"
203 :
"+r" (temp),
"+m" (*ptr)
206 return temp + increment;
210 Atomic64 increment) {
211 Atomic64 temp = increment;
212 __asm__ __volatile__(
"lock; xaddq %0,%1"
213 :
"+r" (temp),
"+m" (*ptr)
217 __asm__ __volatile__(
"lfence" : : :
"memory");
219 return temp + increment;
226 inline void Acquire_Store(
volatile Atomic64* ptr, Atomic64 value) {
231 inline void Release_Store(
volatile Atomic64* ptr, Atomic64 value) {
256 inline Atomic64
Acquire_Load(
volatile const Atomic64* ptr) {
257 Atomic64 value = *ptr;
264 inline Atomic64
Release_Load(
volatile const Atomic64* ptr) {
271 Atomic64 new_value) {
274 __asm__ __volatile__(
"lfence" : : :
"memory");
281 Atomic64 new_value) {
285 #endif // defined(__x86_64__)
291 #undef ATOMICOPS_COMPILER_BARRIER
293 #endif // GOOGLE_PROTOBUF_ATOMICOPS_INTERNALS_X86_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
Definition: atomicops_internals_x86_gcc.h:44
#define ATOMICOPS_COMPILER_BARRIER()
Definition: atomicops_internals_x86_gcc.h:51
bool has_amd_lock_mb_bug
Definition: atomicops_internals_x86_gcc.h:45
void Release_Store(volatile Atomic32 *ptr, Atomic32 value)
Definition: atomicops_internals_arm64_gcc.h:154
bool has_sse2
Definition: atomicops_internals_x86_gcc.h:47
struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures
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
const FieldDescriptor value
Definition: descriptor.h:1522
G3D::int16 x
Definition: Vector2int16.h:37
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