summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/config
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-07 16:35:27 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-07 16:35:27 +0000
commit891e309693dbbf1ddddcf11d50f9bfbc0b3350ce (patch)
treebb3a25e110cedc41afc38795fab064c14523fc41 /libstdc++-v3/config
parent3e790786cfb2c88061ebc1faad8273489bf3c388 (diff)
downloadppe42-gcc-891e309693dbbf1ddddcf11d50f9bfbc0b3350ce.tar.gz
ppe42-gcc-891e309693dbbf1ddddcf11d50f9bfbc0b3350ce.zip
2005-06-07 Adrian Straetling <straetling@de.ibm.com>
gcc/ChangeLog: * config/s390/s390.md: ("UNSPECV_MB", "UNSPECV_CAS"): New constants. ("type"): Add "sem" to 'type' attribute. ("memory_barrier", "*memory_barrier", "sync_compare_and_swapdi", "sync_compare_and_swapsi", "sync_compare_and_swap_ccdi", "sync_compare_and_swap_ccsi", "*sync_compare_and_swap_ccdi", "*sync_compare_and_swap_ccsi"): New patterns. * config/s390/2064.md: ("z_sem"): New insn_reservation. * config/s390/2084.md: ("x_sem"): New insn_reservation. * config/s390/s390.c: (s390_compare_emitted): New global variable. (s390_emit_compare): Do not emit comparison again after cas. * config/s390/s390.h (s390_compare_emitted): Declare. libstdc++/ChangeLog: * config/cpu/s390/atomicity.h: (__exchange_and_add, __atomic_add): Use the builtins for atomic memory operations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100711 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/config')
-rw-r--r--libstdc++-v3/config/cpu/s390/atomicity.h16
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
OpenPOWER on IntegriCloud