Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2018-04-11 Thread Tom de Vries
On 01/30/2017 07:54 PM, Torvald Riegel wrote: This patch fixes the __atomic builtins to not implement supposedly lock-free atomic loads based on just a compare-and-swap operation. Hi, The internals doc still lists CAS ( https://gcc.gnu.org/onlinedocs/gccint/Standard-Names.html#index-atomic_00

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-06 Thread Richard Henderson
On 02/03/2017 05:44 AM, Ramana Radhakrishnan wrote: On 02/02/17 15:21, Torvald Riegel wrote: On Thu, 2017-02-02 at 14:48 +, Ramana Radhakrishnan wrote: On 30/01/17 18:54, Torvald Riegel wrote: This patch fixes the __atomic builtins to not implement supposedly lock-free atomic loads based o

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-06 Thread Jakub Jelinek
On Wed, Feb 01, 2017 at 06:26:04PM +0100, Torvald Riegel wrote: > On Mon, 2017-01-30 at 19:54 +0100, Torvald Riegel wrote: > > This patch fixes the __atomic builtins to not implement supposedly > > lock-free atomic loads based on just a compare-and-swap operation. > > After an off-list OK by Jakub

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-04 Thread Jakub Jelinek
On Sat, Feb 04, 2017 at 03:28:42PM +0100, Dominique d'Humières wrote: > > This patch fixes the __atomic builtins to not implement supposedly > > lock-free atomic loads based on just a compare-and-swap operation. > > … > > Commit r245098 caused > > New failures: > FAIL: libgomp.c/atomic-2.c (test

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-04 Thread Dominique d'Humières
> This patch fixes the __atomic builtins to not implement supposedly > lock-free atomic loads based on just a compare-and-swap operation. > … Commit r245098 caused New failures: FAIL: libgomp.c/atomic-2.c (test for excess errors) FAIL: libgomp.c/atomic-4.c (test for excess errors) FAIL: libgomp.c

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-03 Thread Torvald Riegel
On Fri, 2017-02-03 at 17:21 +0100, Jakub Jelinek wrote: > On Fri, Feb 03, 2017 at 04:19:58PM +, Ramana Radhakrishnan wrote: > > > > Would it be acceptable for those users to have loads that perform like > > > > CAS loops, especially under contention? Or are these users more > > > > concerned a

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-03 Thread Jakub Jelinek
On Fri, Feb 03, 2017 at 04:19:58PM +, Ramana Radhakrishnan wrote: > > > Would it be acceptable for those users to have loads that perform like > > > CAS loops, especially under contention? Or are these users more > > > concerned about aarch64 not offering a true atomic 16-byte load? > > > > C

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-03 Thread Ramana Radhakrishnan
On 03/02/17 15:13, Jakub Jelinek wrote: On Fri, Feb 03, 2017 at 04:07:22PM +0100, Torvald Riegel wrote: On Fri, 2017-02-03 at 13:44 +, Ramana Radhakrishnan wrote: __atomic_load on ARM appears to be ok as well except for __atomic_load_di which should really be the ldrexd / strexd loop but

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-03 Thread Jakub Jelinek
On Fri, Feb 03, 2017 at 04:07:22PM +0100, Torvald Riegel wrote: > On Fri, 2017-02-03 at 13:44 +, Ramana Radhakrishnan wrote: > > __atomic_load on ARM appears to be ok as well > > > > except for > > > > __atomic_load_di which should really be the ldrexd / strexd loop but we > > could ameliora

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-03 Thread Torvald Riegel
On Fri, 2017-02-03 at 13:44 +, Ramana Radhakrishnan wrote: > __atomic_load on ARM appears to be ok as well > > except for > > __atomic_load_di which should really be the ldrexd / strexd loop but we > could ameliorate that similar to your option 3b. This uses just ldrexd now, and thus is not

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-03 Thread Ramana Radhakrishnan
On 02/02/17 15:21, Torvald Riegel wrote: On Thu, 2017-02-02 at 14:48 +, Ramana Radhakrishnan wrote: On 30/01/17 18:54, Torvald Riegel wrote: This patch fixes the __atomic builtins to not implement supposedly lock-free atomic loads based on just a compare-and-swap operation. If there is no

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-02 Thread Torvald Riegel
On Thu, 2017-02-02 at 13:58 +0100, Thomas Schwinge wrote: > > The other failures I saw didn't seem atomics related > > (eg, openacc) > > I suppose you're testing without nvptx offloading -- which failures do > you see for OpenACC testing? (There shouldn't be any for host fallback > testing.) Sor

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-02 Thread Torvald Riegel
On Thu, 2017-02-02 at 14:48 +, Ramana Radhakrishnan wrote: > On 30/01/17 18:54, Torvald Riegel wrote: > > This patch fixes the __atomic builtins to not implement supposedly > > lock-free atomic loads based on just a compare-and-swap operation. > > > > If there is no hardware-backed atomic load

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-02 Thread Ramana Radhakrishnan
On 02/02/17 14:52, Jakub Jelinek wrote: On Thu, Feb 02, 2017 at 02:48:42PM +, Ramana Radhakrishnan wrote: On 30/01/17 18:54, Torvald Riegel wrote: This patch fixes the __atomic builtins to not implement supposedly lock-free atomic loads based on just a compare-and-swap operation. If there

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-02 Thread Jakub Jelinek
On Thu, Feb 02, 2017 at 02:48:42PM +, Ramana Radhakrishnan wrote: > On 30/01/17 18:54, Torvald Riegel wrote: > > This patch fixes the __atomic builtins to not implement supposedly > > lock-free atomic loads based on just a compare-and-swap operation. > > > > If there is no hardware-backed atom

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-02 Thread Ramana Radhakrishnan
On 30/01/17 18:54, Torvald Riegel wrote: This patch fixes the __atomic builtins to not implement supposedly lock-free atomic loads based on just a compare-and-swap operation. If there is no hardware-backed atomic load for a certain memory location, the current implementation can implement the lo

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-02 Thread Thomas Schwinge
Hi! On Mon, 30 Jan 2017 19:54:00 +0100, Torvald Riegel wrote: > This patch fixes the __atomic builtins to not implement supposedly > lock-free atomic loads based on just a compare-and-swap operation. [...] > I've tested this on an x86_64-linux bootstrap build and see no > regressions. (With th

Re: [PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-02-01 Thread Torvald Riegel
On Mon, 2017-01-30 at 19:54 +0100, Torvald Riegel wrote: > This patch fixes the __atomic builtins to not implement supposedly > lock-free atomic loads based on just a compare-and-swap operation. After an off-list OK by Jakub, I have committed this as r245098. Jakub will take care of the OpenMP sid

[PATCH] Fix __atomic to not implement atomic loads with CAS.

2017-01-30 Thread Torvald Riegel
This patch fixes the __atomic builtins to not implement supposedly lock-free atomic loads based on just a compare-and-swap operation. If there is no hardware-backed atomic load for a certain memory location, the current implementation can implement the load with a CAS while claiming that the acces