summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJukka Ojanen <jukka.ojanen@linkotec.net>2015-03-19 13:51:05 +0200
committerJukka Ojanen <jukka.ojanen@linkotec.net>2015-03-19 13:51:05 +0200
commit93a58ef7e0b973411bbed3e07750c7d1fc1e40d5 (patch)
tree5f599579ec805bce81cf7dcd16ac274062bf79ad
parent2014019a6760e712a019ba639e76aaa8729d8843 (diff)
downloadffts-93a58ef7e0b973411bbed3e07750c7d1fc1e40d5.zip
ffts-93a58ef7e0b973411bbed3e07750c7d1fc1e40d5.tar.gz
ffts_nd.c is using SSE2 intrinsics, detect and include emmintrin.h instead xmmintrin.h, and fix GCC error: inlining failed in call to always_inline '_mm_load_pd': target specific option mismatch by adding "-msse2" instead of "-msse"
-rw-r--r--CMakeLists.txt12
-rw-r--r--src/ffts_nd.c4
2 files changed, 12 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d83367e..5a1a897 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,6 +136,12 @@ if(NOT CMAKE_CROSSCOMPILING)
if(HAVE_XMMINTRIN_H)
add_definitions(-DHAVE_SSE)
endif(HAVE_XMMINTRIN_H)
+
+ # check if the platform has support for SSE2 SIMD extension
+ check_include_file(emmintrin.h HAVE_EMMINTRIN_H)
+ if(HAVE_EMMINTRIN_H)
+ add_definitions(-DHAVE_SSE2)
+ endif(HAVE_EMMINTRIN_H)
endif(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm")
else()
# Check if we can always use detection code above?
@@ -160,9 +166,11 @@ elseif(CMAKE_COMPILER_IS_GNUCC)
list(APPEND FFTS_EXTRA_LIBRARIES m)
endif(HAVE_LIBM)
- if(HAVE_XMMINTRIN_H)
+ if(HAVE_EMMINTRIN_H)
+ add_definitions(-msse2)
+ elseif(HAVE_XMMINTRIN_H)
add_definitions(-msse)
- endif(HAVE_XMMINTRIN_H)
+ endif(HAVE_EMMINTRIN_H)
endif(MSVC)
include_directories(include)
diff --git a/src/ffts_nd.c b/src/ffts_nd.c
index 839e35b..23338c1 100644
--- a/src/ffts_nd.c
+++ b/src/ffts_nd.c
@@ -37,8 +37,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef HAVE_NEON
#include "neon.h"
#include <arm_neon.h>
-#elif HAVE_SSE
-#include <xmmintrin.h>
+#elif HAVE_SSE2
+#include <emmintrin.h>
#endif
#define TSIZE 8
OpenPOWER on IntegriCloud