Re: volatile access optimization (C++ / x86_64)

2014-12-26 Thread Matt Godbolt
On Fri, Dec 26, 2014 at 5:20 PM, NightStrike wrote: > Have you tried release and acquire/consume instead? Yes; these emit the same instructions in this case. http://goo.gl/e94Ya7 Regards, Matt

Re: volatile access optimization (C++ / x86_64)

2014-12-26 Thread Matt Godbolt
On Fri, Dec 26, 2014 at 5:19 PM, Andrew Haley wrote: > On 26/12/14 22:49, Matt Godbolt wrote: >> On Fri, Dec 26, 2014 at 4:26 PM, Andrew Haley wrote: >>> On 26/12/14 20:32, Matt Godbolt wrote: >> I realise my understanding could be wrong here! >> If not though, both clang and icc are taking a sh

Re: volatile access optimization (C++ / x86_64)

2014-12-26 Thread Matt Godbolt
On Fri, Dec 26, 2014 at 4:51 PM, Marc Glisse wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50677 Thanks Marc

Re: volatile access optimization (C++ / x86_64)

2014-12-26 Thread Andrew Haley
On 26/12/14 22:49, Matt Godbolt wrote: > On Fri, Dec 26, 2014 at 4:26 PM, Andrew Haley wrote: >> On 26/12/14 20:32, Matt Godbolt wrote: >>> Is there a reason why (in principal) the volatile increment can't be >>> made into a single add? Clang and ICC both emit the same code for the >>> volatile an

Re: volatile access optimization (C++ / x86_64)

2014-12-26 Thread Marc Glisse
On Fri, 26 Dec 2014, Matt Godbolt wrote: I'm investigating ways to have single-threaded writers write to memory areas which are then (very infrequently) read from another thread for monitoring purposes. Things like "number of units of work done". I initially modeled this with relaxed atomic ope

Re: volatile access optimization (C++ / x86_64)

2014-12-26 Thread Matt Godbolt
On Fri, Dec 26, 2014 at 4:26 PM, Andrew Haley wrote: > On 26/12/14 20:32, Matt Godbolt wrote: >> Is there a reason why (in principal) the volatile increment can't be >> made into a single add? Clang and ICC both emit the same code for the >> volatile and non-volatile case. > > Yes. Volatiles use

Re: volatile access optimization (C++ / x86_64)

2014-12-26 Thread Andrew Haley
On 26/12/14 20:32, Matt Godbolt wrote: > I'm investigating ways to have single-threaded writers write to memory > areas which are then (very infrequently) read from another thread for > monitoring purposes. Things like "number of units of work done". > > I initially modeled this with relaxed atom

volatile access optimization (C++ / x86_64)

2014-12-26 Thread Matt Godbolt
Hi all, I'm investigating ways to have single-threaded writers write to memory areas which are then (very infrequently) read from another thread for monitoring purposes. Things like "number of units of work done". I initially modeled this with relaxed atomic operations. This generates a "lock xad

OpenMP vector function ABI for x86_64

2014-12-26 Thread Andrew Senkevich
­Hi, during work on addition vector math functions to Glibc and discussions with community was found an issue with meaning of “#pragma omp declare simd” (which will appear in math.h). Issue is there are no working way­ to specify ISA of vector function in GCC 5.0, and hence no way to determine ex