mirror of git://gcc.gnu.org/git/gcc.git
re PR libstdc++/51798 (libstdc++ atomicity performance regression due to __sync_fetch_and_add)
PR libstdc++/51798 * config/cpu/generic/atomicity_builtins/atomicity.h (__exchange_and_add, __atomic_add): Use __atomic_fetch_add with __ATOMIC_ACQ_REL semantics instead of __sync_fetch_and_add. * include/ext/atomicity.h (__exchange_and_add, __atomic_add): Likewise. From-SVN: r183644
This commit is contained in:
parent
8c6cb782a3
commit
7dcbaaa984
|
|
@ -1,3 +1,12 @@
|
||||||
|
2012-01-27 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR libstdc++/51798
|
||||||
|
* config/cpu/generic/atomicity_builtins/atomicity.h
|
||||||
|
(__exchange_and_add, __atomic_add): Use __atomic_fetch_add
|
||||||
|
with __ATOMIC_ACQ_REL semantics instead of __sync_fetch_and_add.
|
||||||
|
* include/ext/atomicity.h (__exchange_and_add, __atomic_add):
|
||||||
|
Likewise.
|
||||||
|
|
||||||
2011-01-27 Rafael Avila de Espindola <rafael.espindola@gmail.com>
|
2011-01-27 Rafael Avila de Espindola <rafael.espindola@gmail.com>
|
||||||
|
|
||||||
* libsupc++/typeinfo: Correctly match #pragma GCC visibility
|
* libsupc++/typeinfo: Correctly match #pragma GCC visibility
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// Low-level functions for atomic operations: version for CPUs providing
|
// Low-level functions for atomic operations: version for CPUs providing
|
||||||
// atomic builtins -*- C++ -*-
|
// atomic builtins -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
|
// Copyright (C) 2006, 2009, 2010, 2012 Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
// software; you can redistribute it and/or modify it under the
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
|
@ -33,12 +33,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
_Atomic_word
|
_Atomic_word
|
||||||
__attribute__ ((__unused__))
|
__attribute__ ((__unused__))
|
||||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
|
__exchange_and_add(volatile _Atomic_word* __mem, int __val) throw ()
|
||||||
{ return __sync_fetch_and_add(__mem, __val); }
|
{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
|
||||||
|
|
||||||
void
|
void
|
||||||
__attribute__ ((__unused__))
|
__attribute__ ((__unused__))
|
||||||
__atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
|
__atomic_add(volatile _Atomic_word* __mem, int __val) throw ()
|
||||||
{ __sync_fetch_and_add(__mem, __val); }
|
{ __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
|
||||||
|
|
||||||
_GLIBCXX_END_NAMESPACE_VERSION
|
_GLIBCXX_END_NAMESPACE_VERSION
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// Support for atomic operations -*- C++ -*-
|
// Support for atomic operations -*- C++ -*-
|
||||||
|
|
||||||
// Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011
|
// Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011, 2012
|
||||||
// Free Software Foundation, Inc.
|
// Free Software Foundation, Inc.
|
||||||
//
|
//
|
||||||
// This file is part of the GNU ISO C++ Library. This library is free
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
|
@ -45,11 +45,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
|
||||||
#ifdef _GLIBCXX_ATOMIC_BUILTINS
|
#ifdef _GLIBCXX_ATOMIC_BUILTINS
|
||||||
static inline _Atomic_word
|
static inline _Atomic_word
|
||||||
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
__exchange_and_add(volatile _Atomic_word* __mem, int __val)
|
||||||
{ return __sync_fetch_and_add(__mem, __val); }
|
{ return __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
__atomic_add(volatile _Atomic_word* __mem, int __val)
|
||||||
{ __sync_fetch_and_add(__mem, __val); }
|
{ __atomic_fetch_add(__mem, __val, __ATOMIC_ACQ_REL); }
|
||||||
#else
|
#else
|
||||||
_Atomic_word
|
_Atomic_word
|
||||||
__attribute__ ((__unused__))
|
__attribute__ ((__unused__))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue