On Feb 10, 2010, at 7:47 AM, Ake Sandgren wrote:

> According to people who knows asm statements fairly well (compiler
> developers), it should be

> static inline int opal_atomic_cmpset_32( volatile int32_t *addr,
>                                          int32_t oldval, int32_t newval)
> {
>     unsigned char ret;
>     __asm__ __volatile__ (
>                         SMPLOCK "cmpxchgl %3,%2   \n\t"
>                                 "sete     %0      \n\t"
>                         : "=qm" (ret), "=a" (oldval), "=m" (*addr)
>                         : "q"(newval), "2"(*addr), "1"(oldval)
>                         : "memory", "cc");
> 
>     return (int)ret;
> }

Disclaimer: I know almost nothing about assembly.

I know that OMPI's asm is a carefully crafted set of assembly that works across 
a broad range of compilers.  So what might not be "quite right" for one 
compiler may actually be there because another compiler needs it.

That being said, if the changes above are for correctness, not 
neatness/style/etc., I can't speak for that...

-- 
Jeff Squyres
jsquy...@cisco.com

For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to