equal
deleted
inserted
replaced
55 compiler_barrier(); |
55 compiler_barrier(); |
56 } |
56 } |
57 |
57 |
58 inline void OrderAccess::cross_modify_fence() { |
58 inline void OrderAccess::cross_modify_fence() { |
59 int idx = 0; |
59 int idx = 0; |
|
60 #ifdef AMD64 |
60 __asm__ volatile ("cpuid " : "+a" (idx) : : "ebx", "ecx", "edx", "memory"); |
61 __asm__ volatile ("cpuid " : "+a" (idx) : : "ebx", "ecx", "edx", "memory"); |
|
62 #else |
|
63 // On some x86 systems EBX is a reserved register that cannot be |
|
64 // clobbered, so we must protect it around the CPUID. |
|
65 __asm__ volatile ("xchg %%esi, %%ebx; cpuid; xchg %%esi, %%ebx " : "+a" (idx) : : "esi", "ecx", "edx", "memory"); |
|
66 #endif |
61 } |
67 } |
62 |
68 |
63 template<> |
69 template<> |
64 struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE> |
70 struct OrderAccess::PlatformOrderedStore<1, RELEASE_X_FENCE> |
65 { |
71 { |