Index: sp_counted_base_gcc_ia64.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/detail/sp_counted_base_gcc_ia64.hpp,v retrieving revision 1.3 diff -u -r1.3 sp_counted_base_gcc_ia64.hpp --- sp_counted_base_gcc_ia64.hpp 18 Mar 2006 01:48:20 -0000 1.3 +++ sp_counted_base_gcc_ia64.hpp 22 Mar 2006 13:43:28 -0000 @@ -24,29 +24,29 @@ namespace detail { -inline void atomic_increment( long * pw ) +inline void atomic_increment( int * pw ) { // ++*pw; - long tmp; + int tmp; // No barrier is required here but fetchadd always has an acquire or // release barrier associated with it. We choose release as it should be // cheaper. - __asm__ ("fetchadd8.rel %0=[%2],1" : + __asm__ ("fetchadd4.rel %0=[%2],1" : "=r"(tmp), "=m"(*pw) : "r"(pw), "m"( *pw )); } -inline long atomic_decrement( long * pw ) +inline int atomic_decrement( int * pw ) { // return --*pw; - long rv; + int rv; - __asm__ (" fetchadd8.rel %0=[%2],-1 ;; \n" + __asm__ (" fetchadd4.rel %0=[%2],-1 ;; \n" " cmp.eq p7,p0=1,%0 ;; \n" - "(p7) ld8.acq %0=[%2] " : + "(p7) ld4.acq %0=[%2] " : "=&r"(rv), "=m"(*pw) : "r"(pw), "m"( *pw ) : "p7"); @@ -54,19 +54,19 @@ return rv; } -inline long atomic_conditional_increment( long * pw ) +inline int atomic_conditional_increment( int * pw ) { // if( *pw != 0 ) ++*pw; // return *pw; - long rv, tmp, tmp2; + int rv, tmp, tmp2; - __asm__ ("0: ld8 %0=[%4] ;; \n" + __asm__ ("0: ld4 %0=[%4] ;; \n" " cmp.eq p7,p0=0,%0 ;; \n" "(p7) br.cond.spnt 1f \n" " mov ar.ccv=%0 \n" " add %1=1,%0 ;; \n" - " cmpxchg8.acq %2=[%4],%1,ar.ccv ;; \n" + " cmpxchg4.acq %2=[%4],%1,ar.ccv ;; \n" " cmp.ne p7,p0=%0,%2 ;; \n" "(p7) br.cond.spnt 0b \n" " mov %0=%1 ;; \n" @@ -85,8 +85,8 @@ sp_counted_base( sp_counted_base const & ); sp_counted_base & operator= ( sp_counted_base const & ); - long use_count_; // #shared - long weak_count_; // #weak + (#shared != 0) + int use_count_; // #shared + int weak_count_; // #weak + (#shared != 0) public: @@ -146,7 +146,7 @@ long use_count() const // nothrow { - return static_cast( use_count_ ); + return static_cast( use_count_ ); // TODO use ld.acq here } };