diff options
author | Nick Foster | 2012-04-15 17:21:44 -0700 |
---|---|---|
committer | Johnathan Corgan | 2012-04-16 08:33:01 -0700 |
commit | 92db96430685e843443a00936328b3539354c83e (patch) | |
tree | f05285ca6e4d0d77a205ede742f1c76cb346fd3c /volk/gen | |
parent | c3f2c30a54c75575f464afdd7cd11a017fb07695 (diff) | |
download | gnuradio-92db96430685e843443a00936328b3539354c83e.tar.gz gnuradio-92db96430685e843443a00936328b3539354c83e.tar.bz2 gnuradio-92db96430685e843443a00936328b3539354c83e.zip |
Volk: also check to make sure OSXSAVE is enabled so you don't check XGETBV when OS has it disabled.
Diffstat (limited to 'volk/gen')
-rw-r--r-- | volk/gen/make_cpuid_c.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/volk/gen/make_cpuid_c.py b/volk/gen/make_cpuid_c.py index 4bd1ce5b1..c6bb5059e 100644 --- a/volk/gen/make_cpuid_c.py +++ b/volk/gen/make_cpuid_c.py @@ -73,6 +73,13 @@ static inline unsigned int cpuid_edx(unsigned int op) { cpuid_x86 (op, regs); return regs[3]; } + +static inline unsigned int xgetbv(void) { + //check to make sure that xgetbv is enabled in OS + int xgetbv_enabled = cpuid_ecx(1) >> 27 & 0x01; + if(xgetbv_enabled == 0) return 0; + return __xgetbv(); +} #endif """ |