* [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins.
@ 2015-07-02 13:12 Matthew Wahab
2015-07-02 13:15 ` [PATCH 2/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync,compare-and-swap builtins Matthew Wahab
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Matthew Wahab @ 2015-07-02 13:12 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 850 bytes --]
The __sync builtins are implemented using barriers that are too weak for ARMv8
targets, this has been fixed on trunk for the ARM back-end. Since GCC-5.1 is
also generating the incorrect code, it should also be fixed.
This patch backports the changes made to strengthen the barriers emitted for
the __sync fetch-and-op/op-and-fetch builtins.
The trunk patch submission is at
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01410.html
The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-06/msg01235.html
Tested the series for arm-none-linux-gnueabihf with check-gcc
Ok for the branch?
Matthew
2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
Backport from trunk:
2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
PR target/65697
* config/armc/arm.c (arm_split_atomic_op): For ARMv8, replace an
initial acquire barrier with final barrier.
[-- Attachment #2: 0001-2015-07-01-Matthew-Wahab-matthew.wahab-arm.com.patch --]
[-- Type: text/x-patch, Size: 2082 bytes --]
From e7150c85313fff08153197493db568ca8fe2778a Mon Sep 17 00:00:00 2001
From: mwahab <mwahab@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 29 Jun 2015 16:03:34 +0000
Subject: [PATCH 1/4] 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
Backport
PR target/65697
* config/armc/arm.c (arm_split_atomic_op): For ARMv8, replace an
initial acquire barrier with final barrier.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225132 138bc75d-0d04-0410-961f-82ee72b054a4
Conflicts:
gcc/ChangeLog
Change-Id: I2074541794ecad8847ada04690cd9132a51b6404
---
gcc/config/arm/arm.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 7b279c7..b36dfb0 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -27807,6 +27807,8 @@ arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
rtx_code_label *label;
rtx x;
+ bool is_armv8_sync = arm_arch8 && is_mm_sync (model);
+
bool use_acquire = TARGET_HAVE_LDACQ
&& !(is_mm_relaxed (model) || is_mm_consume (model)
|| is_mm_release (model));
@@ -27815,6 +27817,11 @@ arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
&& !(is_mm_relaxed (model) || is_mm_consume (model)
|| is_mm_acquire (model));
+ /* For ARMv8, a load-acquire is too weak for __sync memory orders. Instead,
+ a full barrier is emitted after the store-release. */
+ if (is_armv8_sync)
+ use_acquire = false;
+
/* Checks whether a barrier is needed and emits one accordingly. */
if (!(use_acquire || use_release))
arm_pre_atomic_barrier (model);
@@ -27885,7 +27892,8 @@ arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
emit_unlikely_jump (gen_cbranchsi4 (x, cond, const0_rtx, label));
/* Checks whether a barrier is needed and emits one accordingly. */
- if (!(use_acquire || use_release))
+ if (is_armv8_sync
+ || !(use_acquire || use_release))
arm_post_atomic_barrier (model);
}
\f
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync,compare-and-swap builtins.
2015-07-02 13:12 [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins Matthew Wahab
@ 2015-07-02 13:15 ` Matthew Wahab
2015-07-27 10:32 ` Matthew Wahab
2015-07-02 13:17 ` [PATCH 3/4][ARM][PR target/65697][5.1] Add tests for __sync_builtins Matthew Wahab
` (2 subsequent siblings)
3 siblings, 1 reply; 12+ messages in thread
From: Matthew Wahab @ 2015-07-02 13:15 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 631 bytes --]
This patch backports the changes made to strengthen the barriers emitted for
the __sync compare-and-swap builtins.
The trunk patch submission is at
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01411.html
The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-06/msg01236.html
Tested the series for arm-none-linux-gnueabihf with check-gcc
Ok for the branch?
Matthew
2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
Backport from trunk:
2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
PR target/65697
* config/armc/arm.c (arm_split_compare_and_swap): For ARMv8,
replace an initial acquire barrier with final barrier.
[-- Attachment #2: 0002-2015-07-01-Matthew-Wahab-matthew.wahab-arm.com.patch --]
[-- Type: text/x-patch, Size: 1987 bytes --]
From fce96ded43d39847473b67e54e3146924c703f40 Mon Sep 17 00:00:00 2001
From: mwahab <mwahab@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 29 Jun 2015 16:09:10 +0000
Subject: [PATCH 2/4] 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
Backport
PR target/65697
* config/armc/arm.c (arm_split_compare_and_swap): For ARMv8, replace an
initial acquire barrier with final barrier.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225133 138bc75d-0d04-0410-961f-82ee72b054a4
Conflicts:
gcc/ChangeLog
Change-Id: Ifab505d792d6227c7d2231813dfb2e7826f0f450
---
gcc/config/arm/arm.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index b36dfb0..49005fb 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -27742,6 +27742,8 @@ arm_split_compare_and_swap (rtx operands[])
scratch = operands[7];
mode = GET_MODE (mem);
+ bool is_armv8_sync = arm_arch8 && is_mm_sync (mod_s);
+
bool use_acquire = TARGET_HAVE_LDACQ
&& !(is_mm_relaxed (mod_s) || is_mm_consume (mod_s)
|| is_mm_release (mod_s));
@@ -27750,6 +27752,11 @@ arm_split_compare_and_swap (rtx operands[])
&& !(is_mm_relaxed (mod_s) || is_mm_consume (mod_s)
|| is_mm_acquire (mod_s));
+ /* For ARMv8, the load-acquire is too weak for __sync memory orders. Instead,
+ a full barrier is emitted after the store-release. */
+ if (is_armv8_sync)
+ use_acquire = false;
+
/* Checks whether a barrier is needed and emits one accordingly. */
if (!(use_acquire || use_release))
arm_pre_atomic_barrier (mod_s);
@@ -27790,7 +27797,8 @@ arm_split_compare_and_swap (rtx operands[])
emit_label (label2);
/* Checks whether a barrier is needed and emits one accordingly. */
- if (!(use_acquire || use_release))
+ if (is_armv8_sync
+ || !(use_acquire || use_release))
arm_post_atomic_barrier (mod_s);
if (is_mm_relaxed (mod_f))
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync,compare-and-swap builtins.
2015-07-02 13:15 ` [PATCH 2/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync,compare-and-swap builtins Matthew Wahab
@ 2015-07-27 10:32 ` Matthew Wahab
2015-07-31 9:41 ` Ramana Radhakrishnan
0 siblings, 1 reply; 12+ messages in thread
From: Matthew Wahab @ 2015-07-27 10:32 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 895 bytes --]
Ping. Updated patch attached.
Also, retested for arm-none-linux-gnueabihf with native bootstrap and make
check and for arm-none-eabi with cross compiled make check.
On 02/07/15 14:15, Matthew Wahab wrote:
> This patch backports the changes made to strengthen the barriers emitted for
> the __sync compare-and-swap builtins.
>
> The trunk patch submission is at
> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01411.html
> The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-06/msg01236.html
>
> Tested the series for arm-none-linux-gnueabihf with check-gcc
>
> Ok for the branch?
> Matthew
>
> 2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
>
> Backport from trunk:
> 2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
>
> PR target/65697
> * config/armc/arm.c (arm_split_compare_and_swap): For ARMv8,
> replace an initial acquire barrier with final barrier.
>
[-- Attachment #2: 0002-2015-07-01-Matthew-Wahab-matthew.wahab-arm.com.patch --]
[-- Type: text/x-patch, Size: 1987 bytes --]
From fdcde1aa0b852f2a01bb45115e28f694b0225fcf Mon Sep 17 00:00:00 2001
From: mwahab <mwahab@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 29 Jun 2015 16:09:10 +0000
Subject: [PATCH 2/4] 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
Backport
PR target/65697
* config/armc/arm.c (arm_split_compare_and_swap): For ARMv8, replace an
initial acquire barrier with final barrier.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225133 138bc75d-0d04-0410-961f-82ee72b054a4
Conflicts:
gcc/ChangeLog
Change-Id: Ifab505d792d6227c7d2231813dfb2e7826f0f450
---
gcc/config/arm/arm.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index f694e74..1e67a73 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -27757,6 +27757,8 @@ arm_split_compare_and_swap (rtx operands[])
scratch = operands[7];
mode = GET_MODE (mem);
+ bool is_armv8_sync = arm_arch8 && is_mm_sync (mod_s);
+
bool use_acquire = TARGET_HAVE_LDACQ
&& !(is_mm_relaxed (mod_s) || is_mm_consume (mod_s)
|| is_mm_release (mod_s));
@@ -27765,6 +27767,11 @@ arm_split_compare_and_swap (rtx operands[])
&& !(is_mm_relaxed (mod_s) || is_mm_consume (mod_s)
|| is_mm_acquire (mod_s));
+ /* For ARMv8, the load-acquire is too weak for __sync memory orders. Instead,
+ a full barrier is emitted after the store-release. */
+ if (is_armv8_sync)
+ use_acquire = false;
+
/* Checks whether a barrier is needed and emits one accordingly. */
if (!(use_acquire || use_release))
arm_pre_atomic_barrier (mod_s);
@@ -27805,7 +27812,8 @@ arm_split_compare_and_swap (rtx operands[])
emit_label (label2);
/* Checks whether a barrier is needed and emits one accordingly. */
- if (!(use_acquire || use_release))
+ if (is_armv8_sync
+ || !(use_acquire || use_release))
arm_post_atomic_barrier (mod_s);
if (is_mm_relaxed (mod_f))
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync,compare-and-swap builtins.
2015-07-27 10:32 ` Matthew Wahab
@ 2015-07-31 9:41 ` Ramana Radhakrishnan
0 siblings, 0 replies; 12+ messages in thread
From: Ramana Radhakrishnan @ 2015-07-31 9:41 UTC (permalink / raw)
To: Matthew Wahab, gcc-patches
On 27/07/15 11:31, Matthew Wahab wrote:
> Ping. Updated patch attached.
>
> Also, retested for arm-none-linux-gnueabihf with native bootstrap and make
> check and for arm-none-eabi with cross compiled make check.
>
>
> On 02/07/15 14:15, Matthew Wahab wrote:
>> This patch backports the changes made to strengthen the barriers emitted for
>> the __sync compare-and-swap builtins.
>>
>> The trunk patch submission is at
>> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01411.html
>> The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-06/msg01236.html
>>
>> Tested the series for arm-none-linux-gnueabihf with check-gcc
>>
>> Ok for the branch?
>> Matthew
>>
>> 2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
>>
>> Backport from trunk:
>> 2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
>>
>> PR target/65697
>> * config/armc/arm.c (arm_split_compare_and_swap): For ARMv8,
>> replace an initial acquire barrier with final barrier.
>>
>
OK - minor changelog nit in this and the previous patch.
s/armc/arm
Ramana
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/4][ARM][PR target/65697][5.1] Add tests for __sync_builtins.
2015-07-02 13:12 [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins Matthew Wahab
2015-07-02 13:15 ` [PATCH 2/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync,compare-and-swap builtins Matthew Wahab
@ 2015-07-02 13:17 ` Matthew Wahab
2015-07-27 10:32 ` Matthew Wahab
2015-07-02 13:18 ` [PATCH 4/4][ARM][PR target/65697][5.1] Fix " Matthew Wahab
2015-07-27 10:31 ` [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins Matthew Wahab
3 siblings, 1 reply; 12+ messages in thread
From: Matthew Wahab @ 2015-07-02 13:17 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 697 bytes --]
This patch backports the tests added for code generated by the ARM back-end for
the __sync builtins.
The trunk patch submission is at
https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01412.html
The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-06/msg01237.html
Tested the series for arm-none-linux-gnueabihf with check-gcc
Ok for the branch?
Matthew
gcc/testsuite
2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
Backport from trunk:
2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
PR target/65697
* gcc.target/arm/armv-sync-comp-swap.c: New.
* gcc.target/arm/armv-sync-op-acquire.c: New.
* gcc.target/arm/armv-sync-op-full.c: New.
* gcc.target/arm/armv-sync-op-release.c: New.
[-- Attachment #2: 0003-2015-07-01-Matthew-Wahab-matthew.wahab-arm.com.patch --]
[-- Type: text/x-patch, Size: 3559 bytes --]
From 27eb0d570c831be52f4d544bf40abe8a6a4246c3 Mon Sep 17 00:00:00 2001
From: mwahab <mwahab@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 29 Jun 2015 16:12:12 +0000
Subject: [PATCH 3/4] 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
Backport
PR target/65697
* gcc.target/arm/armv-sync-comp-swap.c: New.
* gcc.target/arm/armv-sync-op-acquire.c: New.
* gcc.target/arm/armv-sync-op-full.c: New.
* gcc.target/arm/armv-sync-op-release.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225134 138bc75d-0d04-0410-961f-82ee72b054a4
Conflicts:
gcc/ChangeLog
Change-Id: I16c02786765bbbfbb287fba863ba27fb6a56ddc5
---
gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c | 10 ++++++++++
gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c | 10 ++++++++++
gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c | 10 ++++++++++
gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c | 8 ++++++++
4 files changed, 38 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
create mode 100644 gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
create mode 100644 gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
create mode 100644 gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c b/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
new file mode 100644
index 0000000..f96c81a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "../aarch64/sync-comp-swap.x"
+
+/* { dg-final { scan-assembler-times "ldrex" 2 } } */
+/* { dg-final { scan-assembler-times "stlex" 2 } } */
+/* { dg-final { scan-assembler-times "dmb" 2 } } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
new file mode 100644
index 0000000..8d6659b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "../aarch64/sync-op-acquire.x"
+
+/* { dg-final { scan-assembler-times "ldrex" 1 } } */
+/* { dg-final { scan-assembler-times "stlex" 1 } } */
+/* { dg-final { scan-assembler-times "dmb" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
new file mode 100644
index 0000000..a5ad3bd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "../aarch64/sync-op-full.x"
+
+/* { dg-final { scan-assembler-times "ldrex" 12 } } */
+/* { dg-final { scan-assembler-times "stlex" 12 } } */
+/* { dg-final { scan-assembler-times "dmb" 12 } } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
new file mode 100644
index 0000000..0d3be7b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "../aarch64/sync-op-release.x"
+
+/* { dg-final { scan-assembler-times "stl" 1 } } */
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4][ARM][PR target/65697][5.1] Add tests for __sync_builtins.
2015-07-02 13:17 ` [PATCH 3/4][ARM][PR target/65697][5.1] Add tests for __sync_builtins Matthew Wahab
@ 2015-07-27 10:32 ` Matthew Wahab
2015-07-31 9:41 ` Ramana Radhakrishnan
0 siblings, 1 reply; 12+ messages in thread
From: Matthew Wahab @ 2015-07-27 10:32 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 974 bytes --]
Ping. Updated patch attached.
Also, retested for arm-none-linux-gnueabihf with native bootstrap and make
check and for arm-none-eabi with cross compiled make check.
On 02/07/15 14:17, Matthew Wahab wrote:
> This patch backports the tests added for code generated by the ARM back-end for
> the __sync builtins.
>
> The trunk patch submission is at
> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01412.html
> The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-06/msg01237.html
>
> Tested the series for arm-none-linux-gnueabihf with check-gcc
>
> Ok for the branch?
> Matthew
>
> gcc/testsuite
> 2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
>
> Backport from trunk:
> 2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
>
> PR target/65697
> * gcc.target/arm/armv-sync-comp-swap.c: New.
> * gcc.target/arm/armv-sync-op-acquire.c: New.
> * gcc.target/arm/armv-sync-op-full.c: New.
> * gcc.target/arm/armv-sync-op-release.c: New.
>
[-- Attachment #2: 0003-2015-07-01-Matthew-Wahab-matthew.wahab-arm.com.patch --]
[-- Type: text/x-patch, Size: 3559 bytes --]
From d1a53325eb47a5da55a8267deb5fbe168f7db4de Mon Sep 17 00:00:00 2001
From: mwahab <mwahab@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 29 Jun 2015 16:12:12 +0000
Subject: [PATCH 3/4] 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
Backport
PR target/65697
* gcc.target/arm/armv-sync-comp-swap.c: New.
* gcc.target/arm/armv-sync-op-acquire.c: New.
* gcc.target/arm/armv-sync-op-full.c: New.
* gcc.target/arm/armv-sync-op-release.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225134 138bc75d-0d04-0410-961f-82ee72b054a4
Conflicts:
gcc/ChangeLog
Change-Id: I16c02786765bbbfbb287fba863ba27fb6a56ddc5
---
gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c | 10 ++++++++++
gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c | 10 ++++++++++
gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c | 10 ++++++++++
gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c | 8 ++++++++
4 files changed, 38 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
create mode 100644 gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
create mode 100644 gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
create mode 100644 gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c b/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
new file mode 100644
index 0000000..f96c81a
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "../aarch64/sync-comp-swap.x"
+
+/* { dg-final { scan-assembler-times "ldrex" 2 } } */
+/* { dg-final { scan-assembler-times "stlex" 2 } } */
+/* { dg-final { scan-assembler-times "dmb" 2 } } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
new file mode 100644
index 0000000..8d6659b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "../aarch64/sync-op-acquire.x"
+
+/* { dg-final { scan-assembler-times "ldrex" 1 } } */
+/* { dg-final { scan-assembler-times "stlex" 1 } } */
+/* { dg-final { scan-assembler-times "dmb" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
new file mode 100644
index 0000000..a5ad3bd
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "../aarch64/sync-op-full.x"
+
+/* { dg-final { scan-assembler-times "ldrex" 12 } } */
+/* { dg-final { scan-assembler-times "stlex" 12 } } */
+/* { dg-final { scan-assembler-times "dmb" 12 } } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
new file mode 100644
index 0000000..0d3be7b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-options "-O2" } */
+/* { dg-add-options arm_arch_v8a } */
+
+#include "../aarch64/sync-op-release.x"
+
+/* { dg-final { scan-assembler-times "stl" 1 } } */
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 3/4][ARM][PR target/65697][5.1] Add tests for __sync_builtins.
2015-07-27 10:32 ` Matthew Wahab
@ 2015-07-31 9:41 ` Ramana Radhakrishnan
0 siblings, 0 replies; 12+ messages in thread
From: Ramana Radhakrishnan @ 2015-07-31 9:41 UTC (permalink / raw)
To: gcc-patches
On 27/07/15 11:31, Matthew Wahab wrote:
> Ping. Updated patch attached.
>
> Also, retested for arm-none-linux-gnueabihf with native bootstrap and make
> check and for arm-none-eabi with cross compiled make check.
>
> On 02/07/15 14:17, Matthew Wahab wrote:
>> This patch backports the tests added for code generated by the ARM back-end for
>> the __sync builtins.
>>
>> The trunk patch submission is at
>> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01412.html
>> The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-06/msg01237.html
>>
>> Tested the series for arm-none-linux-gnueabihf with check-gcc
>>
>> Ok for the branch?
>> Matthew
>>
>> gcc/testsuite
>> 2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
>>
>> Backport from trunk:
>> 2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
>>
>> PR target/65697
>> * gcc.target/arm/armv-sync-comp-swap.c: New.
>> * gcc.target/arm/armv-sync-op-acquire.c: New.
>> * gcc.target/arm/armv-sync-op-full.c: New.
>> * gcc.target/arm/armv-sync-op-release.c: New.
>>
>
OK
Ramana
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/4][ARM][PR target/65697][5.1] Fix tests for __sync_builtins.
2015-07-02 13:12 [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins Matthew Wahab
2015-07-02 13:15 ` [PATCH 2/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync,compare-and-swap builtins Matthew Wahab
2015-07-02 13:17 ` [PATCH 3/4][ARM][PR target/65697][5.1] Add tests for __sync_builtins Matthew Wahab
@ 2015-07-02 13:18 ` Matthew Wahab
2015-07-27 10:43 ` Matthew Wahab
2015-07-27 10:31 ` [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins Matthew Wahab
3 siblings, 1 reply; 12+ messages in thread
From: Matthew Wahab @ 2015-07-02 13:18 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 786 bytes --]
This patch backports fixes for the __sync builtin tests.
The trunk patch submission is at
https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00031.html
The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-07/msg00025.html
Tested the series for arm-none-linux-gnueabihf with check-gcc
Ok for the branch?
Matthew
gcc/testsuite
2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
Backport from trunk:
2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
* gcc.target/arm/armv8-sync-comp-swap.c: Replace
'do-require-effective-target' with 'dg-require-effective-target'.
* gcc.target/arm/armv8-sync-op-full.c: Likewise.
* gcc.target/arm/armv8-sync-op-release.c: Likewise.
* gcc.target/arm/armv8-sync-op-acquire.c: Likewise. Also, replace
'stlex' with 'strex' as the expected output.
[-- Attachment #2: 0004-2015-07-01-Matthew-Wahab-matthew.wahab-arm.com.patch --]
[-- Type: text/x-patch, Size: 3290 bytes --]
From 3e48ba2ea1848ca9d17d627ebbdc9c6fb2e8c21b Mon Sep 17 00:00:00 2001
From: mwahab <mwahab@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 1 Jul 2015 12:16:01 +0000
Subject: [PATCH 4/4] 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
Backport
* gcc.target/arm/armv8-sync-comp-swap.c: Replace
'do-require-effective-target' with 'dg-require-effective-target'.
* gcc.target/arm/armv8-sync-op-full.c: Likewise.
* gcc.target/arm/armv8-sync-op-release.c: Likewise.
* gcc.target/arm/armv8-sync-op-acquire.c: Likewise. Also, replace
'stlex' with 'strex' as the expected output.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225241 138bc75d-0d04-0410-961f-82ee72b054a4
Conflicts:
gcc/testsuite/ChangeLog
Change-Id: I19f2013f7bdd2dd035f36f0f7c9829cf6a86fb8e
---
gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c | 2 +-
gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c | 4 ++--
gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c | 2 +-
gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c b/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
index f96c81a..0e95986 100644
--- a/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v8a } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
index 8d6659b..c448599 100644
--- a/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
@@ -1,10 +1,10 @@
/* { dg-do compile } */
-/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v8a } */
#include "../aarch64/sync-op-acquire.x"
/* { dg-final { scan-assembler-times "ldrex" 1 } } */
-/* { dg-final { scan-assembler-times "stlex" 1 } } */
+/* { dg-final { scan-assembler-times "strex" 1 } } */
/* { dg-final { scan-assembler-times "dmb" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
index a5ad3bd..cce9e00 100644
--- a/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v8a } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
index 0d3be7b..502a266 100644
--- a/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v8a } */
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/4][ARM][PR target/65697][5.1] Fix tests for __sync_builtins.
2015-07-02 13:18 ` [PATCH 4/4][ARM][PR target/65697][5.1] Fix " Matthew Wahab
@ 2015-07-27 10:43 ` Matthew Wahab
2015-07-31 9:49 ` Ramana Radhakrishnan
0 siblings, 1 reply; 12+ messages in thread
From: Matthew Wahab @ 2015-07-27 10:43 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]
Ping. Updated patch attached.
Also, retested for arm-none-linux-gnueabihf with native bootstrap and make
check and for arm-none-eabi with cross compiled make check.
On 02/07/15 14:18, Matthew Wahab wrote:
> This patch backports fixes for the __sync builtin tests.
>
> The trunk patch submission is at
> https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00031.html
> The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-07/msg00025.html
>
> Tested the series for arm-none-linux-gnueabihf with check-gcc
>
> Ok for the branch?
> Matthew
>
> gcc/testsuite
> 2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
>
> Backport from trunk:
> 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
>
> * gcc.target/arm/armv8-sync-comp-swap.c: Replace
> 'do-require-effective-target' with 'dg-require-effective-target'.
> * gcc.target/arm/armv8-sync-op-full.c: Likewise.
> * gcc.target/arm/armv8-sync-op-release.c: Likewise.
> * gcc.target/arm/armv8-sync-op-acquire.c: Likewise. Also, replace
> 'stlex' with 'strex' as the expected output.
>
[-- Attachment #2: 0004-2015-07-01-Matthew-Wahab-matthew.wahab-arm.com.patch --]
[-- Type: text/x-patch, Size: 3290 bytes --]
From d058686fe1027927a5fdfbb81a83526e3f9b9d6d Mon Sep 17 00:00:00 2001
From: mwahab <mwahab@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Wed, 1 Jul 2015 12:16:01 +0000
Subject: [PATCH 4/4] 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
Backport
* gcc.target/arm/armv8-sync-comp-swap.c: Replace
'do-require-effective-target' with 'dg-require-effective-target'.
* gcc.target/arm/armv8-sync-op-full.c: Likewise.
* gcc.target/arm/armv8-sync-op-release.c: Likewise.
* gcc.target/arm/armv8-sync-op-acquire.c: Likewise. Also, replace
'stlex' with 'strex' as the expected output.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225241 138bc75d-0d04-0410-961f-82ee72b054a4
Conflicts:
gcc/testsuite/ChangeLog
Change-Id: I19f2013f7bdd2dd035f36f0f7c9829cf6a86fb8e
---
gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c | 2 +-
gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c | 4 ++--
gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c | 2 +-
gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c b/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
index f96c81a..0e95986 100644
--- a/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-comp-swap.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v8a } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
index 8d6659b..c448599 100644
--- a/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-acquire.c
@@ -1,10 +1,10 @@
/* { dg-do compile } */
-/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v8a } */
#include "../aarch64/sync-op-acquire.x"
/* { dg-final { scan-assembler-times "ldrex" 1 } } */
-/* { dg-final { scan-assembler-times "stlex" 1 } } */
+/* { dg-final { scan-assembler-times "strex" 1 } } */
/* { dg-final { scan-assembler-times "dmb" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
index a5ad3bd..cce9e00 100644
--- a/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-full.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v8a } */
diff --git a/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c b/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
index 0d3be7b..502a266 100644
--- a/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
+++ b/gcc/testsuite/gcc.target/arm/armv8-sync-op-release.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { do-require-effective-target arm_arch_v8a_ok } */
+/* { dg-require-effective-target arm_arch_v8a_ok } */
/* { dg-options "-O2" } */
/* { dg-add-options arm_arch_v8a } */
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 4/4][ARM][PR target/65697][5.1] Fix tests for __sync_builtins.
2015-07-27 10:43 ` Matthew Wahab
@ 2015-07-31 9:49 ` Ramana Radhakrishnan
0 siblings, 0 replies; 12+ messages in thread
From: Ramana Radhakrishnan @ 2015-07-31 9:49 UTC (permalink / raw)
To: gcc-patches
On 27/07/15 11:32, Matthew Wahab wrote:
> Ping. Updated patch attached.
>
> Also, retested for arm-none-linux-gnueabihf with native bootstrap and make
> check and for arm-none-eabi with cross compiled make check.
>
> On 02/07/15 14:18, Matthew Wahab wrote:
>> This patch backports fixes for the __sync builtin tests.
>>
>> The trunk patch submission is at
>> https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00031.html
>> The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-07/msg00025.html
>>
>> Tested the series for arm-none-linux-gnueabihf with check-gcc
>>
>> Ok for the branch?
>> Matthew
>>
>> gcc/testsuite
>> 2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
>>
>> Backport from trunk:
>> 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
>>
>> * gcc.target/arm/armv8-sync-comp-swap.c: Replace
>> 'do-require-effective-target' with 'dg-require-effective-target'.
>> * gcc.target/arm/armv8-sync-op-full.c: Likewise.
>> * gcc.target/arm/armv8-sync-op-release.c: Likewise.
>> * gcc.target/arm/armv8-sync-op-acquire.c: Likewise. Also, replace
>> 'stlex' with 'strex' as the expected output.
>>
>
Please mention the PR in the changelog for this and the previous patch.
OK with that change.
Ramana
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins.
2015-07-02 13:12 [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins Matthew Wahab
` (2 preceding siblings ...)
2015-07-02 13:18 ` [PATCH 4/4][ARM][PR target/65697][5.1] Fix " Matthew Wahab
@ 2015-07-27 10:31 ` Matthew Wahab
2015-07-31 9:39 ` Ramana Radhakrishnan
3 siblings, 1 reply; 12+ messages in thread
From: Matthew Wahab @ 2015-07-27 10:31 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1119 bytes --]
Ping. Updated patch attached.
Also, retested for arm-none-linux-gnueabihf with native bootstrap and make
check and for arm-none-eabi with cross compiled make check.
On 02/07/15 14:12, Matthew Wahab wrote:
> The __sync builtins are implemented using barriers that are too weak for ARMv8
> targets, this has been fixed on trunk for the ARM back-end. Since GCC-5.1 is
> also generating the incorrect code, it should also be fixed.
>
> This patch backports the changes made to strengthen the barriers emitted for
> the __sync fetch-and-op/op-and-fetch builtins.
>
> The trunk patch submission is at
> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01410.html
> The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-06/msg01235.html
>
> Tested the series for arm-none-linux-gnueabihf with check-gcc
>
> Ok for the branch?
> Matthew
>
> 2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
>
> Backport from trunk:
> 2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
>
> PR target/65697
> * config/armc/arm.c (arm_split_atomic_op): For ARMv8, replace an
> initial acquire barrier with final barrier.
[-- Attachment #2: 0001-2015-07-01-Matthew-Wahab-matthew.wahab-arm.com.patch --]
[-- Type: text/x-patch, Size: 2082 bytes --]
From 0c2f209f869aead3475fe491f08cf7640d2bc8fe Mon Sep 17 00:00:00 2001
From: mwahab <mwahab@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 29 Jun 2015 16:03:34 +0000
Subject: [PATCH 1/4] 2015-07-01 Matthew Wahab <matthew.wahab@arm.com>
Backport
PR target/65697
* config/armc/arm.c (arm_split_atomic_op): For ARMv8, replace an
initial acquire barrier with final barrier.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225132 138bc75d-0d04-0410-961f-82ee72b054a4
Conflicts:
gcc/ChangeLog
Change-Id: I2074541794ecad8847ada04690cd9132a51b6404
---
gcc/config/arm/arm.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 614ff0d..f694e74 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -27822,6 +27822,8 @@ arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
rtx_code_label *label;
rtx x;
+ bool is_armv8_sync = arm_arch8 && is_mm_sync (model);
+
bool use_acquire = TARGET_HAVE_LDACQ
&& !(is_mm_relaxed (model) || is_mm_consume (model)
|| is_mm_release (model));
@@ -27830,6 +27832,11 @@ arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
&& !(is_mm_relaxed (model) || is_mm_consume (model)
|| is_mm_acquire (model));
+ /* For ARMv8, a load-acquire is too weak for __sync memory orders. Instead,
+ a full barrier is emitted after the store-release. */
+ if (is_armv8_sync)
+ use_acquire = false;
+
/* Checks whether a barrier is needed and emits one accordingly. */
if (!(use_acquire || use_release))
arm_pre_atomic_barrier (model);
@@ -27900,7 +27907,8 @@ arm_split_atomic_op (enum rtx_code code, rtx old_out, rtx new_out, rtx mem,
emit_unlikely_jump (gen_cbranchsi4 (x, cond, const0_rtx, label));
/* Checks whether a barrier is needed and emits one accordingly. */
- if (!(use_acquire || use_release))
+ if (is_armv8_sync
+ || !(use_acquire || use_release))
arm_post_atomic_barrier (model);
}
\f
--
1.9.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins.
2015-07-27 10:31 ` [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins Matthew Wahab
@ 2015-07-31 9:39 ` Ramana Radhakrishnan
0 siblings, 0 replies; 12+ messages in thread
From: Ramana Radhakrishnan @ 2015-07-31 9:39 UTC (permalink / raw)
To: Matthew Wahab, gcc-patches
On 27/07/15 11:29, Matthew Wahab wrote:
> Ping. Updated patch attached.
>
> Also, retested for arm-none-linux-gnueabihf with native bootstrap and make
> check and for arm-none-eabi with cross compiled make check.
>
> On 02/07/15 14:12, Matthew Wahab wrote:
>> The __sync builtins are implemented using barriers that are too weak for ARMv8
>> targets, this has been fixed on trunk for the ARM back-end. Since GCC-5.1 is
>> also generating the incorrect code, it should also be fixed.
>>
>> This patch backports the changes made to strengthen the barriers emitted for
>> the __sync fetch-and-op/op-and-fetch builtins.
>>
>> The trunk patch submission is at
>> https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01410.html
>> The commit is at https://gcc.gnu.org/ml/gcc-cvs/2015-06/msg01235.html
>>
>> Tested the series for arm-none-linux-gnueabihf with check-gcc
>>
>> Ok for the branch?
>> Matthew
>>
>> 2015-07-02 Matthew Wahab <matthew.wahab@arm.com>
>>
>> Backport from trunk:
>> 2015-06-29 Matthew Wahab <matthew.wahab@arm.com>
>>
>> PR target/65697
>> * config/armc/arm.c (arm_split_atomic_op): For ARMv8, replace an
>> initial acquire barrier with final barrier.
>
This is OK thanks,
Ramana
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-07-31 9:39 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-02 13:12 [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins Matthew Wahab
2015-07-02 13:15 ` [PATCH 2/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync,compare-and-swap builtins Matthew Wahab
2015-07-27 10:32 ` Matthew Wahab
2015-07-31 9:41 ` Ramana Radhakrishnan
2015-07-02 13:17 ` [PATCH 3/4][ARM][PR target/65697][5.1] Add tests for __sync_builtins Matthew Wahab
2015-07-27 10:32 ` Matthew Wahab
2015-07-31 9:41 ` Ramana Radhakrishnan
2015-07-02 13:18 ` [PATCH 4/4][ARM][PR target/65697][5.1] Fix " Matthew Wahab
2015-07-27 10:43 ` Matthew Wahab
2015-07-31 9:49 ` Ramana Radhakrishnan
2015-07-27 10:31 ` [PATCH 1/4][ARM][PR target/65697][5.1] Backport stronger barriers for __sync fetch-op builtins Matthew Wahab
2015-07-31 9:39 ` Ramana Radhakrishnan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).