2012-06-19 Tom de Vries <vries@codesourcery.com>
authorTom de Vries <vries@codesourcery.com>
Wed, 20 Jun 2012 00:57:23 +0000 (00:57 +0000)
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>
Wed, 20 Jun 2012 00:57:23 +0000 (00:57 +0000)
commit01c196ea91cce2665bc7e8df7edfd7dca0352d86
treecc80416977299664a93d282bbcace60a7d765062
parente98f6824d6ce199d5a3a2d27800ac523d5135cea
2012-06-19  Tom de Vries  <vries@codesourcery.com>
    Maxim Kuvyrkov  <maxim@codesourcery.com>

* config/mips/mips.c (mips_emit_pre_atomic_barrier_p,)
(mips_emit_post_atomic_barrier_p): New static functions.
(mips_process_sync_loop): Use them.  Emit sync memory barriers in
accordance with memory model semantics.  Add return of CMP result for
compare_and_swap.
* config/mips/mips.md: Update comment.
(sync_cmp): New attribute.
(sync_memmodel): New attribute replacing sync_release_barrier.
* config/mips/sync.md (UNSPEC_ATOMIC_COMPARE_AND_SWAP,)
(UNSPEC_ATOMIC_EXCHANGE, UNSPEC_ATOMIC_FETCH_OP): New constants.
(sync_lock_test_and_set, test_and_set_12): Update.
(atomic_compare_and_swap, atomic_exchange, atomic_exchange_llsc,)
(atomic_fetch_add, atomic_fetch_add_llsc): New patterns.

Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com>
From-SVN: r188803
gcc/ChangeLog
gcc/config/mips/mips.c
gcc/config/mips/mips.md
gcc/config/mips/sync.md