AM_CONDITIONAL(USE_SSE, test $have_sse_intrinsics = yes)
+
+ dnl ===========================================================================
+ dnl Check for SSE2
+
+ SSE_CFLAGS="-mmmx -msse2 -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
+
+ have_sse2_intrinsics=no
+ AC_MSG_CHECKING(whether to use SSE2 intrinsics)
+ xserver_save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS -msse2 $MMX_CFLAGS"
+
+ AC_COMPILE_IFELSE([
+ #include <mmintrin.h>
+ #include <xmmintrin.h>
+ int main () {
+ __m128i a, b, c;
+ c = _mm_xor_si128 (a, b);
+ return 0;
+ }], have_sse2_intrinsics=yes)
+ CFLAGS=$xserver_save_CFLAGS
+ AC_MSG_RESULT($have_sse2_intrinsics)
+
+ if test $have_sse2_intrinsics = yes ; then
+ AC_DEFINE(USE_SSE2, 1, [use SSE compiler intrinsics])
+ fi
+
+ AM_CONDITIONAL(USE_SSE2, test $have_sse2_intrinsics = yes)
+
dnl ========================================================
AC_SUBST(MMX_CFLAGS)
+ AC_SUBST(SSE_CFLAGS)
+dnl Check for VMX/Altivec
+if test -n "`$CC -v 2>&1 | grep version | grep Apple`"; then
+ VMX_CFLAGS="-faltivec"
+else
+ VMX_CFLAGS="-maltivec -mabi=altivec"
+fi
+
+have_vmx_intrinsics=no
+AC_MSG_CHECKING(For VMX/Altivec intrinsics in the compiler)
+xserver_save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $VMX_CFLAGS"
+AC_COMPILE_IFELSE([
+#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
+#error "Need GCC >= 3.4 for sane altivec support"
+#endif
+#include <altivec.h>
+int main () {
+ vector unsigned int v = vec_splat_u32 (1);
+ v = vec_sub (v, v);
+ return 0;
+}], have_vmx_intrinsics=yes)
+CFLAGS=$xserver_save_CFLAGS
+AC_MSG_RESULT($have_vmx_intrinsics)
+
+if test $have_vmx_intrinsics = yes ; then
+ AC_DEFINE(USE_VMX, 1, [use VMX compiler intrinsics])
+else
+ VMX_CFLAGS=
+fi
+AC_SUBST(VMX_CFLAGS)
+
+AM_CONDITIONAL(USE_VMX, test $have_vmx_intrinsics = yes)
+
+dnl ===========================================================================
+
PKG_CHECK_MODULES(GTK, [gtk+-2.0], [HAVE_GTK=yes], [HAVE_GTK=no])
AM_CONDITIONAL(HAVE_GTK, [test "x$HAVE_GTK" = xyes])
libpixman_1_la_LIBADD += libpixman-mmx.la
endif
+# vmx code
+if USE_VMX
+noinst_LTLIBRARIES = libpixman-vmx.la
+libpixman_vmx_la_SOURCES = \
+ pixman-vmx.c \
+ pixman-vmx.h
+libpixman_vmx_la_CFLAGS = $(DEP_CFLAGS) $(VMX_CFLAGS)
+libpixman_vmx_la_LIBADD = $(DEP_LIBS)
+libpixman_1_la_LIBADD += libpixman-vmx.la
+endif
+ # sse2 code
+ if USE_SSE2
+ noinst_LTLIBRARIES = libpixman-sse.la
+ libpixman_sse_la_SOURCES = \
+ pixman-sse.c \
+ pixman-sse.h
+ libpixman_sse_la_CFLAGS = $(DEP_CFLAGS) $(SSE_CFLAGS)
+ libpixman_sse_la_LIBADD = $(DEP_LIBS)
+ libpixman_1_la_LIBADD += libpixman-sse.la
+ endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
+#include "pixman.h"
#include "pixman-private.h"
#include "pixman-mmx.h"
+#include "pixman-vmx.h"
+ #include "pixman-sse.h"
#define FbFullMask(n) ((n) == 32 ? (uint32_t)-1 : ((((uint32_t) 1) << n) - 1))
};
#endif
+ #ifdef USE_SSE2
+ static const FastPathInfo sse_fast_paths[] =
+ {
+ { PIXMAN_OP_NONE },
+ };
+ #endif
+
++#ifdef USE_VMX
++static const FastPathInfo vmx_fast_paths[] =
++{
++ { PIXMAN_OP_NONE },
++};
++#endif
++
++
static const FastPathInfo c_fast_paths[] =
{
{ PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_r5g6b5, fbCompositeSolidMask_nx8x0565, 0 },
uint16_t width,
uint16_t height)
{
- pixman_bool_t srcRepeat = pSrc->type == BITS && pSrc->common.repeat == PIXMAN_REPEAT_NORMAL;
- pixman_bool_t maskRepeat = FALSE;
- pixman_bool_t srcTransform = pSrc->common.transform != NULL;
- pixman_bool_t maskTransform = FALSE;
- pixman_bool_t srcAlphaMap = pSrc->common.alpha_map != NULL;
- pixman_bool_t maskAlphaMap = FALSE;
- pixman_bool_t dstAlphaMap = pDst->common.alpha_map != NULL;
- CompositeFunc func = NULL;
-
+ pixman_bool_t srcRepeat = pSrc->type == BITS && pSrc->common.repeat == PIXMAN_REPEAT_NORMAL;
+ pixman_bool_t maskRepeat = FALSE;
+ pixman_bool_t srcTransform = pSrc->common.transform != NULL;
+ pixman_bool_t maskTransform = FALSE;
+ pixman_bool_t srcAlphaMap = pSrc->common.alpha_map != NULL;
+ pixman_bool_t maskAlphaMap = FALSE;
+ pixman_bool_t dstAlphaMap = pDst->common.alpha_map != NULL;
+ CompositeFunc func = NULL;
+
+ #ifdef USE_SSE2
+ fbComposeSetupSSE();
+ #endif
+
#ifdef USE_MMX
- static pixman_bool_t mmx_setup = FALSE;
- if (!mmx_setup)
- {
- fbComposeSetupMMX();
- mmx_setup = TRUE;
- }
+ fbComposeSetupMMX();
#endif
- static pixman_bool_t vmx_setup = FALSE;
- if (!vmx_setup) {
- fbComposeSetupVMX();
- vmx_setup = TRUE;
- }
+
+#ifdef USE_VMX
++ fbComposeSetupVMX();
+#endif
+
if (srcRepeat && srcTransform &&
pSrc->bits.width == 1 &&
pSrc->bits.height == 1)
info = get_fast_path (mmx_fast_paths, op, pSrc, pMask, pDst, pixbuf);
if (!info)
#endif
++
++#ifdef USE_VMX
++
++ if (pixman_have_vmx())
++ info = get_fast_path (vmx_fast_paths, op, pSrc, pMask, pDst, pixbuf);
++ if (!info)
++#endif
++
info = get_fast_path (c_fast_paths, op, pSrc, pMask, pDst, pixbuf);
if (info)
NoFeatures = 0,
MMX = 0x1,
MMX_Extensions = 0x2,
++ VMX = 0x4,
SSE = 0x6,
SSE2 = 0x8,
CMOV = 0x10