A few places in the arm and aarch64 backends check whether an atomic operation needs...
authorMatthew Malcomson <matthew.malcomson@arm.com>
Wed, 26 Sep 2018 09:13:18 +0000 (09:13 +0000)
committerMatthew Malcomson <matmal01@gcc.gnu.org>
Wed, 26 Sep 2018 09:13:18 +0000 (09:13 +0000)
commit5e14418b07376add230c52ac4c53efd65fd3b8c9
tree5aee864fecc30e58c335c1ed93ad335c982d8301
parent539866048e546c696afbb49d4366fe6477f50130
A few places in the arm and aarch64 backends check whether an atomic operation needs acquire or release semantics.

A few places in the arm and aarch64 backends check whether an atomic
operation needs acquire or release semantics.
This is generally done with a check like

(is_mm_relaxed (model)
  || is_mm_consume (model)
  || is_mm_release (model))

In this patch we introduce two helper functions to make things a little
tidier.

There are a few places in the arm/ backend that check whether an
operation needs memory model semantics with an idiom that can now be
replaced with the new aarch_mm_needs_* functions, so we make that
replacement.

There is also some backslash removal to make things a little tidier.

Full bootstrap and regression test plus cross-compilation regression tests done
on arm-none-linux-gnueabihf.
Ok for trunk?

gcc/ChangeLog:

2018-09-20  Matthew Malcomson  <matthew.malcomson@arm.com>

* config/arm/arm.c (arm_split_compare_and_swap, arm_split_atomic_op):
Use new helper functions.
* config/arm/sync.md (atomic_load<mode>, atomic_store<mode>):
Use new helper functions.
* config/arm/aarch-common-protos.h (aarch_mm_needs_acquire,
aarch_mm_needs_release): New declarations.
* config/arm/aarch-common.c (aarch_mm_needs_acquire,
aarch_mm_needs_release): New.

From-SVN: r264598
gcc/ChangeLog
gcc/config/arm/aarch-common-protos.h
gcc/config/arm/aarch-common.c
gcc/config/arm/arm.c
gcc/config/arm/sync.md