Refs #187. Use binary code for xgetbv, which is compatible with old compiler.

This commit is contained in:
Zhang Xianyi 2013-01-22 00:18:21 +08:00
parent 4db6660de4
commit 8cdb795438
2 changed files with 4 additions and 2 deletions

View File

@ -116,8 +116,9 @@ static inline int have_excpuid(void){
#ifndef NO_AVX #ifndef NO_AVX
static inline void xgetbv(int op, int * eax, int * edx){ static inline void xgetbv(int op, int * eax, int * edx){
//Use binary code for xgetbv
__asm__ __volatile__ __asm__ __volatile__
("xgetbv": "=a" (*eax), "=d" (*edx) : "c" (op) : "cc"); (".byte 0x0f, 0x01, 0xd0": "=a" (*eax), "=d" (*edx) : "c" (op) : "cc");
} }
#endif #endif

View File

@ -78,8 +78,9 @@ extern gotoblas_t gotoblas_SANDYBRIDGE;
#ifndef NO_AVX #ifndef NO_AVX
static inline void xgetbv(int op, int * eax, int * edx){ static inline void xgetbv(int op, int * eax, int * edx){
//Use binary code for xgetbv
__asm__ __volatile__ __asm__ __volatile__
("xgetbv": "=a" (*eax), "=d" (*edx) : "c" (op) : "cc"); (".byte 0x0f, 0x01, 0xd0": "=a" (*eax), "=d" (*edx) : "c" (op) : "cc");
} }
#endif #endif