diff options
| author | vskipin <[email protected]> | 2022-02-10 16:46:00 +0300 |
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:00 +0300 |
| commit | 4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (patch) | |
| tree | a7a5543d815c451256ece74081d960b4e1d70ec2 /util/system/atomic_gcc.h | |
| parent | 5b00ed04a5137a452fa6d3423cb0c9b54ac27408 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/system/atomic_gcc.h')
| -rw-r--r-- | util/system/atomic_gcc.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/util/system/atomic_gcc.h b/util/system/atomic_gcc.h index ed8dc2bdc53..39d3987fdf4 100644 --- a/util/system/atomic_gcc.h +++ b/util/system/atomic_gcc.h @@ -5,32 +5,32 @@ : \ : "memory") -static inline TAtomicBase AtomicGet(const TAtomic& a) { - TAtomicBase tmp; +static inline TAtomicBase AtomicGet(const TAtomic& a) { + TAtomicBase tmp; #if defined(_arm64_) - __asm__ __volatile__( - "ldar %x[value], %[ptr] \n\t" - : [value] "=r"(tmp) - : [ptr] "Q"(a) - : "memory"); + __asm__ __volatile__( + "ldar %x[value], %[ptr] \n\t" + : [value] "=r"(tmp) + : [ptr] "Q"(a) + : "memory"); #else - __atomic_load(&a, &tmp, __ATOMIC_ACQUIRE); + __atomic_load(&a, &tmp, __ATOMIC_ACQUIRE); #endif - return tmp; -} - -static inline void AtomicSet(TAtomic& a, TAtomicBase v) { + return tmp; +} + +static inline void AtomicSet(TAtomic& a, TAtomicBase v) { #if defined(_arm64_) - __asm__ __volatile__( - "stlr %x[value], %[ptr] \n\t" - : [ptr] "=Q"(a) - : [value] "r"(v) - : "memory"); -#else - __atomic_store(&a, &v, __ATOMIC_RELEASE); -#endif + __asm__ __volatile__( + "stlr %x[value], %[ptr] \n\t" + : [ptr] "=Q"(a) + : [value] "r"(v) + : "memory"); +#else + __atomic_store(&a, &v, __ATOMIC_RELEASE); +#endif } - + static inline intptr_t AtomicIncrement(TAtomic& p) { return __atomic_add_fetch(&p, 1, __ATOMIC_SEQ_CST); } @@ -55,7 +55,7 @@ static inline intptr_t AtomicGetAndAdd(TAtomic& p, intptr_t v) { return __atomic_fetch_add(&p, v, __ATOMIC_SEQ_CST); } -static inline intptr_t AtomicSwap(TAtomic* p, intptr_t v) { +static inline intptr_t AtomicSwap(TAtomic* p, intptr_t v) { (void)p; // disable strange 'parameter set but not used' warning on gcc intptr_t ret; __atomic_exchange(p, &v, &ret, __ATOMIC_SEQ_CST); |
