From cf8b2a8ff57ff6d3fd4b78a897854cc9a6f49fe1 Mon Sep 17 00:00:00 2001
From: Josh Blum
Date: Tue, 17 Jul 2012 10:29:35 -0700
Subject: volk: fix for win64 MSVC not having MMX support
1) For the machine defs that will pass on windows,
generate a machine with mmx and without using mmx|
2) In the cmakelists, we overrule MMX arch on MSVC 64.
Also overrule redundant machines for when MMX does pass.
3) Set LV_HAVE_SSE && LV_HAVE_MMX for volk_16i_32fc_dot_prod_32fc_a.
Afterall, it is calling into MMX intrinsics as well.
---
volk/gen/machines.xml | 6 +++---
volk/include/volk/volk_16i_32fc_dot_prod_32fc_a.h | 4 ++--
volk/lib/CMakeLists.txt | 8 +++++++-
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/volk/gen/machines.xml b/volk/gen/machines.xml
index 8e3c9c8c2..d88a1a50c 100644
--- a/volk/gen/machines.xml
+++ b/volk/gen/machines.xml
@@ -10,7 +10,7 @@
-generic 32|64| mmx sse orc|
+generic 32|64| mmx| sse orc|
-->
@@ -20,7 +20,7 @@
-generic 32|64| mmx sse sse2 orc|
+generic 32|64| mmx| sse sse2 orc|
@@ -45,7 +45,7 @@
-generic 32|64| mmx sse sse2 sse3 ssse3 sse4_1 sse4_2 popcount avx orc|
+generic 32|64| mmx| sse sse2 sse3 ssse3 sse4_1 sse4_2 popcount avx orc|
diff --git a/volk/include/volk/volk_16i_32fc_dot_prod_32fc_a.h b/volk/include/volk/volk_16i_32fc_dot_prod_32fc_a.h
index 940aa5de7..1f6554af8 100644
--- a/volk/include/volk/volk_16i_32fc_dot_prod_32fc_a.h
+++ b/volk/include/volk/volk_16i_32fc_dot_prod_32fc_a.h
@@ -37,7 +37,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_a_generic(lv_32fc_t* result, cons
#endif /*LV_HAVE_GENERIC*/
-#ifdef LV_HAVE_SSE
+#if LV_HAVE_SSE && LV_HAVE_MMX
static inline void volk_16i_32fc_dot_prod_32fc_a_sse( lv_32fc_t* result, const short* input, const lv_32fc_t* taps, unsigned int num_points) {
@@ -116,7 +116,7 @@ static inline void volk_16i_32fc_dot_prod_32fc_a_sse( lv_32fc_t* result, const
*result = *(lv_32fc_t*)(&res[0]);
}
-#endif /*LV_HAVE_SSE*/
+#endif /*LV_HAVE_SSE && LV_HAVE_MMX*/
#endif /*INCLUDED_volk_16i_32fc_dot_prod_32fc_a_H*/
diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt
index 8288786c9..59d78b446 100644
--- a/volk/lib/CMakeLists.txt
+++ b/volk/lib/CMakeLists.txt
@@ -135,6 +135,12 @@ if(NOT CROSSCOMPILE_MULTILIB AND CPU_IS_x86)
if (${SIZEOF_CPU} EQUAL 32)
OVERRULE_ARCH(64 "CPU width is 32 bits")
endif()
+
+ #MSVC 64 bit does not have MMX, overrule it
+ if (${SIZEOF_CPU} EQUAL 64 AND MSVC)
+ OVERRULE_ARCH(mmx "No MMX for Win64")
+ endif()
+
endif()
########################################################################
@@ -159,7 +165,7 @@ execute_process(
# When this occurs, eliminate the redundant machines
# to avoid unnecessary compilation of subset machines.
########################################################################
-foreach(arch orc 64 32)
+foreach(arch mmx orc 64 32)
foreach(machine_name ${available_machines})
string(REPLACE "_${arch}" "" machine_name_no_arch ${machine_name})
if (${machine_name} STREQUAL ${machine_name_no_arch})
--
cgit