From cf44382afe8bb40140dae3e5bc10a3162d287aee Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 9 Mar 2016 18:15:28 +0100 Subject: [PATCH] tmpl: cast windows regs to int* calling cpuidex Keeping track of VOLK's improvements. See https://github.com/gnuradio/volk/commit/b1b69e1ae35aff1c0e0758b4900617ea18138dbb --- .../volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c index 72cbd0f9a..ae08e89ee 100644 --- a/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c +++ b/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/tmpl/volk_gnsssdr_cpu.tmpl.c @@ -33,6 +33,7 @@ struct VOLK_CPU volk_gnsssdr_cpu; #if defined(__GNUC__) #include #define cpuid_x86(op, r) __get_cpuid(op, (unsigned int *)r+0, (unsigned int *)r+1, (unsigned int *)r+2, (unsigned int *)r+3) + #define cpuid_x86_count(op, count, regs) __cpuid_count(op, count, *((unsigned int*)regs), *((unsigned int*)regs+1), *((unsigned int*)regs+2), *((unsigned int*)regs+3)) /* Return Intel AVX extended CPU capabilities register. * This function will bomb on non-AVX-capable machines, so @@ -68,8 +69,8 @@ struct VOLK_CPU volk_gnsssdr_cpu; static inline unsigned int cpuid_count_x86_bit(unsigned int level, unsigned int count, unsigned int reg, unsigned int bit) { #if defined(VOLK_CPU_x86) - unsigned int regs[4]; - __cpuid_count(level, count, regs[0], regs[1], regs[2], regs[3]); + unsigned int regs[4] = {0}; + cpuid_x86_count(level, count, regs); return regs[reg] >> bit & 0x01; #else return 0;