Re: [PATCH] fix generic std::atomic::compare_exchange_{weak,strong}

2013-07-26 Thread Paolo Carlini
Hi, On 07/27/2013 01:07 AM, Nathan Froyd wrote: - Original Message - On 07/26/2013 08:42 PM, Nathan Froyd wrote: Sure, I can do that. For maximum effectiveness, it'd be good to have it check the specializations for atomic<>, too. Is there something in the libstdc++ testsuite for iter

Re: [PATCH] fix generic std::atomic::compare_exchange_{weak,strong}

2013-07-26 Thread Nathan Froyd
- Original Message - > On 07/26/2013 08:42 PM, Nathan Froyd wrote: > > Sure, I can do that. For maximum effectiveness, it'd be good to have it > > check the specializations for atomic<>, too. Is there something in the > > libstdc++ testsuite for iterating template instantiations over a li

Re: [PATCH] fix generic std::atomic::compare_exchange_{weak,strong}

2013-07-26 Thread Paolo Carlini
Hi, On 07/26/2013 08:42 PM, Nathan Froyd wrote: Sure, I can do that. For maximum effectiveness, it'd be good to have it check the specializations for atomic<>, too. Is there something in the libstdc++ testsuite for iterating template instantiations over a list of types, or do I have to roll

Re: [PATCH] fix generic std::atomic::compare_exchange_{weak,strong}

2013-07-26 Thread Nathan Froyd
Sure, I can do that. For maximum effectiveness, it'd be good to have it check the specializations for atomic<>, too. Is there something in the libstdc++ testsuite for iterating template instantiations over a list of types, or do I have to roll the list myself? Thanks, -Nathan - Original

Re: [PATCH] fix generic std::atomic::compare_exchange_{weak,strong}

2013-07-26 Thread Paolo Carlini
Hi, Nathan Froyd ha scritto: >Compiling the test program: > >#include > >enum x { a, b }; > >std::atomic v; > >bool test_strong() >{ > x expected = a; >return v.compare_exchange_strong(expected, b, >std::memory_order_acq_rel); >} > >bool test_weak() >{ > x expected = a; >return v.compare_exc

[PATCH] fix generic std::atomic::compare_exchange_{weak,strong}

2013-07-26 Thread Nathan Froyd
Compiling the test program: #include enum x { a, b }; std::atomic v; bool test_strong() { x expected = a; return v.compare_exchange_strong(expected, b, std::memory_order_acq_rel); } bool test_weak() { x expected = a; return v.compare_exchange_weak(expected, b, std::memory_order_acq_re