diff options
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 """ |