On 9 February 2012 01:14, Ivan Pechorin <[email protected]> wrote:
> 2012/2/8 Steven McCoy <[email protected]>: > > > > Compare with my atomics: > > > > > http://code.google.com/p/openpgm/source/browse/trunk/openpgm/pgm/include/pgm/atomic.h > > Steven, what is the reason to use asm on Solaris/x86 instead of > Solaris intrinsics from <atomic.h> ? > Solaris intrinsics are actually poorer implementations using CAS-only. > > #elif (defined( __SUNPRO_C ) || defined( __SUNPRO_CC )) && (defined( > __i386 ) || defined( __amd64 )) > uint32_t result = val; > __asm__ volatile ("lock; xaddl %0, %1" > :: "r" (result), "m" (*atomic) ); > return result; > > And (sorry for stupid question), why the asm for x86/x86_64 is > different for SunCC and for GCC/ICC ? > SunCC doesn't support the same level of clobber clauses. > > By the way, HP-UX also has the same intrinsics in <atomic.h>. > So, I believe, it's worth changing > > #if defined( __sun ) > # include <atomic.h> > > to something like this: > > #if (defined(sun) || defined(__sun) || defined(hpux) || defined(__hpux)) > > I don't support IA64 in quite a few places in the code which is why there is no HP-UX support. -- Steve-o
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
