< prev index next >

src/os_cpu/aix_ppc/vm/atomic_aix_ppc.hpp

Print this page
rev 13452 : imported patch Atomic_cmpxchg
rev 13453 : imported patch Atomic_add
rev 13454 : [mq]: Atomic_add_v2

*** 91,103 **** #define strasm_acquire strasm_lwsync #define strasm_fence strasm_sync #define strasm_nobarrier "" #define strasm_nobarrier_clobber_memory "" ! inline jint Atomic::add (jint add_value, volatile jint* dest) { ! unsigned int result; __asm__ __volatile__ ( strasm_lwsync "1: lwarx %0, 0, %2 \n" " add %0, %0, %1 \n" --- 91,115 ---- #define strasm_acquire strasm_lwsync #define strasm_fence strasm_sync #define strasm_nobarrier "" #define strasm_nobarrier_clobber_memory "" ! template<size_t byte_size> ! struct Atomic::PlatformAdd ! : Atomic::AddAndFetch<Atomic::PlatformAdd<byte_size> > ! { ! template<typename I, typename D> ! D add_and_fetch(I add_value, D volatile* dest) const; ! }; ! ! template<> ! template<typename I, typename D> ! inline D Atomic::PlatformAdd<4>::add_and_fetch(I add_value, D volatile* dest) const { ! STATIC_CAST(4 == sizeof(I)); ! STATIC_CAST(4 == sizeof(D)); ! D result; __asm__ __volatile__ ( strasm_lwsync "1: lwarx %0, 0, %2 \n" " add %0, %0, %1 \n"
*** 106,122 **** strasm_isync : /*%0*/"=&r" (result) : /*%1*/"r" (add_value), /*%2*/"r" (dest) : "cc", "memory" ); ! return (jint) result; } ! inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) { ! long result; __asm__ __volatile__ ( strasm_lwsync "1: ldarx %0, 0, %2 \n" " add %0, %0, %1 \n" --- 118,138 ---- strasm_isync : /*%0*/"=&r" (result) : /*%1*/"r" (add_value), /*%2*/"r" (dest) : "cc", "memory" ); ! return result; } ! template<> ! template<typename I, typename D> ! inline D Atomic::PlatformAdd<8>::add_and_fetch(I add_value, D volatile* dest) const { ! STATIC_CAST(8 == sizeof(I)); ! STATIC_CAST(8 == sizeof(D)); ! D result; __asm__ __volatile__ ( strasm_lwsync "1: ldarx %0, 0, %2 \n" " add %0, %0, %1 \n"
*** 125,141 **** strasm_isync : /*%0*/"=&r" (result) : /*%1*/"r" (add_value), /*%2*/"r" (dest) : "cc", "memory" ); ! return (intptr_t) result; ! } ! ! inline void* Atomic::add_ptr(intptr_t add_value, volatile void* dest) { ! return (void*)add_ptr(add_value, (volatile intptr_t*)dest); } inline void Atomic::inc (volatile jint* dest) { unsigned int temp; --- 141,155 ---- strasm_isync : /*%0*/"=&r" (result) : /*%1*/"r" (add_value), /*%2*/"r" (dest) : "cc", "memory" ); ! return result; } + template<> + struct Atomic::PlatformAdd<2>: Atomic::AddShortUsingInt {}; inline void Atomic::inc (volatile jint* dest) { unsigned int temp;
< prev index next >