… | |
… | |
539 | #if ECB_NO_THREADS || ECB_NO_SMP |
539 | #if ECB_NO_THREADS || ECB_NO_SMP |
540 | #define ECB_MEMORY_FENCE do { } while (0) |
540 | #define ECB_MEMORY_FENCE do { } while (0) |
541 | #endif |
541 | #endif |
542 | |
542 | |
543 | #ifndef ECB_MEMORY_FENCE |
543 | #ifndef ECB_MEMORY_FENCE |
544 | #if ECB_GCC_VERSION(2,5) || defined(__INTEL_COMPILER) || defined(__clang__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110 |
544 | #if ECB_GCC_VERSION(2,5) || defined(__INTEL_COMPILER) || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110 |
545 | #if __i386 || __i386__ |
545 | #if __i386 || __i386__ |
546 | #define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory") |
546 | #define ECB_MEMORY_FENCE __asm__ __volatile__ ("lock; orb $0, -1(%%esp)" : : : "memory") |
547 | #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE /* non-lock xchg might be enough */ |
547 | #define ECB_MEMORY_FENCE_ACQUIRE ECB_MEMORY_FENCE /* non-lock xchg might be enough */ |
548 | #define ECB_MEMORY_FENCE_RELEASE do { } while (0) /* unlikely to change in future cpus */ |
548 | #define ECB_MEMORY_FENCE_RELEASE do { } while (0) /* unlikely to change in future cpus */ |
549 | #elif __amd64 || __amd64__ || __x86_64 || __x86_64__ |
549 | #elif __amd64 || __amd64__ || __x86_64 || __x86_64__ |