Lines Matching refs:field
29 static int64_t __inline hdr_atomic_load_64(int64_t* field)
32 return *field;
35 static void __inline hdr_atomic_store_64(int64_t* field, int64_t value)
38 *field = value;
41 static int64_t __inline hdr_atomic_exchange_64(volatile int64_t* field, int64_t value)
44 return _InterlockedExchange64(field, value);
47 int64_t initial_value = *field;
51 initial_value = _InterlockedCompareExchange64(field, value, comparand);
59 static int64_t __inline hdr_atomic_add_fetch_64(volatile int64_t* field, int64_t value)
62 return _InterlockedExchangeAdd64(field, value) + value;
65 int64_t initial_value = *field;
69 initial_value = _InterlockedCompareExchange64(field, comparand + value, comparand);
77 static bool __inline hdr_atomic_compare_exchange_64(volatile int64_t* field, int64_t* expected, int64_t desired)
79 return *expected == _InterlockedCompareExchange64(field, desired, *expected);
89 #define hdr_atomic_add_fetch_64(field, value) __atomic_add_fetch(field, value, __ATOMIC_SEQ_CST)
90 #define hdr_atomic_compare_exchange_64(field, expected, desired) __atomic_compare_exchange_n(field, expected, desired, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
109 static inline int64_t hdr_atomic_load_64(int64_t* field)
111 int64_t i = *field;
116 static inline void hdr_atomic_store_64(int64_t* field, int64_t value)
118 asm volatile ("lock; xchgq %0, %1" : "+q" (value), "+m" (*field));
121 static inline int64_t hdr_atomic_exchange_64(volatile int64_t* field, int64_t value)
124 asm volatile ("lock; xchgq %1, %2" : "=r" (result), "+q" (value), "+m" (*field));
128 static inline int64_t hdr_atomic_add_fetch_64(volatile int64_t* field, int64_t value)
130 return __sync_add_and_fetch(field, value);
133 static inline bool hdr_atomic_compare_exchange_64(volatile int64_t* field, int64_t* expected, int64_t desired)
136 asm volatile( "lock; cmpxchgq %2, %1" : "=a"(original), "+m"(*field) : "q"(desired), "0"(*expected));