Added 'm'(*pw) inputs (thanks to Howard Hinnant)

[SVN r33364]
This commit is contained in:
Peter Dimov
2006-03-18 01:48:21 +00:00
parent ae0a48d544
commit 24d1e6f8dd
2 changed files with 6 additions and 6 deletions

View File

@ -35,7 +35,7 @@ inline void atomic_increment( long * pw )
// cheaper. // cheaper.
__asm__ ("fetchadd8.rel %0=[%2],1" : __asm__ ("fetchadd8.rel %0=[%2],1" :
"=r"(tmp), "=m"(*pw) : "=r"(tmp), "=m"(*pw) :
"r"(pw)); "r"(pw), "m"( *pw ));
} }
inline long atomic_decrement( long * pw ) inline long atomic_decrement( long * pw )
@ -48,7 +48,7 @@ inline long atomic_decrement( long * pw )
" cmp.eq p7,p0=1,%0 ;; \n" " cmp.eq p7,p0=1,%0 ;; \n"
"(p7) ld8.acq %0=[%2] " : "(p7) ld8.acq %0=[%2] " :
"=&r"(rv), "=m"(*pw) : "=&r"(rv), "=m"(*pw) :
"r"(pw) : "r"(pw), "m"( *pw ) :
"p7"); "p7");
return rv; return rv;
@ -72,7 +72,7 @@ inline long atomic_conditional_increment( long * pw )
" mov %0=%1 ;; \n" " mov %0=%1 ;; \n"
"1:" : "1:" :
"=&r"(rv), "=&r"(tmp), "=&r"(tmp2), "=m"(*pw) : "=&r"(rv), "=&r"(tmp), "=&r"(tmp2), "=m"(*pw) :
"r"(pw) : "r"(pw), "m"( *pw ) :
"ar.ccv", "p7"); "ar.ccv", "p7");
return rv; return rv;

View File

@ -47,7 +47,7 @@ inline void atomic_increment( int * pw )
"bne- 0b": "bne- 0b":
"=m"( *pw ), "=&b"( tmp ): "=m"( *pw ), "=&b"( tmp ):
"r"( pw ): "r"( pw ), "m"( *pw ):
"cc" "cc"
); );
} }
@ -69,7 +69,7 @@ inline int atomic_decrement( int * pw )
"isync": "isync":
"=m"( *pw ), "=&b"( rv ): "=m"( *pw ), "=&b"( rv ):
"r"( pw ): "r"( pw ), "m"( *pw ):
"memory", "cc" "memory", "cc"
); );
@ -95,7 +95,7 @@ inline int atomic_conditional_increment( int * pw )
"bne- 0b": "bne- 0b":
"=m"( *pw ), "=&b"( rv ): "=m"( *pw ), "=&b"( rv ):
"r"( pw ): "r"( pw ), "m"( *pw ):
"cc" "cc"
); );