diff options
author | Zhang Xianyi <xianyi@iscas.ac.cn> | 2012-10-09 14:52:35 +0800 |
---|---|---|
committer | Zhang Xianyi <xianyi@iscas.ac.cn> | 2012-10-09 14:52:35 +0800 |
commit | 6c5899dff5dc2e6f7fa6415046c1b99b4d6c0bbd (patch) | |
tree | c397b35f5ff39a5479407203dfe01b08030ad686 /cpuid_x86.c | |
parent | 0b719945c56bc2a25146706ff12542a0d6688d9b (diff) | |
download | openblas-6c5899dff5dc2e6f7fa6415046c1b99b4d6c0bbd.tar.gz openblas-6c5899dff5dc2e6f7fa6415046c1b99b4d6c0bbd.tar.bz2 openblas-6c5899dff5dc2e6f7fa6415046c1b99b4d6c0bbd.zip |
Don't use xgetbv instruction when NO_AVX=1
Diffstat (limited to 'cpuid_x86.c')
-rw-r--r-- | cpuid_x86.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cpuid_x86.c b/cpuid_x86.c index ebbbe3fff..6e4eae20d 100644 --- a/cpuid_x86.c +++ b/cpuid_x86.c @@ -114,12 +114,15 @@ static inline int have_excpuid(void){ return eax & 0xffff; } +#ifndef NO_AVX static inline void xgetbv(int op, int * eax, int * edx){ __asm__ __volatile__ ("xgetbv": "=a" (*eax), "=d" (*edx) : "c" (op) : "cc"); } +#endif int support_avx(){ +#ifndef NO_AVX int eax, ebx, ecx, edx; int ret=0; @@ -131,8 +134,12 @@ int support_avx(){ } } return ret; +#else + return 0; +#endif } + int get_vendor(void){ int eax, ebx, ecx, edx; char vendor[13]; |