8226525: HotSpot compile-time error for x86-32

Reviewed-by: shade
This commit is contained in:
Andrew Haley 2019-07-02 16:54:52 +01:00
parent ebde73209f
commit 5f05ce78ec

@ -57,7 +57,13 @@ inline void OrderAccess::fence() {
inline void OrderAccess::cross_modify_fence() {
int idx = 0;
#ifdef AMD64
__asm__ volatile ("cpuid " : "+a" (idx) : : "ebx", "ecx", "edx", "memory");
#else
// On some x86 systems EBX is a reserved register that cannot be
// clobbered, so we must protect it around the CPUID.
__asm__ volatile ("xchg %%esi, %%ebx; cpuid; xchg %%esi, %%ebx " : "+a" (idx) : : "esi", "ecx", "edx", "memory");
#endif
}
template<>