Change HAVE_SSE42 to HAVE_SSE4_2 add $(SIMD_FLAGS)
authorAndersBroman <anders.broman@ericsson.com>
Tue, 10 Jun 2014 12:47:09 +0000 (14:47 +0200)
committerAnders Broman <a.broman58@gmail.com>
Tue, 10 Jun 2014 14:51:26 +0000 (14:51 +0000)
Add autotools macros to distribution
Call AX_EXT to define HAVE_SSE4_2

Change-Id: I9ff085d923dfafb32510cdd14290e74a2aaea302
Reviewed-on: https://code.wireshark.org/review/2110
Tested-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Makefile.am
config.h.win32
configure.ac
wsutil/Makefile.am
wsutil/ws_mempbrk.c
wsutil/ws_mempbrk.h
wsutil/ws_mempbrk_sse42.c

index c6da3d1d3273b3937d0e0e27e37fcef4ffdf3a2c..5da8d50fd4840a91feeaacea7eab4ff4953745a7 100644 (file)
@@ -709,6 +709,10 @@ EXTRA_DIST = \
        aclocal-fallback/glib-2.0.m4 \
        aclocal-fallback/gtk-2.0.m4 \
        aclocal-fallback/gtk-3.0.m4 \
+       aclocal-fallback/ax_check_compile_flag.m4       \
+       aclocal-fallback/ax_gcc_x86_cpuid.m4    \
+       aclocal-fallback/ax_ext.m4      \
+       aclocal-fallback/ax_gcc_x86_avx_xgetbv.m4       \
        aclocal-flags           \
        adns_dll.dep            \
        adns_dll.rc             \
index 2b7249be0902f88abbf23fd1165378defa065e80..d0b370f225e0ce60ea8b2e8e781a886095cf2e50 100644 (file)
@@ -283,4 +283,4 @@ typedef int ssize_t;
 #endif
 
 /* to use define _ws_mempbrk_sse42 if available (checked with cpuinfo)  */
-#define HAVE_SSE42 1
\ No newline at end of file
+#define HAVE_SSE4_2 1
\ No newline at end of file
index d17b28f2107217250f64e08dbdd216b72bc68b5c..e5a806fe0b5c63aa5691f2daabd5e6396effed3f 100644 (file)
@@ -60,6 +60,12 @@ AC_PROG_CPP
 AC_PROG_MKDIR_P
 AC_WIRESHARK_CLANG_CHECK
 
+#   Find supported SIMD extensions by requesting cpuid. When an SIMD
+#   extension is found, the -m"simdextensionname" is added to SIMD_FLAGS
+#   (only if compilator support it) (ie : if "sse2" is available "-msse2" is
+#   added to SIMD_FLAGS)
+AX_EXT
+
 dnl Work around libtool bug (fixed in the version 1.5a?)
 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
 AC_LIBTOOL_DLOPEN
index 98273637f0614b4902ad065fb5159b76539f6f0e..868f9d79a8e0360ce525285658e0e478885179a8 100644 (file)
@@ -83,7 +83,7 @@ libwsutil_la_SOURCES =                \
 libwsutil_sse42_la_SOURCES = \
        ws_mempbrk_sse42.c
        
-libwsutil_sse42_la_CFLAGS = $(AM_CFLAGS) -msse4.2
+libwsutil_sse42_la_CFLAGS = $(AM_CFLAGS) $(SIMD_FLAGS)
 
 EXTRA_libwsutil_la_SOURCES=    \
        inet_aton.c             \
index c16716668913e7322f009dfad31fc2cca10da252..c24cedb404fb3edfb9c148ec11c8f36e096089a0 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <glib.h>
 #include "ws_symbol_export.h"
-#ifdef HAVE_SSE42
+#ifdef HAVE_SSE4_2
 #include "ws_cpuid.h"
 #endif
 #include "ws_mempbrk.h"
@@ -50,13 +50,13 @@ _ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles)
 WS_DLL_PUBLIC const guint8 *
 ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles)
 {
-#ifdef HAVE_SSE42
+#ifdef HAVE_SSE4_2
        static int have_sse42 = -1;
 #endif
        if (*needles == 0)
                return NULL;
 
-#ifdef HAVE_SSE42
+#ifdef HAVE_SSE4_2
        if G_UNLIKELY(have_sse42 < 0)
                have_sse42 = ws_cpuid_sse42();
 
index 5f515321fd7dce39cf9e59b5c5ade95bc2e07d93..72f37d574a31d2fad89fc186b20ebef80151e930 100644 (file)
@@ -26,7 +26,7 @@
 
 WS_DLL_PUBLIC const guint8 *ws_mempbrk(const guint8* haystack, size_t haystacklen, const guint8 *needles);
 
-#ifdef HAVE_SSE42
+#ifdef HAVE_SSE4_2
 const char *_ws_mempbrk_sse42(const char* haystack, size_t haystacklen, const char *needles);
 #endif
 
index ac9ecd281cf0d3a6dce0436ea40761ca301084aa..07c6504f5523d37e32936547f72f82ef2a409a3b 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "config.h"
 
-#ifdef HAVE_SSE42
+#ifdef HAVE_SSE4_2
 
 #include <glib.h>
 
@@ -191,7 +191,7 @@ _ws_mempbrk_sse42(const char *s, size_t slen, const char *a)
     return _ws_mempbrk(aligned, slen, a);
 }
 
-#endif /* HAVE_SSE42 */
+#endif /* HAVE_SSE4_2 */
 /*
  * Editor modelines
  *