diff options
Diffstat (limited to 'libstdc++-v3/config')
-rw-r--r-- | libstdc++-v3/config/cpu/s390/atomicity.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/libstdc++-v3/config/cpu/s390/atomicity.h b/libstdc++-v3/config/cpu/s390/atomicity.h index cf903b321f4..5a235940c8c 100644 --- a/libstdc++-v3/config/cpu/s390/atomicity.h +++ b/libstdc++-v3/config/cpu/s390/atomicity.h @@ -34,22 +34,10 @@ namespace __gnu_cxx _Atomic_word __attribute__ ((__unused__)) __exchange_and_add(volatile _Atomic_word* __mem, int __val) - { - register _Atomic_word __old_val, __new_val; - - __asm__ __volatile__ (" l %0,0(%3)\n" - "0: lr %1,%0\n" - " ar %1,%4\n" - " cs %0,%1,0(%3)\n" - " jl 0b" - : "=&d" (__old_val), "=&d" (__new_val), "=m" (*__mem) - : "a" (__mem), "d" (__val), "m" (*__mem) - : "cc", "memory"); - return __old_val; - } + { return __sync_fetch_and_add(__mem, __val); } void __attribute__ ((__unused__)) __atomic_add(volatile _Atomic_word* __mem, int __val) - { __exchange_and_add(__mem, __val); } + { __sync_fetch_and_add(__mem, __val); } } // namespace __gnu_cxx |