This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, MIPS] Add most common atomic patterns
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>, Tom de Vries <vries at codesourcery dot com>
- Cc: gcc-patches Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 20 Jun 2012 13:09:04 +1200
- Subject: Re: [PATCH, MIPS] Add most common atomic patterns
- References: <6BB30BFE-2322-45D3-A898-FBD3FEDE84D2@codesourcery.com>
I've now checked these patches.
Tom, thanks for great optimizing sync and atomic builtins for MIPS and XLP, and, Richard, thanks for the reviews and education on writing good .md descriptions.
--
Maxim Kuvyrkov
CodeSourcery / Mentor Graphics
On 13/06/2012, at 5:50 PM, Maxim Kuvyrkov wrote:
> This patch series adds necessary patterns for __atomic_compare_exchange[_n], __atomic_exchange[_n] and __atomic_fetch_add builtins. These are the builtins that correspond to inline assembly that MIPS GLIBC port is using.
>
> The patches were originally developed by Tom de Vries a while ago, and I've rewrote parts of them to be better suited for upstream.
>
> The second patch adds XLP-specific patterns to support its swap and ldadd instructions. Unfortunately, there seem to be a problem in reload that prevents reload from properly spilling address for these two patterns. I will work with reload experts on investigating and fixing this problem, but, meanwhile, the patch contains a workaround that avoids the problem.
>
> The third patch is a small optimization to alleviate __atomic_compare_exchange[_n] builtins being a use-one-for-all solutions. These builtins return both boolean "success" and "oldval" results. As most cases use only one of the results, this optimizations looks at REG_UNUSED notes to determine if instructions to set these results can be omitted.
>
> The patch series was tested by running GLIBC testsuite for n32, n64 and o32 ABIs on XLP and [in-progress] non-XLP MIPS boards with no regressions with a corresponding patch to MIPS GLIBC port to use the new atomic builtins.
>
> --
> Maxim Kuvyrkov
> CodeSourcery / Mentor Graphics
>
>
>