This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, MIPS] Add most common atomic patterns


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]