Re: atomic_load

2021-11-26 Thread Martin Uecker via Gcc
Am Freitag, den 26.11.2021, 15:48 + schrieb Jonathan Wakely: > On Fri, 26 Nov 2021 at 15:41, Martin Uecker wrote: > > Am Freitag, den 26.11.2021, 09:24 + schrieb Jonathan Wakely: > > > On Fri, 26 Nov 2021 at 09:00, Martin Uecker via Gcc > > > wrote: > > > > Am Freitag, den 26.11.2021, 09

Re: atomic_load

2021-11-26 Thread Jonathan Wakely via Gcc
On Fri, 26 Nov 2021 at 16:58, Gabriel Ravier wrote: > > > On 11/26/21 16:48, Jonathan Wakely via Gcc wrote: > > On Fri, 26 Nov 2021 at 15:41, Martin Uecker wrote: > >> Am Freitag, den 26.11.2021, 09:24 + schrieb Jonathan Wakely: > >>> On Fri, 26 Nov 2021 at 09:00, Martin Uecker via Gcc > >>

Re: atomic_load

2021-11-26 Thread Gabriel Ravier via Gcc
On 11/26/21 16:48, Jonathan Wakely via Gcc wrote: On Fri, 26 Nov 2021 at 15:41, Martin Uecker wrote: Am Freitag, den 26.11.2021, 09:24 + schrieb Jonathan Wakely: On Fri, 26 Nov 2021 at 09:00, Martin Uecker via Gcc wrote: Am Freitag, den 26.11.2021, 09:29 +0100 schrieb Eric Botcazou: T

Re: atomic_load

2021-11-26 Thread Jonathan Wakely via Gcc
On Fri, 26 Nov 2021 at 15:41, Martin Uecker wrote: > > Am Freitag, den 26.11.2021, 09:24 + schrieb Jonathan Wakely: > > On Fri, 26 Nov 2021 at 09:00, Martin Uecker via Gcc wrote: > > > Am Freitag, den 26.11.2021, 09:29 +0100 schrieb Eric Botcazou: > > > > > This is a silent and dangerous inco

Re: atomic_load

2021-11-26 Thread Martin Uecker via Gcc
Am Freitag, den 26.11.2021, 09:24 + schrieb Jonathan Wakely: > On Fri, 26 Nov 2021 at 09:00, Martin Uecker via Gcc wrote: > > Am Freitag, den 26.11.2021, 09:29 +0100 schrieb Eric Botcazou: > > > > This is a silent and dangerous incorrect code generation issue. > > > > > > Let's avoid this kin

Re: atomic_load

2021-11-26 Thread Jonathan Wakely via Gcc
On Fri, 26 Nov 2021 at 09:00, Martin Uecker via Gcc wrote: > > Am Freitag, den 26.11.2021, 09:29 +0100 schrieb Eric Botcazou: > > > This is a silent and dangerous incorrect code generation issue. > > > > Let's avoid this kind of FUD, please, builtins are low-level devices and > > people must know

Re: atomic_load

2021-11-26 Thread Martin Uecker via Gcc
Am Freitag, den 26.11.2021, 09:29 +0100 schrieb Eric Botcazou: > > This is a silent and dangerous incorrect code generation issue. > > Let's avoid this kind of FUD, please, builtins are low-level devices and > people must know what they are doing and be prepared for caveats. Sorry, I do not thin

Re: atomic_load

2021-11-26 Thread Eric Botcazou
> This is a silent and dangerous incorrect code generation issue. Let's avoid this kind of FUD, please, builtins are low-level devices and people must know what they are doing and be prepared for caveats. > If these functions are not meant to be used to exising > data, then at least the documen

Re: atomic_load

2021-11-25 Thread Martin Uecker via Gcc
Am Sonntag, den 07.11.2021, 10:08 +0100 schrieb Martin Uecker: > It would be great if somebody could take a look at > PR96159. > > It seems we do not do atomic accesses correctly > when the alignment is insufficient for a lockfree > access, but I think we should fall back to a > library call in t

Re: atomic_load

2021-11-08 Thread Martin Uecker via Gcc
Am Montag, den 08.11.2021, 11:59 + schrieb Jonathan Wakely: > On Sun, 7 Nov 2021, 09:08 Martin Uecker wrote: > > > It would be great if somebody could take a look at > > PR96159. > > > > It seems we do not do atomic accesses correctly > > when the alignment is insufficient for a lockfree > >

Re: atomic_load

2021-11-08 Thread Jonathan Wakely via Gcc
On Sun, 7 Nov 2021, 09:08 Martin Uecker wrote: > > It would be great if somebody could take a look at > PR96159. > > It seems we do not do atomic accesses correctly > when the alignment is insufficient for a lockfree > access, but I think we should fall back to a > library call in this case (as cl

Re: atomic_load

2021-11-07 Thread Martin Uecker via Gcc
Am Sonntag, den 07.11.2021, 10:24 +0100 schrieb Florian Weimer: > * Martin Uecker via Gcc: > > > It would be great if somebody could take a look at > > PR96159. > > > > It seems we do not do atomic accesses correctly > > when the alignment is insufficient for a lockfree > > access, but I think w

Re: atomic_load

2021-11-07 Thread Florian Weimer via Gcc
* Martin Uecker via Gcc: > It would be great if somebody could take a look at > PR96159. > > It seems we do not do atomic accesses correctly > when the alignment is insufficient for a lockfree > access, but I think we should fall back to a > library call in this case (as clang does). > > This is

atomic_load

2021-11-07 Thread Martin Uecker via Gcc
It would be great if somebody could take a look at PR96159. It seems we do not do atomic accesses correctly when the alignment is insufficient for a lockfree access, but I think we should fall back to a library call in this case (as clang does). This is very unfortunate as it is an important f

atomic_load: code generation 64 bit for struct

2020-06-28 Thread Uecker, Martin
Hi all, the following code compiles into a mov instruction on x86_64. I wonder why. The struct has alignment 4, so a mov might not be atomic if the struct is not alligned to its full size. For this reason, I expected a call to libatomic instead  (LLVM does this). What am I missing? The docume

Re: Powerpc atomic_load

2015-09-23 Thread Peter Bergner
On Wed, 2015-09-23 at 16:15 +0200, Sebastian Huber wrote: > On 10/09/15 19:52, David Edelsohn wrote: > > https://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html > > Is there specific reason why the SYNC L,E (Elemental Memory Barriers) > defined by Power-ISA V2.07 doesn't appear in this table? Pro

Re: Powerpc atomic_load

2015-09-23 Thread Sebastian Huber
On 10/09/15 19:52, David Edelsohn wrote: https://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html Is there specific reason why the SYNC L,E (Elemental Memory Barriers) defined by Power-ISA V2.07 doesn't appear in this table? -- Sebastian Huber, embedded brains GmbH Address : Dornierstr. 4, D-

Re: Powerpc atomic_load

2015-09-10 Thread Bernhard Schommer
Thanks a lot for this fast answer. Am 10.09.2015 um 19:52 schrieb David Edelsohn: https://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html On Thu, Sep 10, 2015 at 1:39 PM, Bernhard Schommer wrote: I just ran into something strange using gcc 8.4.3 for powerpc. A call to the __atomic_load functio

Re: Powerpc atomic_load

2015-09-10 Thread David Edelsohn
https://www.cl.cam.ac.uk/~pes20/cpp/cpp0xmappings.html On Thu, Sep 10, 2015 at 1:39 PM, Bernhard Schommer wrote: > I just ran into something strange using gcc 8.4.3 for powerpc. > A call to the __atomic_load function: > > __atomic_load(&Buf, &buf, __ATOMIC_SEQ_CST); > > expands to: > > sync > lis

Powerpc atomic_load

2015-09-10 Thread Bernhard Schommer
I just ran into something strange using gcc 8.4.3 for powerpc. A call to the __atomic_load function: __atomic_load(&Buf, &buf, __ATOMIC_SEQ_CST); expands to: sync lis 9,Buf@ha lwz 9,Buf@l(9) cmpw 7,9,9 bne- 7,$+4 isync stw 9,8(1) However the PowerISA_V2.07 manual suggest in Appendix B.2.3 (Saf