diff --git a/ChangeLog b/ChangeLog index 5a0f2cda..26509c52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,6 @@ Changes in primecount-7.14, 2024-06-19 * int128_t.hpp: Rename namespace port to pstd (portable std namespace). -* cpuid.hpp: Prevent memory reordering. * Sieve.hpp: Tune AVX512 code. * multiarch_avx512_vpopcnt.cmake: Tune AVX512 code. diff --git a/include/cpuid.hpp b/include/cpuid.hpp index 87e85b13..92b81002 100644 --- a/include/cpuid.hpp +++ b/include/cpuid.hpp @@ -28,23 +28,19 @@ inline void run_cpuid(int eax, int ecx, int* abcd) #if defined(__i386__) && \ defined(__PIC__) /* in case of PIC under 32-bit EBX cannot be clobbered */ - __asm__ __volatile__ ( - "movl %%ebx, %%edi;" - "cpuid;" - "xchgl %%ebx, %%edi;" - : "=D" (ebx), - "+a" (eax), - "+c" (ecx), - "=d" (edx) - : "memory" - ); + __asm__ ("movl %%ebx, %%edi;" + "cpuid;" + "xchgl %%ebx, %%edi;" + : "=D" (ebx), + "+a" (eax), + "+c" (ecx), + "=d" (edx)); #else - __asm__ __volatile__ ( - "cpuid" - : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) - : "0" (eax), "2" (ecx) - : "memory" - ); + __asm__ ("cpuid;" + : "+b" (ebx), + "+a" (eax), + "+c" (ecx), + "=d" (edx)); #endif abcd[0] = eax;