--- old/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.hpp 2017-07-14 18:05:36.102232850 +0200 +++ new/src/os_cpu/linux_ppc/vm/atomic_linux_ppc.hpp 2017-07-14 18:05:35.950232855 +0200 @@ -32,22 +32,6 @@ // Implementation of class atomic -inline void Atomic::store (jbyte store_value, jbyte* dest) { *dest = store_value; } -inline void Atomic::store (jshort store_value, jshort* dest) { *dest = store_value; } -inline void Atomic::store (jint store_value, jint* dest) { *dest = store_value; } -inline void Atomic::store (jlong store_value, jlong* dest) { *dest = store_value; } -inline void Atomic::store_ptr(intptr_t store_value, intptr_t* dest) { *dest = store_value; } -inline void Atomic::store_ptr(void* store_value, void* dest) { *(void**)dest = store_value; } - -inline void Atomic::store (jbyte store_value, volatile jbyte* dest) { *dest = store_value; } -inline void Atomic::store (jshort store_value, volatile jshort* dest) { *dest = store_value; } -inline void Atomic::store (jint store_value, volatile jint* dest) { *dest = store_value; } -inline void Atomic::store (jlong store_value, volatile jlong* dest) { *dest = store_value; } -inline void Atomic::store_ptr(intptr_t store_value, volatile intptr_t* dest) { *dest = store_value; } -inline void Atomic::store_ptr(void* store_value, volatile void* dest) { *(void* volatile *)dest = store_value; } - -inline jlong Atomic::load(const volatile jlong* src) { return *src; } - // // machine barrier instructions: // @@ -93,8 +77,8 @@ #define strasm_nobarrier "" #define strasm_nobarrier_clobber_memory "" -inline jint Atomic::add (jint add_value, volatile jint* dest) { - +template <> +inline int32_t Atomic::specialized_add(int32_t add_value, volatile int32_t* dest) { unsigned int result; __asm__ __volatile__ ( @@ -108,12 +92,12 @@ : /*%1*/"r" (add_value), /*%2*/"r" (dest) : "cc", "memory" ); - return (jint) result; + return (int32_t) result; } -inline intptr_t Atomic::add_ptr(intptr_t add_value, volatile intptr_t* dest) { - +template <> +inline int64_t Atomic::specialized_add(int64_t add_value, volatile int64_t* dest) { long result; __asm__ __volatile__ ( @@ -127,16 +111,12 @@ : /*%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); + return (int64_t) result; } -inline void Atomic::inc (volatile jint* dest) { - +template <> +inline void Atomic::specialized_inc(volatile int32_t* dest) { unsigned int temp; __asm__ __volatile__ ( @@ -152,8 +132,8 @@ } -inline void Atomic::inc_ptr(volatile intptr_t* dest) { - +template <> +inline void Atomic::specialized_inc(volatile int64_t* dest) { long temp; __asm__ __volatile__ ( @@ -169,13 +149,9 @@ } -inline void Atomic::inc_ptr(volatile void* dest) { - inc_ptr((volatile intptr_t*)dest); -} - - -inline void Atomic::dec (volatile jint* dest) { +template <> +inline void Atomic::specialized_dec(volatile int32_t* dest) { unsigned int temp; __asm__ __volatile__ ( @@ -191,8 +167,9 @@ } -inline void Atomic::dec_ptr(volatile intptr_t* dest) { +template <> +inline void Atomic::specialized_dec(volatile int64_t* dest) { long temp; __asm__ __volatile__ ( @@ -208,12 +185,9 @@ } -inline void Atomic::dec_ptr(volatile void* dest) { - dec_ptr((volatile intptr_t*)dest); -} - -inline jint Atomic::xchg(jint exchange_value, volatile jint* dest) { +template <> +inline int32_t Atomic::specialized_xchg(int32_t exchange_value, volatile int32_t* dest) { // Note that xchg_ptr doesn't necessarily do an acquire // (see synchronizer.cpp). @@ -245,11 +219,12 @@ "memory" ); - return (jint) old_value; + return (int32_t) old_value; } -inline intptr_t Atomic::xchg_ptr(intptr_t exchange_value, volatile intptr_t* dest) { +template <> +inline int64_t Atomic::specialized_xchg(int64_t exchange_value, volatile int64_t* dest) { // Note that xchg_ptr doesn't necessarily do an acquire // (see synchronizer.cpp). @@ -281,12 +256,9 @@ "memory" ); - return (intptr_t) old_value; + return (int64_t) old_value; } -inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) { - return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest); -} inline void cmpxchg_pre_membar(cmpxchg_memory_order order) { if (order != memory_order_relaxed) { @@ -307,8 +279,8 @@ } #define VM_HAS_SPECIALIZED_CMPXCHG_BYTE -inline jbyte Atomic::cmpxchg(jbyte exchange_value, volatile jbyte* dest, jbyte compare_value, cmpxchg_memory_order order) { - +template <> +inline int8_t Atomic::specialized_cmpxchg(int8_t exchange_value, volatile int8_t* dest, int8_t compare_value, cmpxchg_memory_order order) { // Note that cmpxchg guarantees a two-way memory barrier across // the cmpxchg, so it's really a a 'fence_cmpxchg_fence' if not // specified otherwise (see atomic.hpp). @@ -368,11 +340,11 @@ cmpxchg_post_membar(order); - return (jbyte)(unsigned char)old_value; + return (int8_t)(unsigned char)old_value; } -inline jint Atomic::cmpxchg(jint exchange_value, volatile jint* dest, jint compare_value, cmpxchg_memory_order order) { - +template <> +inline int32_t Atomic::specialized_cmpxchg(int32_t exchange_value, volatile int32_t* dest, int32_t compare_value, cmpxchg_memory_order order) { // Note that cmpxchg guarantees a two-way memory barrier across // the cmpxchg, so it's really a a 'fence_cmpxchg_fence' if not // specified otherwise (see atomic.hpp). @@ -412,11 +384,12 @@ cmpxchg_post_membar(order); - return (jint) old_value; + return (int32_t) old_value; } -inline jlong Atomic::cmpxchg(jlong exchange_value, volatile jlong* dest, jlong compare_value, cmpxchg_memory_order order) { +template <> +inline int64_t Atomic::specialized_cmpxchg(int64_t exchange_value, volatile int64_t* dest, int64_t compare_value, cmpxchg_memory_order order) { // Note that cmpxchg guarantees a two-way memory barrier across // the cmpxchg, so it's really a a 'fence_cmpxchg_fence' if not // specified otherwise (see atomic.hpp). @@ -456,16 +429,9 @@ cmpxchg_post_membar(order); - return (jlong) old_value; -} - -inline intptr_t Atomic::cmpxchg_ptr(intptr_t exchange_value, volatile intptr_t* dest, intptr_t compare_value, cmpxchg_memory_order order) { - return (intptr_t)cmpxchg((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value, order); + return (int64_t) old_value; } -inline void* Atomic::cmpxchg_ptr(void* exchange_value, volatile void* dest, void* compare_value, cmpxchg_memory_order order) { - return (void*)cmpxchg((jlong)exchange_value, (volatile jlong*)dest, (jlong)compare_value, order); -} #undef strasm_sync #undef strasm_lwsync