Readme entry
configure --[enable/disable]-cpu-sse3
processor capability test
---
evas/README.in | 6 ++++
evas/configure.ac | 44 ++++++++++++++++++++++++++++++++
evas/src/lib/engines/common/evas_cpu.c | 21 +++++++++++++++
evas/src/lib/include/evas_blend_ops.h | 4 ++-
evas/src/lib/include/evas_common.h | 3 +-
evas/src/lib/include/evas_options.h | 7 +++-
6 files changed, 81 insertions(+), 4 deletions(-)
diff --git a/evas/README.in b/evas/README.in
index 36b2d95..8d27196 100644
--- a/evas/README.in
+++ b/evas/README.in
@@ -416,6 +416,12 @@ ALTIVEC asm routines yet. :) arm owners will also have to
rely on the c
fallback routines as i haven't managed to come up with any arm assembly that
actually can beat the c code (when compiled with all optimizations) in speed.
+--enable-cpu-sse3
+
+this enables sse3 optimizations available in the Intel Pentium4, Core, Xeon,
+and Atom processors, as well as the AMD Athlon64, Phenom, Opteron, and Turion
+processors.
+
--enable-cpu-neon
diff --git a/evas/configure.ac b/evas/configure.ac
index 4768bd6..20bb525 100644
--- a/evas/configure.ac
+++ b/evas/configure.ac
@@ -1220,6 +1220,49 @@ AC_ARG_ENABLE(cpu-sse,
)
#######################################
+## SSE3
+build_cpu_sse3="no"
+case $host_cpu in
+ i*86)
+ build_cpu_sse3="yes"
+ ;;
+ x86_64)
+ build_cpu_sse3="yes"
+ ;;
+ amd64)
+ build_cpu_sse3="yes"
+ ;;
+esac
+AC_MSG_CHECKING(whether to build sse3 code)
+AC_ARG_ENABLE(cpu-sse3,
+ AS_HELP_STRING([--enable-cpu-sse3],[enable sse3 code]),
+ [
+ if test "x$enableval" = "xyes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(BUILD_SSE3, 1, [Build SSE3 Code])
+ build_cpu_sse3="yes"
+ else
+ AC_MSG_RESULT(no)
+ build_cpu_sse3="no"
+ fi
+ ],
+ [
+ AC_MSG_RESULT($build_cpu_sse3)
+ if test "x$build_cpu_sse3" = "xyes" ; then
+ AC_DEFINE(BUILD_SSE3, 1, [Build SSE3 Code])
+ fi
+ ]
+)
+
+
+EVAS_SSE3_CFLAGS="-msse3 "
+if test "x$build_cpu_sse3" = "xyes" ; then
+ CFLAGS="${CFLAGS} ${EVAS_SSE3_CFLAGS}"
+fi
+
+AC_SUBST(CFLAGS)
+
+#######################################
## ALTIVEC
build_cpu_altivec="no"
case $host_cpu in
@@ -1883,6 +1926,7 @@ echo "CPU Specific Extensions:"
echo " Fallback C Code.........: $build_cpu_c"
echo " MMX.....................: $build_cpu_mmx"
echo " SSE.....................: $build_cpu_sse"
+echo " SSE3....................: $build_cpu_sse3"
echo " ALTIVEC.................: $build_cpu_altivec"
echo " NEON....................: $build_cpu_neon"
echo " Thread Support..........: $build_pthreads"
diff --git a/evas/src/lib/engines/common/evas_cpu.c
b/evas/src/lib/engines/common/evas_cpu.c
index f9aef68..919d8e7 100644
--- a/evas/src/lib/engines/common/evas_cpu.c
+++ b/evas/src/lib/engines/common/evas_cpu.c
@@ -3,6 +3,10 @@
#include "evas_mmx.h"
#endif
+#if defined BUILD_SSE3
+#include <immintrin.h>
+#endif
+
#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
#include <signal.h>
#include <setjmp.h>
@@ -61,6 +65,16 @@ evas_common_cpu_sse_test(void)
}
void
+evas_common_cpu_sse3_test(void)
+{
+#ifdef BUILD_SSE3
+ int data[4];
+
+ __m128i val = _mm_lddqu_si128((__m128i *)data);
+#endif
+}
+
+void
evas_common_cpu_altivec_test(void)
{
#ifdef __POWERPC__
@@ -154,6 +168,13 @@ evas_common_cpu_init(void)
evas_common_cpu_end_opt();
if (getenv("EVAS_CPU_NO_SSE"))
cpu_feature_mask &= ~CPU_FEATURE_SSE;
+#ifdef BUILD_SSE3
+ cpu_feature_mask |= CPU_FEATURE_SSE3 *
+ evas_common_cpu_feature_test(evas_common_cpu_sse3_test);
+ evas_common_cpu_end_opt();
+ if(getenv("EVAS_CPU_NO_SSE3"))
+ cpu_feature_mask &= ~CPU_FEATURE_SSE3;
+#endif /* BUILD_SSE3 */
#endif /* BUILD_SSE */
#endif /* BUILD_MMX */
#ifdef __POWERPC__
diff --git a/evas/src/lib/include/evas_blend_ops.h
b/evas/src/lib/include/evas_blend_ops.h
index 9627f87..9647800 100644
--- a/evas/src/lib/include/evas_blend_ops.h
+++ b/evas/src/lib/include/evas_blend_ops.h
@@ -67,8 +67,10 @@
#define CPU_SSE2 4
/* cpu flags count */
#define CPU_NEON 5
+/* CPU SSE3 */
+#define CPU_SSE3 6
/* cpu flags count */
-#define CPU_LAST 6
+#define CPU_LAST 7
/* some useful constants */
diff --git a/evas/src/lib/include/evas_common.h
b/evas/src/lib/include/evas_common.h
index 81a2785..e00398c 100644
--- a/evas/src/lib/include/evas_common.h
+++ b/evas/src/lib/include/evas_common.h
@@ -458,7 +458,8 @@ typedef enum _CPU_Features
CPU_FEATURE_ALTIVEC = (1 << 3),
CPU_FEATURE_VIS = (1 << 4),
CPU_FEATURE_VIS2 = (1 << 5),
- CPU_FEATURE_NEON = (1 << 6)
+ CPU_FEATURE_NEON = (1 << 6),
+ CPU_FEATURE_SSE3 = (1 << 7)
} CPU_Features;
typedef enum _Font_Hint_Flags
diff --git a/evas/src/lib/include/evas_options.h
b/evas/src/lib/include/evas_options.h
index a54291d..f6739c0 100644
--- a/evas/src/lib/include/evas_options.h
+++ b/evas/src/lib/include/evas_options.h
@@ -43,6 +43,7 @@
/*#define BUILD_MMX*/
/*#define BUILD_SSE*/
+/*#define BUILD_SSE3*/
/*#define BUILD_C*/
/*#define BUILD_LOADER_PNG*/
@@ -54,9 +55,11 @@
/* check in that the user configured it right */
#ifndef BUILD_MMX
-# ifndef BUILD_SSE
-# ifndef BUILD_C
+# ifndef BUILD_SSE3
+# ifndef BUILD_SSE
+# ifndef BUILD_C
# error "Please Read the README"
+ #endif
# endif
# endif
#endif
--
1.7.3.4
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel