atomic.h: unbreak build on Darwin PPC

This commit is contained in:
Sergey Fedorov 2023-04-12 01:37:48 +08:00 committed by barracuda156
parent 462080a92e
commit cd915900a2

View File

@ -303,7 +303,7 @@ static inline void mi_atomic_yield(void) {
} }
#elif (defined(__GNUC__) || defined(__clang__)) && \ #elif (defined(__GNUC__) || defined(__clang__)) && \
(defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__armel__) || defined(__ARMEL__) || \ (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || defined(__armel__) || defined(__ARMEL__) || \
defined(__aarch64__) || defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)) defined(__aarch64__) || defined(__powerpc__) || defined(__ppc__) || defined(__PPC__)) || defined(__POWERPC__)
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
static inline void mi_atomic_yield(void) { static inline void mi_atomic_yield(void) {
__asm__ volatile ("pause" ::: "memory"); __asm__ volatile ("pause" ::: "memory");
@ -316,10 +316,16 @@ static inline void mi_atomic_yield(void) {
static inline void mi_atomic_yield(void) { static inline void mi_atomic_yield(void) {
__asm__ volatile("yield" ::: "memory"); __asm__ volatile("yield" ::: "memory");
} }
#elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) #elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) || defined(__POWERPC__)
#ifdef __APPLE__
static inline void mi_atomic_yield(void) {
__asm__ volatile ("or r27,r27,r27" ::: "memory");
}
#else
static inline void mi_atomic_yield(void) { static inline void mi_atomic_yield(void) {
__asm__ __volatile__ ("or 27,27,27" ::: "memory"); __asm__ __volatile__ ("or 27,27,27" ::: "memory");
} }
#endif
#elif defined(__armel__) || defined(__ARMEL__) #elif defined(__armel__) || defined(__ARMEL__)
static inline void mi_atomic_yield(void) { static inline void mi_atomic_yield(void) {
__asm__ volatile ("nop" ::: "memory"); __asm__ volatile ("nop" ::: "memory");