equal
deleted
inserted
replaced
86 |
86 |
87 inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) { |
87 inline void* Atomic::xchg_ptr(void* exchange_value, volatile void* dest) { |
88 return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest); |
88 return (void*)xchg_ptr((intptr_t)exchange_value, (volatile intptr_t*)dest); |
89 } |
89 } |
90 |
90 |
|
91 #define VM_HAS_SPECIALIZED_CMPXCHG_BYTE |
|
92 inline jbyte Atomic::cmpxchg (jbyte exchange_value, volatile jbyte* dest, jbyte compare_value) { |
|
93 int mp = os::is_MP(); |
|
94 __asm__ volatile (LOCK_IF_MP(%4) "cmpxchgb %1,(%3)" |
|
95 : "=a" (exchange_value) |
|
96 : "q" (exchange_value), "a" (compare_value), "r" (dest), "r" (mp) |
|
97 : "cc", "memory"); |
|
98 return exchange_value; |
|
99 } |
91 |
100 |
92 inline jint Atomic::cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value) { |
101 inline jint Atomic::cmpxchg (jint exchange_value, volatile jint* dest, jint compare_value) { |
93 int mp = os::is_MP(); |
102 int mp = os::is_MP(); |
94 __asm__ volatile (LOCK_IF_MP(%4) "cmpxchgl %1,(%3)" |
103 __asm__ volatile (LOCK_IF_MP(%4) "cmpxchgl %1,(%3)" |
95 : "=a" (exchange_value) |
104 : "=a" (exchange_value) |