X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fx86_cpu_features.c;h=786dce2b1b43c9264ff2f310ed77f119aea2733c;hb=21da2526eff64cdb8e3cb509d34af182d764c701;hp=aab200ffe5f2bb9b682592f8c4dee461234c2dbd;hpb=719a063c87e3abab99b0fb53ebc80223fbf33123;p=wimlib diff --git a/src/x86_cpu_features.c b/src/x86_cpu_features.c index aab200ff..786dce2b 100644 --- a/src/x86_cpu_features.c +++ b/src/x86_cpu_features.c @@ -10,6 +10,10 @@ * You can do whatever you want with this file. */ +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "wimlib/x86_cpu_features.h" #if defined(__i386__) || defined(__x86_64__) @@ -47,7 +51,9 @@ read_xcr(u32 index) { u32 edx, eax; - __asm__ ("xgetbv" : "=d" (edx), "=a" (eax) : "c" (index)); + /* Execute the "xgetbv" instruction. Old versions of binutils do not + * recognize this instruction, so list the raw bytes instead. */ + __asm__ (".byte 0x0f, 0x01, 0xd0" : "=d" (edx), "=a" (eax) : "c" (index)); return ((u64)edx << 32) | eax; }