diff options
author | Josh Blum <josh@joshknows.com> | 2012-04-16 18:39:29 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-04-19 18:13:22 -0700 |
commit | 0b117624e09643b7615316d3fa4741e2004529fa (patch) | |
tree | 8efe89c0ce8bb25819855d50ef569c65234e58ee /volk | |
parent | 5a3d372c027237dad1b1d8bc55c73f3217509b8f (diff) |
volk: move avx cpuid_x86_bit check in archs.xml
Diffstat (limited to 'volk')
-rw-r--r-- | volk/gen/archs.xml | 6 | ||||
-rw-r--r-- | volk/tmpl/volk_cpu.tmpl.c | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/volk/gen/archs.xml b/volk/gen/archs.xml index 134dfa2d97..ac4dd9f7f0 100644 --- a/volk/gen/archs.xml +++ b/volk/gen/archs.xml @@ -160,6 +160,12 @@ <param>0x00000001</param> <param>28</param> </check> + <!-- check to make sure that xgetbv is enabled in OS --> + <check name="cpuid_x86_bit"> + <param>2</param> + <param>0x00000001</param> + <param>27</param> + </check> <!-- check to see that the OS has enabled AVX --> <check name="get_avx_enabled"></check> <flag>mavx</flag> diff --git a/volk/tmpl/volk_cpu.tmpl.c b/volk/tmpl/volk_cpu.tmpl.c index 94895a76f3..e0a0e91ded 100644 --- a/volk/tmpl/volk_cpu.tmpl.c +++ b/volk/tmpl/volk_cpu.tmpl.c @@ -90,8 +90,6 @@ static inline unsigned int check_extended_cpuid(unsigned int val) { static inline unsigned int get_avx_enabled(void) { #if defined(VOLK_CPU_x86) - //check to make sure that xgetbv is enabled in OS - if(!cpuid_x86_bit(2, 1, 27)) return 0; return __xgetbv() & 0x6; #else return 0; |