Browse Source

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

tags/v0.2.6
Zhang Xianyi 13 years ago
parent
commit
8cdb795438
2 changed files with 4 additions and 2 deletions
  1. +2
    -1
      cpuid_x86.c
  2. +2
    -1
      driver/others/dynamic.c

+ 2
- 1
cpuid_x86.c View File

@@ -116,8 +116,9 @@ static inline int have_excpuid(void){

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



+ 2
- 1
driver/others/dynamic.c View File

@@ -78,8 +78,9 @@ extern gotoblas_t gotoblas_SANDYBRIDGE;

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



Loading…
Cancel
Save