summaryrefslogtreecommitdiff
path: root/volk/tmpl
diff options
context:
space:
mode:
authorJosh Blum2012-04-16 00:29:26 -0700
committerJosh Blum2012-04-19 18:12:55 -0700
commit3af0f815ae3442dacdac78acf238b277f472c404 (patch)
tree88c237c7f036a1417399d654382bb6971d445164 /volk/tmpl
parent37f9a62fd45ece1e6a92769fbb1798403c86ba9b (diff)
downloadgnuradio-3af0f815ae3442dacdac78acf238b277f472c404.tar.gz
gnuradio-3af0f815ae3442dacdac78acf238b277f472c404.tar.bz2
gnuradio-3af0f815ae3442dacdac78acf238b277f472c404.zip
volk: added compile utils and cleanup cmakelists
Diffstat (limited to 'volk/tmpl')
-rw-r--r--volk/tmpl/volk_cpu.tmpl.c32
-rw-r--r--volk/tmpl/volk_machine_xxx.tmpl.c2
2 files changed, 19 insertions, 15 deletions
diff --git a/volk/tmpl/volk_cpu.tmpl.c b/volk/tmpl/volk_cpu.tmpl.c
index c278afc2e..7fe7036e2 100644
--- a/volk/tmpl/volk_cpu.tmpl.c
+++ b/volk/tmpl/volk_cpu.tmpl.c
@@ -25,23 +25,27 @@
struct VOLK_CPU volk_cpu;
#if defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_X64)
-# define VOLK_CPU_x86
+ #define VOLK_CPU_x86
#endif
#if defined(VOLK_CPU_x86)
-//implement get cpuid for gcc compilers using a copy of cpuid.h
+//implement get cpuid for gcc compilers using a system or local copy of cpuid.h
#if defined(__GNUC__)
-#include <gcc_x86_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)
+ #if defined(HAVE_CPUID_H)
+ #include <cpuid.h>
+ #else
+ #include "gcc_x86_cpuid.h"
+ #endif
+ #define cpuid_x86(op, r) __get_cpuid(op, (unsigned int *)r+0, (unsigned int *)r+1, (unsigned int *)r+2, (unsigned int *)r+3)
//implement get cpuid for MSVC compilers using __cpuid intrinsic
-#elif defined(_MSC_VER)
-#include <intrin.h>
-#define cpuid_x86(op, r) __cpuid(r, op)
+#elif defined(_MSC_VER) && defined(HAVE_INTRIN_H)
+ #include <intrin.h>
+ #define cpuid_x86(op, r) __cpuid(r, op)
#else
-#error "A get cpuid for volk is not available on this compiler..."
+ #error "A get cpuid for volk is not available on this compiler..."
#endif
static inline unsigned int cpuid_eax(unsigned int op) {
@@ -69,15 +73,16 @@ static inline unsigned int cpuid_edx(unsigned int op) {
}
#endif
+//neon detection is linux specific
#if defined(__arm__) && defined(__linux__)
-#include <asm/hwcap.h>
-#include <linux/auxvec.h>
-#include <stdio.h>
-#define LOOK_FOR_NEON
+ #include <asm/hwcap.h>
+ #include <linux/auxvec.h>
+ #include <stdio.h>
+ #define VOLK_CPU_ARM
#endif
static int has_neon(void){
-#if defined(LOOK_FOR_NEON)
+#if defined(VOLK_CPU_ARM)
FILE *auxvec_f;
unsigned long auxvec[2];
unsigned int found_neon = 0;
@@ -94,7 +99,6 @@ static int has_neon(void){
fclose(auxvec_f);
return found_neon;
-
#else
return 0;
#endif
diff --git a/volk/tmpl/volk_machine_xxx.tmpl.c b/volk/tmpl/volk_machine_xxx.tmpl.c
index 87204ee99..023eea502 100644
--- a/volk/tmpl/volk_machine_xxx.tmpl.c
+++ b/volk/tmpl/volk_machine_xxx.tmpl.c
@@ -20,7 +20,7 @@
*/
#set $this_machine = $machine_dict[$which]
-#set $arch_names = map(lambda a: a.name, $this_machine.archs)
+#set $arch_names = $this_machine.arch_names
#for $arch in $this_machine.archs
#define LV_HAVE_$(arch.name.upper()) 1