[Patch] 2/2 MIPS atomic memory operations.
David Daney
ddaney@avtrex.com
Mon Aug 20 17:06:00 GMT 2007
This patch adds atomic memory operation for MIPS. It depends on part 1
of the patch which is a change to the generic expanders.
In:
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg01128.html
Richard essentially pre-approved this, but I wanted to post it again
because of how it interacts with the changes I want to make to
expand_sync_operation() and expand_sync_fetch_operation().
Tested on mips64-linux.
OK to commit if the first part is approved?
gcc/
2007-08-20 David Daney <ddaney@avtrex.com>
* config/mips/mips.md (UNSPEC_COMPARE_AND_SWAP, UNSPEC_SYNC_OLD_OP,
UNSPEC_SYNC_NEW_OP, UNSPEC_SYNC_EXCHANGE): New define_constants.
(optab, insn): Add more attributes.
(fetchop_bit): New code macro.
(immediate_insn): New code macro attribute.
(sync): Change condition to ISA_HAS_SYNC.
(rdhwr): Change predicate for operand 0 to register_operand.
(memory_barrier): New expand.
(sync_compare_and_swap<mode>, sync_add<mode>, sync_sub<mode>,
sync_old_add<mode>, sync_old_sub<mode>, sync_new_add<mode>,
sync_new_sub<mode>, sync_<optab><mode>, sync_old_<optab><mode>,
sync_new_<optab><mode>, sync_nand<mode>, sync_old_nand<mode>,
sync_new_nand<mode>, sync_lock_test_and_set<mode>): New insns.
* config/mips/mips.h (ISA_HAS_SYNC, ISA_HAS_LL_SC): New ISA predicates.
(MIPS_COMPARE_AND_SWAP, MIPS_SYNC_OP, MIPS_SYNC_OLD_OP,
MIPS_SYNC_NEW_OP, MIPS_SYNC_NAND, MIPS_SYNC_OLD_NAND,
MIPS_SYNC_NEW_NAND, MIPS_SYNC_EXCHANGE): New Macros.
gcc/testsuite/
2007-08-20 David Daney <ddaney@avtrex.com>
* gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: New test.
* gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Ditto.
* gcc.target/mips/atomic-memory-1.c: Ditto.
* testsuite/gcc.target/mips/atomic-memory-2.c: Ditto.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips-atomic.diff
Type: text/x-patch
Size: 16900 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070820/ddade0c4/attachment.bin>
More information about the Gcc-patches
mailing list