[AArch64] Use atomic instructions for swap and fetch-update operations.
authorMatthew Wahab <matthew.wahab@arm.com>
Tue, 22 Sep 2015 09:19:55 +0000 (09:19 +0000)
committerMatthew Wahab <mwahab@gcc.gnu.org>
Tue, 22 Sep 2015 09:19:55 +0000 (09:19 +0000)
commit9cd7b72071d5b1101de6b726391e8ba71a61638f
tree86873c021fe60c2fffb4d16ae53a756647797d52
parent9915b1c916b1e6aa0fb7aa738dcc217f5f69b8ef
[AArch64] Use atomic instructions for swap and fetch-update operations.

gcc/
2015-09-22  Matthew Wahab  <matthew.wahab@arm.com>

* config/aarch64/aarch64-protos.h (aarch64_gen_atomic_ldop):
Declare.
* config/aarch64/aarch64.c (aarch64_emit_atomic_swap): New.
(aarch64_gen_atomic_ldop): New.
(aarch64_split_atomic_op): Fix whitespace and add a comment.
* config/aarch64/atomics.md (UNSPECV_ATOMIC_SWP): New.
(aarch64_compare_and_swap<mode>_lse): Fix some whitespace.
(atomic_exchange<mode>): Replace with an expander.
(aarch64_atomic_exchange<mode>): New.
(aarch64_atomic_exchange<mode>_lse): New.
(aarch64_atomic_<atomic_optab><mode>): Fix some whitespace.
(aarch64_atomic_swp<mode>): New.

gcc/testsuite/
2015-09-22  Matthew Wahab  <matthew.wahab@arm.com>

* gcc.target/aarch64/atomic-inst-ops.inc: (TEST_MODEL): New.
(TEST_ONE): New.
        * gcc.target/aarch64/atomic-inst-swap.c: New.

From-SVN: r227998
gcc/ChangeLog
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.c
gcc/config/aarch64/atomics.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/atomic-inst-ops.inc
gcc/testsuite/gcc.target/aarch64/atomic-inst-swp.c [new file with mode: 0644]