This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: [PATCH 1/3, MIPS] Rewrite MIPS' atomic.h to use __atomic_* builtins.
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: <libc-ports at sourceware dot org>, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Thu, 14 Jun 2012 17:59:51 +1200
- Subject: Re: [PATCH 1/3, MIPS] Rewrite MIPS' atomic.h to use __atomic_* builtins.
- References: <C14A8060-0B49-4D8C-B3A5-2F83A7CE6609@codesourcery.com>
On 14/06/2012, at 4:26 PM, Maxim Kuvyrkov wrote:
> This patch rewrites MIPS' atomic.h to use __atomic_* builtins instead of inline assembly. These builtins are available in recent version of GCC and correspond to C++11 memory model support, they also map very well to GLIBC's atomic_* macros.
>
> With the GCC patches posted here [*] applied, the compiler will generate same, or better, assembly code for the atomic macros. XLP processors in particular will see a significant boost as GCC will use XLP-specific SWAP and LDADD instructions for some of the macros instead of LL/SC sequences.
>
> This patch was tested on XLP with no regressions; testing on a non-XLP platform is in progress. Testing was done using GCC mainline with [*] patches applied. OK to apply once 2.16 branches?
>
[*] http://gcc.gnu.org/ml/gcc-patches/2012-06/msg00779.html
--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics