mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-30 10:54:50 +00:00
tmpl: cast windows regs to int* calling cpuidex
Keeping track of VOLK's improvements. See
b1b69e1ae3
This commit is contained in:
parent
7d714c769f
commit
cf44382afe
@ -33,6 +33,7 @@ struct VOLK_CPU volk_gnsssdr_cpu;
|
|||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#include <cpuid.h>
|
#include <cpuid.h>
|
||||||
#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(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.
|
/* Return Intel AVX extended CPU capabilities register.
|
||||||
* This function will bomb on non-AVX-capable machines, so
|
* 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) {
|
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)
|
#if defined(VOLK_CPU_x86)
|
||||||
unsigned int regs[4];
|
unsigned int regs[4] = {0};
|
||||||
__cpuid_count(level, count, regs[0], regs[1], regs[2], regs[3]);
|
cpuid_x86_count(level, count, regs);
|
||||||
return regs[reg] >> bit & 0x01;
|
return regs[reg] >> bit & 0x01;
|
||||||
#else
|
#else
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user