summaryrefslogtreecommitdiff
path: root/lib/pixman
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2008-09-23 19:11:41 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2008-09-23 19:11:41 +0000
commit61c42f8ddcc41b05b5d28906533e3ca0b9aa1965 (patch)
tree2009f3d26880bf14c1b4e7953ee9b0cac8236df7 /lib/pixman
parentf0d06ca61c104601dbdd10a4e58ae54f8d3f5332 (diff)
pixman 0.12.0. Tested on a full ports build by naddy@.
Diffstat (limited to 'lib/pixman')
-rw-r--r--lib/pixman/Makefile.am17
-rw-r--r--lib/pixman/Makefile.bsd-wrapper8
-rw-r--r--lib/pixman/Makefile.in41
-rw-r--r--lib/pixman/TODO80
-rw-r--r--lib/pixman/aclocal.m4715
-rw-r--r--lib/pixman/config.h.in14
-rw-r--r--lib/pixman/configure2119
-rw-r--r--lib/pixman/configure.ac192
-rw-r--r--lib/pixman/ltmain.sh277
-rw-r--r--lib/pixman/pixman-1-uninstalled.pc.in11
-rw-r--r--lib/pixman/pixman/Makefile.am49
-rw-r--r--lib/pixman/pixman/Makefile.in322
-rw-r--r--lib/pixman/pixman/Makefile.win3285
-rw-r--r--lib/pixman/pixman/combine.h.inc227
-rw-r--r--lib/pixman/pixman/combine.inc (renamed from lib/pixman/pixman/pixman-combine.c)599
-rw-r--r--lib/pixman/pixman/combine.pl81
-rw-r--r--lib/pixman/pixman/pixman-access.c326
-rw-r--r--lib/pixman/pixman/pixman-compose.c249
-rw-r--r--lib/pixman/pixman/pixman-compute-region.c108
-rw-r--r--lib/pixman/pixman/pixman-edge.c2
-rw-r--r--lib/pixman/pixman/pixman-image.c195
-rw-r--r--lib/pixman/pixman/pixman-mmx.c128
-rw-r--r--lib/pixman/pixman/pixman-pict.c376
-rw-r--r--lib/pixman/pixman/pixman-private.h341
-rw-r--r--lib/pixman/pixman/pixman-region.c801
-rw-r--r--lib/pixman/pixman/pixman-region16.c83
-rw-r--r--lib/pixman/pixman/pixman-region32.c73
-rw-r--r--lib/pixman/pixman/pixman-source.c28
-rw-r--r--lib/pixman/pixman/pixman-sse.c51
-rw-r--r--lib/pixman/pixman/pixman-sse.h53
-rw-r--r--lib/pixman/pixman/pixman-sse2.c4726
-rw-r--r--lib/pixman/pixman/pixman-sse2.h358
-rw-r--r--lib/pixman/pixman/pixman-transformed.c227
-rw-r--r--lib/pixman/pixman/pixman-trap.c16
-rw-r--r--lib/pixman/pixman/pixman-utils.c28
-rw-r--r--lib/pixman/pixman/pixman-version.h50
-rw-r--r--lib/pixman/pixman/pixman-vmx.c1068
-rw-r--r--lib/pixman/pixman/pixman-vmx.h308
-rw-r--r--lib/pixman/pixman/pixman.h460
-rw-r--r--lib/pixman/test/Makefile.am8
-rw-r--r--lib/pixman/test/Makefile.in49
-rw-r--r--lib/pixman/test/clip-test.c159
-rw-r--r--lib/pixman/test/region-test.c23
43 files changed, 12055 insertions, 3076 deletions
diff --git a/lib/pixman/Makefile.am b/lib/pixman/Makefile.am
index 542603eec..2cf692d5f 100644
--- a/lib/pixman/Makefile.am
+++ b/lib/pixman/Makefile.am
@@ -10,6 +10,7 @@ snapshot:
test -d "$(srcdir)/.git" && distdir=$$distdir-`cd "$(srcdir)" && git-rev-parse HEAD | cut -c 1-6`; \
$(MAKE) $(AM_MAKEFLAGS) distdir="$$distdir" dist
+GPGKEY=6FF7C1A8
USERNAME=$$USER
RELEASE_OR_SNAPSHOT = $$(if test "x$(CAIRO_VERSION_MINOR)" = "x$$(echo "$(CAIRO_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; fi)
RELEASE_CAIRO_HOST = $(USERNAME)@cairographics.org
@@ -66,22 +67,24 @@ ensure-prev:
@if [[ "$(PREV)" == "" ]]; then \
echo "" && \
echo "You must set the PREV variable on the make command line to" && \
- echo "the git tag of the last release." && \
+ echo "the last version." && \
echo "" && \
echo "For example:" && \
- echo " make PREV=pixman-0.7.3" && \
+ echo " make PREV=0.7.3" && \
echo "" && \
false; \
fi
release-check: ensure-prev release-verify-newer release-remove-old distcheck
+release-tag:
+ git-tag -u $(GPGKEY) -m "$(PACKAGE) $(VERSION) release" $(PACKAGE)-$(VERSION)
+
release-upload: release-check $(tar_gz) $(tar_bz2) $(sha1_tgz) $(gpg_file)
mkdir -p releases
scp $(tar_gz) $(sha1_tgz) $(gpg_file) $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR)
scp $(tar_gz) $(tar_bz2) $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR)
ssh $(RELEASE_CAIRO_HOST) "rm -f $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_gz) $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
- git-tag -s -m "$(PACKAGE) $(VERSION) release" $(PACKAGE)-$(VERSION)
release-publish-message: $(sha1_tgz) $(md5_tgz) $(sha1_tbz2) $(md5_tbz2) ensure-prev
@echo "Please follow the instructions in RELEASING to push stuff out and"
@@ -111,17 +114,17 @@ release-publish-message: $(sha1_tgz) $(md5_tgz) $(sha1_tbz2) $(md5_tbz2) ensure-
@echo ""
@echo "GPG signature:"
@echo " $(RELEASE_CAIRO_URL)/$(gpg_file)"
- @echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)"
+ @echo " (signed by `git config --get user.name` <`git config --get user.email`>)"
@echo ""
@echo "Git:"
@echo " git://git.freedesktop.org/git/pixman"
@echo " tag: $(PACKAGE)-$(VERSION)"
@echo ""
@echo "Log:"
- @git-log --no-merges "$(PACKAGE)-$(PREV)".."$(PACKAGE)-$(VERSION)" | git shortlog | awk '{ printf "\t"; print ; }' | cut -b0-80
+ @git-log --no-merges "$(PACKAGE)-$(PREV)".."$(PACKAGE)-$(VERSION)" | git shortlog | awk '{ printf "\t"; print ; }' | cut -b1-80
@echo "============================== CUT HERE =============================="
@echo ""
-release-publish: release-upload release-publish-message
+release-publish: release-upload release-tag release-publish-message
-.PHONY: release-upload release-publish release-publish-message
+.PHONY: release-upload release-publish release-publish-message release-tag
diff --git a/lib/pixman/Makefile.bsd-wrapper b/lib/pixman/Makefile.bsd-wrapper
index a8d4aaa8a..1350a7be3 100644
--- a/lib/pixman/Makefile.bsd-wrapper
+++ b/lib/pixman/Makefile.bsd-wrapper
@@ -1,5 +1,9 @@
-# $OpenBSD: Makefile.bsd-wrapper,v 1.5 2008/04/08 19:00:25 matthieu Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.6 2008/09/23 19:11:40 matthieu Exp $
-SHARED_LIBS= pixman-1 11.0
+SHARED_LIBS= pixman-1 12.0
+
+.if ${MACHINE} == amd64
+CONFIGURE_ARGS += --disable-sse2
+.endif
.include <bsd.xorg.mk>
diff --git a/lib/pixman/Makefile.in b/lib/pixman/Makefile.in
index ddcae2103..7016a4800 100644
--- a/lib/pixman/Makefile.in
+++ b/lib/pixman/Makefile.in
@@ -38,9 +38,10 @@ build_triplet = @build@
host_triplet = @host@
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
- $(srcdir)/pixman-1.pc.in $(top_srcdir)/configure AUTHORS \
- COPYING ChangeLog INSTALL NEWS TODO compile config.guess \
- config.sub depcomp install-sh ltmain.sh missing
+ $(srcdir)/pixman-1-uninstalled.pc.in $(srcdir)/pixman-1.pc.in \
+ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+ TODO compile config.guess config.sub depcomp install-sh \
+ ltmain.sh missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -50,7 +51,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno configure.status.lineno
mkinstalldirs = $(SHELL) $(install_sh) -d
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = pixman-1.pc
+CONFIG_CLEAN_FILES = pixman-1.pc pixman-1-uninstalled.pc
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
@@ -105,6 +106,7 @@ DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEP_CFLAGS = @DEP_CFLAGS@
DEP_LIBS = @DEP_LIBS@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -130,6 +132,7 @@ LTLIBOBJS = @LTLIBOBJS@
LT_VERSION_INFO = @LT_VERSION_INFO@
MAKEINFO = @MAKEINFO@
MMX_CFLAGS = @MMX_CFLAGS@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -138,26 +141,31 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
PIXMAN_VERSION_MAJOR = @PIXMAN_VERSION_MAJOR@
PIXMAN_VERSION_MICRO = @PIXMAN_VERSION_MICRO@
PIXMAN_VERSION_MINOR = @PIXMAN_VERSION_MINOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-SSE_CFLAGS = @SSE_CFLAGS@
+SSE2_CFLAGS = @SSE2_CFLAGS@
STRIP = @STRIP@
USE_MMX_FALSE = @USE_MMX_FALSE@
USE_MMX_TRUE = @USE_MMX_TRUE@
USE_SSE2_FALSE = @USE_SSE2_FALSE@
USE_SSE2_TRUE = @USE_SSE2_TRUE@
-USE_SSE_FALSE = @USE_SSE_FALSE@
-USE_SSE_TRUE = @USE_SSE_TRUE@
+USE_VMX_FALSE = @USE_VMX_FALSE@
+USE_VMX_TRUE = @USE_VMX_TRUE@
VERSION = @VERSION@
+VMX_CFLAGS = @VMX_CFLAGS@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
@@ -201,6 +209,7 @@ target_alias = @target_alias@
SUBDIRS = pixman test
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pixman-1.pc
+GPGKEY = 6FF7C1A8
USERNAME = $$USER
RELEASE_OR_SNAPSHOT = $$(if test "x$(CAIRO_VERSION_MINOR)" = "x$$(echo "$(CAIRO_VERSION_MINOR)/2*2" | bc)" ; then echo release; else echo snapshot; fi)
RELEASE_CAIRO_HOST = $(USERNAME)@cairographics.org
@@ -273,6 +282,8 @@ distclean-hdr:
-rm -f config.h stamp-h1
pixman-1.pc: $(top_builddir)/config.status $(srcdir)/pixman-1.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
+pixman-1-uninstalled.pc: $(top_builddir)/config.status $(srcdir)/pixman-1-uninstalled.pc.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
mostlyclean-libtool:
-rm -f *.lo
@@ -719,22 +730,24 @@ ensure-prev:
@if [[ "$(PREV)" == "" ]]; then \
echo "" && \
echo "You must set the PREV variable on the make command line to" && \
- echo "the git tag of the last release." && \
+ echo "the last version." && \
echo "" && \
echo "For example:" && \
- echo " make PREV=pixman-0.7.3" && \
+ echo " make PREV=0.7.3" && \
echo "" && \
false; \
fi
release-check: ensure-prev release-verify-newer release-remove-old distcheck
+release-tag:
+ git-tag -u $(GPGKEY) -m "$(PACKAGE) $(VERSION) release" $(PACKAGE)-$(VERSION)
+
release-upload: release-check $(tar_gz) $(tar_bz2) $(sha1_tgz) $(gpg_file)
mkdir -p releases
scp $(tar_gz) $(sha1_tgz) $(gpg_file) $(RELEASE_CAIRO_HOST):$(RELEASE_CAIRO_DIR)
scp $(tar_gz) $(tar_bz2) $(RELEASE_XORG_HOST):$(RELEASE_XORG_DIR)
ssh $(RELEASE_CAIRO_HOST) "rm -f $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-[0-9]* && ln -s $(tar_gz) $(RELEASE_CAIRO_DIR)/LATEST-$(PACKAGE)-$(VERSION)"
- git-tag -s -m "$(PACKAGE) $(VERSION) release" $(PACKAGE)-$(VERSION)
release-publish-message: $(sha1_tgz) $(md5_tgz) $(sha1_tbz2) $(md5_tbz2) ensure-prev
@echo "Please follow the instructions in RELEASING to push stuff out and"
@@ -764,20 +777,20 @@ release-publish-message: $(sha1_tgz) $(md5_tgz) $(sha1_tbz2) $(md5_tbz2) ensure-
@echo ""
@echo "GPG signature:"
@echo " $(RELEASE_CAIRO_URL)/$(gpg_file)"
- @echo " (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)"
+ @echo " (signed by `git config --get user.name` <`git config --get user.email`>)"
@echo ""
@echo "Git:"
@echo " git://git.freedesktop.org/git/pixman"
@echo " tag: $(PACKAGE)-$(VERSION)"
@echo ""
@echo "Log:"
- @git-log --no-merges "$(PACKAGE)-$(PREV)".."$(PACKAGE)-$(VERSION)" | git shortlog | awk '{ printf "\t"; print ; }' | cut -b0-80
+ @git-log --no-merges "$(PACKAGE)-$(PREV)".."$(PACKAGE)-$(VERSION)" | git shortlog | awk '{ printf "\t"; print ; }' | cut -b1-80
@echo "============================== CUT HERE =============================="
@echo ""
-release-publish: release-upload release-publish-message
+release-publish: release-upload release-tag release-publish-message
-.PHONY: release-upload release-publish release-publish-message
+.PHONY: release-upload release-publish release-publish-message release-tag
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/lib/pixman/TODO b/lib/pixman/TODO
index 7ff58def8..47b9bc9d0 100644
--- a/lib/pixman/TODO
+++ b/lib/pixman/TODO
@@ -1,3 +1,11 @@
+ - SSE 2 issues:
+
+ - Use MM_HINT_NTA instead of MM_HINT_T0
+
+ - Use of fbCompositeOver_x888x8x8888sse2()
+
+ - Use pixmanFillsse2 and pixmanBltsse2
+
- Update the RLEASING file
- Things to keep in mind if breaking ABI:
@@ -19,7 +27,7 @@
(They only exist because they are theoretically available to
drivers).
- - Regions should become 32 bit
+ - 16 bit regions should be deleted
- There should only be one trap rasterization API.
@@ -27,9 +35,20 @@
to indicate the actual depth. That way PIXMAN_x4c4 and PIXMAN_c8
won't collide.
+ - Maybe bite the bullet and make configure.ac generate a pixman-types.h
+ file that can be included from pixman.h to avoid the #ifdef magic
+ in pixman.h
+
- Make pixman_region_point_in() survive a NULL box, then fix up
pixman-compose.c
+ - Possibly look into inlining the fetch functions
+
+ - There is a bug with source clipping demonstrated by clip-test in the
+ test directory. If we interprete source clipping as given in
+ destination coordinates, which is probably the only sane choice,
+ then the result should have two red bars down the sides.
+
- Test suite
- Add a general way of dealing with architecture specific
@@ -61,11 +80,6 @@
this, I suggest just using 32-bit datatypes by setting
IC_SHIFT to 5 for all machines.
- - Consider whether calling regions region16 is really such a great
- idea. Vlad wants 32 bit regions for Cairo. This will break X server
- ABI, but should otherwise be mostly harmless, though a
- pixman_region_get_boxes16() may be useful.
-
- Consider optimizing the 8/16 bit solid fills in pixman-util.c by
storing more than one value at a time.
@@ -79,6 +93,37 @@
(0, 0). Cairo would have to make sure that the delta *within* a
batch of trapezoids does not exceed 16 bit.
+ - Consider adding actual backends. Brain dump:
+
+ A backend is something that knows how to
+
+ - Create images
+ - Composite three images
+ - Rasterize trapezoids
+ - Do solid fills and blits
+
+ These operations are provided by a vtable that the backend will
+ create when it is initialized. Initial backends:
+
+ - VMX
+ - SSE2
+ - MMX
+ - Plain Old C
+
+ When the SIMD backends are initialized, they will be passed a
+ pointer to the Plain Old C backend that they can use for fallback
+ purposes.
+
+ Images would gain a vtable as well that would contain things like
+
+ - Read scanline
+ - Write scanline
+
+ (Or even read_patch/write_patch as suggested by Keith a while
+ back).
+
+ This could simplify the compositing code considerably.
+
- Review the pixman_format_code_t enum to make sure it will support
future formats. Some formats we will probably need:
@@ -130,8 +175,31 @@
What about color spaces such a linear vs. srGB etc.?
+
done:
+- Be consistent about calling sse2 sse2
+
+- Rename "SSE" to "MMX_EXTENSIONS". (Deleted mmx extensions).
+
+- Commented-out uses of fbCompositeCopyAreasse2()
+
+- Consider whether calling regions region16 is really such a great
+ idea. Vlad wants 32 bit regions for Cairo. This will break X server
+ ABI, but should otherwise be mostly harmless, though a
+ pixman_region_get_boxes16() may be useful.
+
+- Altivec signal issue (Company has fix, there is also a patch by
+ dwmw2 in rawhide).
+
+- Behdad's MMX issue - see list
+
+- SSE2 issues:
+ - Crashes in Mozilla because of unaligned stack. Possible fixes
+ - Make use of gcc 4.2 feature to align the stack
+ - Write some sort of trampoline that aligns the stack
+ before calling SSE functions.
+
- Get rid of the switch-of-doom; replace it with a big table
describing the various fast paths.
diff --git a/lib/pixman/aclocal.m4 b/lib/pixman/aclocal.m4
index bfbf5e1d9..b7278b304 100644
--- a/lib/pixman/aclocal.m4
+++ b/lib/pixman/aclocal.m4
@@ -13,7 +13,7 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-# serial 48 AC_PROG_LIBTOOL
+# serial 52 AC_PROG_LIBTOOL
# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
@@ -101,7 +101,6 @@ AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
AC_REQUIRE([AC_OBJEXT])dnl
AC_REQUIRE([AC_EXEEXT])dnl
dnl
-
AC_LIBTOOL_SYS_MAX_CMD_LEN
AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
AC_LIBTOOL_OBJDIR
@@ -176,7 +175,7 @@ test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
@@ -203,6 +202,8 @@ file_magic*)
;;
esac
+_LT_REQUIRED_DARWIN_CHECKS
+
AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
enable_win32_dll=yes, enable_win32_dll=no)
@@ -263,8 +264,9 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# Check for compiler boilerplate output or warnings with
# the simple compiler test code.
AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
@@ -276,13 +278,85 @@ $rm conftest*
# Check for linker boilerplate output or warnings with
# the simple link test code.
AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
])# _LT_LINKER_BOILERPLATE
+# _LT_REQUIRED_DARWIN_CHECKS
+# --------------------------
+# Check for some things on darwin
+AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS],[
+ case $host_os in
+ rhapsody* | darwin*)
+ AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+ AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+
+ AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+ [lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ echo "int foo(void){return 1;}" > conftest.c
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib ${wl}-single_module conftest.c
+ if test -f libconftest.dylib; then
+ lt_cv_apple_cc_single_mod=yes
+ rm -rf libconftest.dylib*
+ fi
+ rm conftest.c
+ fi])
+ AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+ [lt_cv_ld_exported_symbols_list],
+ [lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+ [lt_cv_ld_exported_symbols_list=yes],
+ [lt_cv_ld_exported_symbols_list=no])
+ LDFLAGS="$save_LDFLAGS"
+ ])
+ case $host_os in
+ rhapsody* | darwin1.[[0123]])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*)
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil="~$DSYMUTIL \$lib || :"
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+])
# _LT_AC_SYS_LIBPATH_AIX
# ----------------------
@@ -293,12 +367,20 @@ $rm conftest*
# If we don't find anything, use the default library path according
# to the aix ld manual.
AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi],[])
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
])# _LT_AC_SYS_LIBPATH_AIX
@@ -529,13 +611,17 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
@@ -552,6 +638,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
;;
*64-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
@@ -592,7 +681,11 @@ sparc*-*solaris*)
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
esac
;;
esac
@@ -623,7 +716,7 @@ AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
AC_CACHE_CHECK([$1], [$2],
[$2=no
ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$3"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -664,11 +757,12 @@ fi
# ------------------------------------------------------------
# Check whether the given compiler option works
AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
[$2=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $3"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -684,7 +778,7 @@ AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
$2=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
])
@@ -782,24 +876,27 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
fi
;;
*)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
= "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
;;
esac
])
@@ -952,7 +1049,7 @@ else
AC_CHECK_FUNC([shl_load],
[lt_cv_dlopen="shl_load"],
[AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
[AC_CHECK_FUNC([dlopen],
[lt_cv_dlopen="dlopen"],
[AC_CHECK_LIB([dl], [dlopen],
@@ -960,7 +1057,7 @@ else
[AC_CHECK_LIB([svld], [dlopen],
[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
[AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
])
])
])
@@ -1026,7 +1123,8 @@ fi
# ---------------------------------
# Check to see if options -c and -o are simultaneously supported by compiler
AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
[_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
[_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
@@ -1034,7 +1132,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -1174,6 +1272,7 @@ else
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
@@ -1191,7 +1290,8 @@ fi
# -----------------------------
# PORTME Fill in your ld.so characteristics
AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
library_names_spec=
libname_spec='lib$name'
soname_spec=
@@ -1205,20 +1305,58 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
+m4_if($1,[],[
if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+ if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`echo $lt_search_path_spec`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+fi])
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -1236,7 +1374,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[[4-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1375,12 +1513,8 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+ m4_if([$1], [],[
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -1397,18 +1531,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -1446,7 +1568,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -1509,7 +1631,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[[3-9]]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1564,7 +1686,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -1580,7 +1702,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -1593,18 +1715,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -1686,6 +1796,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -1781,6 +1895,13 @@ esac
AC_MSG_RESULT([$dynamic_linker])
test "$dynamic_linker" = no && can_build_shared=no
+AC_CACHE_VAL([lt_cv_sys_lib_search_path_spec],
+[lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"])
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+AC_CACHE_VAL([lt_cv_sys_lib_dlsearch_path_spec],
+[lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"])
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -1791,7 +1912,8 @@ fi
# _LT_AC_TAGCONFIG
# ----------------
AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_ARG_WITH([tags],
[AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
[include additional configurations @<:@automatic@:>@])],
[tagnames="$withval"])
@@ -2052,7 +2174,7 @@ m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
# AC_PATH_TOOL_PREFIX
# -------------------
-# find a file program which can recognise shared library
+# find a file program which can recognize shared library
AC_DEFUN([AC_PATH_TOOL_PREFIX],
[AC_REQUIRE([AC_PROG_EGREP])dnl
AC_MSG_CHECKING([for $1])
@@ -2115,7 +2237,7 @@ fi
# AC_PATH_MAGIC
# -------------
-# find a file program which can recognise a shared library
+# find a file program which can recognize a shared library
AC_DEFUN([AC_PATH_MAGIC],
[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -2262,7 +2384,7 @@ esac
# how to check for library dependencies
# -- PORTME fill in with the dynamic library characteristics
AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
+[AC_CACHE_CHECK([how to recognize dependent libraries],
lt_cv_deplibs_check_method,
[lt_cv_file_magic_cmd='$MAGIC_CMD'
lt_cv_file_magic_test_file=
@@ -2279,7 +2401,7 @@ lt_cv_deplibs_check_method='unknown'
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
-aix4* | aix5*)
+aix[[4-9]]*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2301,16 +2423,22 @@ cygwin*)
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu | dragonfly*)
+freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
@@ -2348,7 +2476,7 @@ hpux10.20* | hpux11*)
esac
;;
-interix3*)
+interix[[3-9]]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
;;
@@ -2364,7 +2492,7 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2398,6 +2526,10 @@ osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -2450,7 +2582,7 @@ AC_DEFUN([AC_PROG_NM],
lt_cv_path_NM="$NM"
else
lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
@@ -2666,10 +2798,10 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+lt_simple_link_test_code='int main(){return(0);}'
_LT_AC_SYS_COMPILER
@@ -2705,7 +2837,7 @@ aix3*)
fi
;;
-aix4* | aix5*)
+aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -2762,6 +2894,7 @@ _LT_AC_TAGVAR(postdep_objects, $1)=
_LT_AC_TAGVAR(predeps, $1)=
_LT_AC_TAGVAR(postdeps, $1)=
_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
# Source file extension for C++ test sources.
ac_ext=cpp
@@ -2771,10 +2904,10 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -2871,7 +3004,7 @@ case $host_os in
# FIXME: insert proper C++ library support
_LT_AC_TAGVAR(ld_shlibs, $1)=no
;;
- aix4* | aix5*)
+ aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -2884,7 +3017,7 @@ case $host_os in
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
*-brtl*)
@@ -2920,7 +3053,7 @@ case $host_os in
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ :
else
# We have old collect2
_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -3030,59 +3163,31 @@ case $host_os in
fi
;;
darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_automatic, $1)=yes
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ if test "$GXX" = yes ; then
output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -3116,7 +3221,7 @@ case $host_os in
freebsd-elf*)
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
_LT_AC_TAGVAR(ld_shlibs, $1)=yes
@@ -3165,9 +3270,7 @@ case $host_os in
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
- hppa*64*|ia64*)
- _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- ;;
+ hppa*64*|ia64*) ;;
*)
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
;;
@@ -3235,7 +3338,7 @@ case $host_os in
;;
esac
;;
- interix3*)
+ interix[[3-9]]*)
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
@@ -3275,7 +3378,7 @@ case $host_os in
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -3327,7 +3430,7 @@ case $host_os in
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
@@ -3355,6 +3458,29 @@ case $host_os in
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
esac
;;
lynxos*)
@@ -3399,9 +3525,9 @@ case $host_os in
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
output_verbose_link_cmd='echo'
else
@@ -3568,15 +3694,10 @@ case $host_os in
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
;;
esac
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
@@ -3623,6 +3744,12 @@ case $host_os in
fi
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
fi
;;
esac
@@ -3738,7 +3865,8 @@ lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
# compiler output when linking a shared library.
# Parse the compiler output and extract the necessary
# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
dnl we can't use the lt_simple_compile_test_code here,
dnl because it contains code intended for an executable,
dnl not a library. It's possible we should let each
@@ -3863,10 +3991,15 @@ fi
$rm -f confest.$objext
+_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_AC_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
# PORTME: override above test on systems where it is broken
ifelse([$1],[CXX],
[case $host_os in
-interix3*)
+interix[[3-9]]*)
# Interix 3.5 installs completely hosed .la files for C++, so rather than
# hack all around it, let's just trust "g++" to DTRT.
_LT_AC_TAGVAR(predep_objects,$1)=
@@ -3874,19 +4007,51 @@ interix3*)
_LT_AC_TAGVAR(postdeps,$1)=
;;
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ #
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
solaris*)
case $cc_basename in
CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
- _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+ if test "$solaris_use_stlport4" != yes; then
+ _LT_AC_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+ fi
;;
esac
;;
esac
])
-
case " $_LT_AC_TAGVAR(postdeps, $1) " in
*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
esac
@@ -3929,10 +4094,17 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
+lt_simple_link_test_code="\
+ program t
+ end
+"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -3964,7 +4136,7 @@ aix3*)
postinstall_cmds='$RANLIB $lib'
fi
;;
-aix4* | aix5*)
+aix[[4-9]]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -4011,10 +4183,10 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
+lt_simple_compile_test_code="class foo {}"
# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_AC_SYS_COMPILER
@@ -4067,7 +4239,7 @@ objext=o
_LT_AC_TAGVAR(objext, $1)=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
# Code to be used in simple link tests
lt_simple_link_test_code="$lt_simple_compile_test_code"
@@ -4141,6 +4313,7 @@ if test -f "$ltmain"; then
_LT_AC_TAGVAR(predeps, $1) \
_LT_AC_TAGVAR(postdeps, $1) \
_LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_dirs, $1) \
_LT_AC_TAGVAR(archive_cmds, $1) \
_LT_AC_TAGVAR(archive_expsym_cmds, $1) \
_LT_AC_TAGVAR(postinstall_cmds, $1) \
@@ -4156,6 +4329,7 @@ if test -f "$ltmain"; then
_LT_AC_TAGVAR(module_cmds, $1) \
_LT_AC_TAGVAR(module_expsym_cmds, $1) \
_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(fix_srcfile_path, $1) \
_LT_AC_TAGVAR(exclude_expsyms, $1) \
_LT_AC_TAGVAR(include_expsyms, $1); do
@@ -4202,7 +4376,7 @@ ifelse([$1], [],
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
#
# This file is part of GNU Libtool:
@@ -4439,6 +4613,10 @@ predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
# shared library.
postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_dirs, $1)
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
@@ -4527,7 +4705,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
@@ -4610,6 +4788,7 @@ fi
# ---------------------------------
AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([LT_AC_PROG_SED])
AC_REQUIRE([AC_PROG_NM])
AC_REQUIRE([AC_OBJEXT])
# Check for command to grab the raw symbol name followed by C symbol from nm.
@@ -4646,7 +4825,7 @@ hpux*) # Its linker distinguishes data from code symbols
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
-linux*)
+linux* | k*bsd*-gnu)
if test "$host_cpu" = ia64; then
symcode='[[ABCDGIRSTW]]'
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
@@ -4787,7 +4966,7 @@ EOF
echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
cat conftest.$ac_ext >&5
fi
- rm -f conftest* conftst*
+ rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -4836,13 +5015,16 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# like `-m68040'.
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | os2* | pw32*)
+ mingw* | cygwin* | os2* | pw32*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
# PIC is the default on this platform
@@ -4853,7 +5035,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# DJGPP does not support shared libraries at all
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
;;
- interix3*)
+ interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -4879,7 +5061,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
esac
else
case $host_os in
- aix4* | aix5*)
+ aix[[4-9]]*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
@@ -4919,7 +5101,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;;
esac
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -4962,7 +5144,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
;;
esac
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -4975,7 +5157,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler.
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
@@ -4989,6 +5171,14 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ esac
;;
esac
;;
@@ -5109,14 +5299,17 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
darwin* | rhapsody*)
@@ -5125,7 +5318,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
;;
- interix3*)
+ interix[[3-9]]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -5183,10 +5376,11 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ m4_if([$1], [GCJ], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
;;
hpux9* | hpux10* | hpux11*)
@@ -5216,7 +5410,7 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
@@ -5235,6 +5429,22 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
# All Alpha code is PIC.
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -5244,6 +5454,10 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
;;
+ rdos*)
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
solaris*)
_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
@@ -5303,7 +5517,7 @@ AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
#
if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
- _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_pic_works, $1),
[$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
[case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
"" | " "*) ;;
@@ -5327,7 +5541,7 @@ esac
#
wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_static_works, $1),
$lt_tmp_static_flag,
[],
[_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
@@ -5338,11 +5552,12 @@ AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
# ------------------------------------
# See if the linker supports building shared libraries.
AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+[AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
ifelse([$1],[CXX],[
_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
- aix4* | aix5*)
+ aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
@@ -5355,12 +5570,13 @@ ifelse([$1],[CXX],[
_LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
;;
cygwin* | mingw*)
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
;;
*)
_LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
+ _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
],[
runpath_var=
_LT_AC_TAGVAR(allow_undefined_flag, $1)=
@@ -5391,12 +5607,14 @@ ifelse([$1],[CXX],[
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ _LT_AC_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
_LT_CC_BASENAME([$compiler])
@@ -5446,7 +5664,7 @@ ifelse([$1],[CXX],[
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[[3-9]]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -5494,7 +5712,7 @@ EOF
_LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_AC_TAGVAR(always_export_symbols, $1)=no
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -5512,7 +5730,7 @@ EOF
fi
;;
- interix3*)
+ interix[[3-9]]*)
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
@@ -5527,7 +5745,7 @@ EOF
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -5545,13 +5763,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
_LT_AC_TAGVAR(ld_shlibs, $1)=no
@@ -5591,7 +5818,7 @@ EOF
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
_LT_AC_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
@@ -5656,7 +5883,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[[4-9]]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -5676,7 +5903,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -5710,7 +5937,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ :
else
# We have old collect2
_LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
@@ -5803,7 +6030,7 @@ _LT_EOF
# The linker will automatically build a .lib file if we build a DLL.
_LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
# FIXME: Should let the user specify the lib program.
- _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
_LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
@@ -5836,19 +6063,18 @@ _LT_EOF
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
_LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
_LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -5888,7 +6114,7 @@ _LT_EOF
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_AC_TAGVAR(hardcode_direct, $1)=yes
@@ -6011,15 +6237,15 @@ _LT_EOF
openbsd*)
if test -f /usr/libexec/ld.so; then
- _LT_AC_TAGVAR(hardcode_direct, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
@@ -6028,10 +6254,10 @@ _LT_EOF
_LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
fi
;;
@@ -6090,17 +6316,16 @@ _LT_EOF
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
- *)
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
;;
@@ -6157,7 +6382,7 @@ _LT_EOF
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
_LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6232,7 +6457,7 @@ x|xyes)
# to ld, don't add -lc before -lgcc.
AC_MSG_CHECKING([whether -lc should be explicitly linked in])
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
soname=conftest
@@ -6335,6 +6560,30 @@ AC_DEFUN([LT_AC_PROG_RC],
[AC_CHECK_TOOL(RC, windres, no)
])
+
+# Cheap backport of AS_EXECUTABLE_P and required macros
+# from Autoconf 2.59; we should not use $as_executable_p directly.
+
+# _AS_TEST_PREPARE
+# ----------------
+m4_ifndef([_AS_TEST_PREPARE],
+[m4_defun([_AS_TEST_PREPARE],
+[if test -x / >/dev/null 2>&1; then
+ as_executable_p='test -x'
+else
+ as_executable_p='test -f'
+fi
+])])# _AS_TEST_PREPARE
+
+# AS_EXECUTABLE_P
+# ---------------
+# Check whether a file is executable.
+m4_ifndef([AS_EXECUTABLE_P],
+[m4_defun([AS_EXECUTABLE_P],
+[AS_REQUIRE([_AS_TEST_PREPARE])dnl
+$as_executable_p $1[]dnl
+])])# AS_EXECUTABLE_P
+
# NOTE: This macro has been submitted for inclusion into #
# GNU Autoconf as AC_PROG_SED. When it is available in #
# a released version of Autoconf we should remove this #
@@ -6355,12 +6604,13 @@ do
test -z "$as_dir" && as_dir=.
for lt_ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ if AS_EXECUTABLE_P(["$as_dir/$lt_ac_prog$ac_exec_ext"]); then
lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
fi
done
done
done
+IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -6393,6 +6643,7 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
done
])
SED=$lt_cv_path_SED
+AC_SUBST([SED])
AC_MSG_RESULT([$SED])
])
diff --git a/lib/pixman/config.h.in b/lib/pixman/config.h.in
index cdcf61ba3..64de572be 100644
--- a/lib/pixman/config.h.in
+++ b/lib/pixman/config.h.in
@@ -57,15 +57,21 @@
/* use MMX compiler intrinsics */
#undef USE_MMX
-/* use SSE compiler intrinsics */
-#undef USE_SSE
-
-/* use SSE compiler intrinsics */
+/* use SSE2 compiler intrinsics */
#undef USE_SSE2
+/* use VMX compiler intrinsics */
+#undef USE_VMX
+
/* Version number of package */
#undef VERSION
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#undef inline
+#endif
diff --git a/lib/pixman/configure b/lib/pixman/configure
index 1535e84a0..462a1934c 100644
--- a/lib/pixman/configure
+++ b/lib/pixman/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for pixman 0.10.0.
+# Generated by GNU Autoconf 2.59 for pixman 0.12.0.
#
# Report bugs to <"sandmann@daimi.au.dk">.
#
@@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='pixman'
PACKAGE_TARNAME='pixman'
-PACKAGE_VERSION='0.10.0'
-PACKAGE_STRING='pixman 0.10.0'
+PACKAGE_VERSION='0.12.0'
+PACKAGE_STRING='pixman 0.12.0'
PACKAGE_BUGREPORT='"sandmann@daimi.au.dk"'
# Factoring default headers for most tests.
@@ -464,7 +464,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PIXMAN_VERSION_MAJOR PIXMAN_VERSION_MINOR PIXMAN_VERSION_MICRO LT_VERSION_INFO USE_MMX_TRUE USE_MMX_FALSE USE_SSE_TRUE USE_SSE_FALSE USE_SSE2_TRUE USE_SSE2_FALSE MMX_CFLAGS SSE_CFLAGS PKG_CONFIG ac_pt_PKG_CONFIG GTK_CFLAGS GTK_LIBS HAVE_GTK_TRUE HAVE_GTK_FALSE DEP_CFLAGS DEP_LIBS LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PIXMAN_VERSION_MAJOR PIXMAN_VERSION_MINOR PIXMAN_VERSION_MICRO LT_VERSION_INFO PERL USE_MMX_TRUE USE_MMX_FALSE USE_SSE2_TRUE USE_SSE2_FALSE MMX_CFLAGS SSE2_CFLAGS VMX_CFLAGS USE_VMX_TRUE USE_VMX_FALSE PKG_CONFIG ac_pt_PKG_CONFIG GTK_CFLAGS GTK_LIBS HAVE_GTK_TRUE HAVE_GTK_FALSE DEP_CFLAGS DEP_LIBS LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -965,7 +965,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures pixman 0.10.0 to adapt to many kinds of systems.
+\`configure' configures pixman 0.12.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1031,7 +1031,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pixman 0.10.0:";;
+ short | recursive ) echo "Configuration of pixman 0.12.0:";;
esac
cat <<\_ACEOF
@@ -1047,6 +1047,10 @@ Optional Features:
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
+ --disable-mmx disable MMX fast paths
+ --disable-sse2 disable SSE2 fast paths
+ --disable-vmx disable VMX fast paths
+ --enable-gtk enable tests using GTK+ [default=auto]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -1173,7 +1177,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-pixman configure 0.10.0
+pixman configure 0.12.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@@ -1187,7 +1191,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pixman $as_me 0.10.0, which was
+It was created by pixman $as_me 0.12.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@@ -1785,7 +1789,7 @@ fi
# Define the identity of the package.
PACKAGE='pixman'
- VERSION='0.10.0'
+ VERSION='0.12.0'
cat >>confdefs.h <<_ACEOF
@@ -3169,6 +3173,7 @@ do
done
done
done
+IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -3203,6 +3208,7 @@ done
fi
SED=$lt_cv_path_SED
+
echo "$as_me:$LINENO: result: $SED" >&5
echo "${ECHO_T}$SED" >&6
@@ -3417,8 +3423,8 @@ else
echo "${ECHO_T}no, using $LN_S" >&6
fi
-echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
-echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6
if test "${lt_cv_deplibs_check_method+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3437,7 +3443,7 @@ lt_cv_deplibs_check_method='unknown'
# whether `pass_all' will *always* work, you probably want this one.
case $host_os in
-aix4* | aix5*)
+aix[4-9]*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3459,16 +3465,22 @@ cygwin*)
mingw* | pw32*)
# Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump'.
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
+ # func_win32_libid shell function, so use a weaker test based on 'objdump',
+ # unless we find 'file', for example because we are cross-compiling.
+ if ( file / ) >/dev/null 2>&1; then
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ else
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ fi
;;
darwin* | rhapsody*)
lt_cv_deplibs_check_method=pass_all
;;
-freebsd* | kfreebsd*-gnu | dragonfly*)
+freebsd* | dragonfly*)
if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
case $host_cpu in
i*86 )
@@ -3506,7 +3518,7 @@ hpux10.20* | hpux11*)
esac
;;
-interix3*)
+interix[3-9]*)
# PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
;;
@@ -3522,7 +3534,7 @@ irix5* | irix6* | nonstopux*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3556,6 +3568,10 @@ osf3* | osf4* | osf5*)
lt_cv_deplibs_check_method=pass_all
;;
+rdos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
solaris*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3643,7 +3659,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 3646 "configure"' > conftest.$ac_ext
+ echo '#line 3662 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -3678,7 +3694,8 @@ ia64-*-hpux*)
rm -rf conftest*
;;
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -3689,6 +3706,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
case `/usr/bin/file conftest.o` in
*32-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_i386_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_i386"
;;
@@ -3705,6 +3725,9 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
;;
*64-bit*)
case $host in
+ x86_64-*kfreebsd*-gnu)
+ LD="${LD-ld} -m elf_x86_64_fbsd"
+ ;;
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
@@ -3811,7 +3834,11 @@ sparc*-*solaris*)
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *) LD="${LD-ld} -64" ;;
+ *)
+ if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+ LD="${LD-ld} -64"
+ fi
+ ;;
esac
;;
esac
@@ -5242,7 +5269,7 @@ fi
# Provide some information about the compiler.
-echo "$as_me:5245:" \
+echo "$as_me:5272:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -5389,7 +5416,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-
# find the maximum length of command line arguments
echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
@@ -5476,24 +5502,27 @@ else
fi
;;
*)
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+ lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+ if test -n "$lt_cv_sys_max_cmd_len"; then
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ else
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
= "XX$teststring") >/dev/null 2>&1 &&
- new_result=`expr "X$teststring" : ".*" 2>&1` &&
- lt_cv_sys_max_cmd_len=$new_result &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- teststring=
- # Add a significant safety factor because C++ compilers can tack on massive
- # amounts of additional arguments before passing them to the linker.
- # It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ fi
;;
esac
@@ -5510,6 +5539,7 @@ fi
+
# Check for command to grab the raw symbol name followed by C symbol from nm.
echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
@@ -5547,7 +5577,7 @@ hpux*) # Its linker distinguishes data from code symbols
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
-linux*)
+linux* | k*bsd*-gnu)
if test "$host_cpu" = ia64; then
symcode='[ABCDGIRSTW]'
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
@@ -5700,7 +5730,7 @@ EOF
echo "$progname: failed program was:" >&5
cat conftest.$ac_ext >&5
fi
- rm -f conftest* conftst*
+ rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
if test "$pipe_works" = yes; then
@@ -6050,7 +6080,7 @@ test -z "$STRIP" && STRIP=:
test -z "$ac_objext" && ac_objext=o
# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
old_postinstall_cmds='chmod 644 $oldlib'
old_postuninstall_cmds=
@@ -6212,6 +6242,289 @@ fi
;;
esac
+
+ case $host_os in
+ rhapsody* | darwin*)
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DSYMUTIL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$DSYMUTIL"; then
+ ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+ echo "$as_me:$LINENO: result: $DSYMUTIL" >&5
+echo "${ECHO_T}$DSYMUTIL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+ ac_ct_DSYMUTIL=$DSYMUTIL
+ # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_DSYMUTIL"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_DSYMUTIL" && ac_cv_prog_ac_ct_DSYMUTIL=":"
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+ echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5
+echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ DSYMUTIL=$ac_ct_DSYMUTIL
+else
+ DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_NMEDIT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$NMEDIT"; then
+ ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+ echo "$as_me:$LINENO: result: $NMEDIT" >&5
+echo "${ECHO_T}$NMEDIT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+ ac_ct_NMEDIT=$NMEDIT
+ # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_NMEDIT"; then
+ ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_NMEDIT="nmedit"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_NMEDIT" && ac_cv_prog_ac_ct_NMEDIT=":"
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+ echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5
+echo "${ECHO_T}$ac_ct_NMEDIT" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ NMEDIT=$ac_ct_NMEDIT
+else
+ NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+
+ echo "$as_me:$LINENO: checking for -single_module linker flag" >&5
+echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6
+if test "${lt_cv_apple_cc_single_mod+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_apple_cc_single_mod=no
+ if test -z "${LT_MULTI_MODULE}"; then
+ # By default we will add the -single_module flag. You can override
+ # by either setting the environment variable LT_MULTI_MODULE
+ # non-empty at configure time, or by adding -multi_module to the
+ # link flags.
+ echo "int foo(void){return 1;}" > conftest.c
+ $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+ -dynamiclib ${wl}-single_module conftest.c
+ if test -f libconftest.dylib; then
+ lt_cv_apple_cc_single_mod=yes
+ rm -rf libconftest.dylib*
+ fi
+ rm conftest.c
+ fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5
+echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6
+ echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5
+echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6
+if test "${lt_cv_ld_exported_symbols_list+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_ld_exported_symbols_list=no
+ save_LDFLAGS=$LDFLAGS
+ echo "_main" > conftest.sym
+ LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_ld_exported_symbols_list=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_ld_exported_symbols_list=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5
+echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6
+ case $host_os in
+ rhapsody* | darwin1.[0123])
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ darwin1.*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ darwin*)
+ # if running on 10.5 or later, the deployment target defaults
+ # to the OS version, if on x86, and 10.4, the deployment
+ # target defaults to 10.4. Don't you love it?
+ case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+ 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ 10.[012]*)
+ _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ 10.*)
+ _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ esac
+ ;;
+ esac
+ if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ _lt_dar_single_mod='$single_module'
+ fi
+ if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+ _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ else
+ _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}"
+ fi
+ if test "$DSYMUTIL" != ":"; then
+ _lt_dsymutil="~$DSYMUTIL \$lib || :"
+ else
+ _lt_dsymutil=
+ fi
+ ;;
+ esac
+
+
enable_dlopen=no
enable_win32_dll=no
@@ -6250,10 +6563,10 @@ objext=o
objext=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+lt_simple_link_test_code='int main(){return(0);}'
# If no C compiler was specified, use CC.
@@ -6268,16 +6581,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
@@ -6294,7 +6607,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
else
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -6305,11 +6618,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6308: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6621: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6312: \$? = $ac_status" >&5
+ echo "$as_me:6625: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -6360,13 +6673,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic='-DDLL_EXPORT'
;;
@@ -6376,7 +6691,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic='-fno-common'
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -6434,7 +6749,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
@@ -6467,7 +6782,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl='-Wl,'
@@ -6486,6 +6801,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# All Alpha code is PIC.
lt_prog_compiler_static='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -6495,6 +6826,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
@@ -6557,12 +6892,12 @@ if test -n "$lt_prog_compiler_pic"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works=no
+ lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -6573,27 +6908,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6576: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6911: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6580: \$? = $ac_status" >&5
+ echo "$as_me:6915: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works=yes
+ lt_cv_prog_compiler_pic_works=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6
-if test x"$lt_prog_compiler_pic_works" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -6620,13 +6955,13 @@ esac
wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works=no
+ lt_cv_prog_compiler_static_works=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -6636,20 +6971,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
else
- lt_prog_compiler_static_works=yes
+ lt_cv_prog_compiler_static_works=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6
-if test x"$lt_prog_compiler_static_works" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
:
else
lt_prog_compiler_static=
@@ -6666,7 +7001,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -6677,11 +7012,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6680: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7015: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:6684: \$? = $ac_status" >&5
+ echo "$as_me:7019: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -6761,12 +7096,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
for cc_temp in $compiler""; do
@@ -6825,7 +7161,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
@@ -6873,7 +7209,7 @@ EOF
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -6891,7 +7227,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
@@ -6906,7 +7242,7 @@ EOF
archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -6924,13 +7260,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
ld_shlibs=no
@@ -7035,7 +7380,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -7055,7 +7400,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -7089,7 +7434,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct=yes
+ :
else
# We have old collect2
hardcode_direct=unsupported
@@ -7167,11 +7512,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -7228,11 +7580,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -7284,7 +7643,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The linker will automatically build a .lib file if we build a DLL.
old_archive_From_new_cmds='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes=yes
;;
@@ -7317,19 +7676,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
link_all_deplibs=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -7369,7 +7727,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
@@ -7492,15 +7850,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
openbsd*)
if test -f /usr/libexec/ld.so; then
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
export_dynamic_flag_spec='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec='-R$libdir'
@@ -7509,10 +7867,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- ld_shlibs=no
+ ld_shlibs=no
fi
;;
@@ -7571,17 +7929,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs=yes
;;
@@ -7638,7 +7995,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag='${wl}-z,text'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
@@ -7715,7 +8072,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -7773,17 +8130,55 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ case $host_os in
+ darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+ *) lt_awk_arg="/^libraries:/" ;;
+ esac
+ lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then
# if the path contains ";" then we assume it to be the separator
# otherwise default to the standard path separator (i.e. ":") - it is
# assumed that no part of a normal pathname contains ";" but that should
# okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'`
else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
fi
+ # Ok, now we have the path, separated by spaces, we can step through it
+ # and add multilib dir if necessary.
+ lt_tmp_lt_search_path_spec=
+ lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ for lt_sys_path in $lt_search_path_spec; do
+ if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+ else
+ test -d "$lt_sys_path" && \
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+ fi
+ done
+ lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+ lt_foo="";
+ lt_count=0;
+ for (lt_i = NF; lt_i > 0; lt_i--) {
+ if ($lt_i != "" && $lt_i != ".") {
+ if ($lt_i == "..") {
+ lt_count++;
+ } else {
+ if (lt_count == 0) {
+ lt_foo="/" $lt_i lt_foo;
+ } else {
+ lt_count--;
+ }
+ }
+ }
+ }
+ if (lt_foo != "") { lt_freq[lt_foo]++; }
+ if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+ sys_lib_search_path_spec=`echo $lt_search_path_spec`
else
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
@@ -7804,7 +8199,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -7943,12 +8338,8 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -7965,18 +8356,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -8014,7 +8393,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -8077,7 +8456,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -8132,7 +8511,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -8148,7 +8527,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -8161,18 +8540,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -8254,6 +8621,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -8350,6 +8721,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -8407,6 +8793,7 @@ else
darwin*)
if test -n "$STRIP" ; then
striplib="$STRIP -x"
+ old_striplib="$STRIP -S"
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
else
@@ -8683,7 +9070,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
if test $ac_cv_lib_dld_shl_load = yes; then
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
echo "$as_me:$LINENO: checking for dlopen" >&5
echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
@@ -8977,7 +9364,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
if test $ac_cv_lib_dld_dld_link = yes; then
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
fi
@@ -9026,7 +9413,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9029 "configure"
+#line 9416 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9126,7 +9513,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9129 "configure"
+#line 9516 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9253,7 +9640,7 @@ aix3*)
fi
;;
-aix4* | aix5*)
+aix[4-9]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -9309,6 +9696,7 @@ if test -f "$ltmain"; then
predeps \
postdeps \
compiler_lib_search_path \
+ compiler_lib_search_dirs \
archive_cmds \
archive_expsym_cmds \
postinstall_cmds \
@@ -9324,6 +9712,7 @@ if test -f "$ltmain"; then
module_cmds \
module_expsym_cmds \
lt_cv_prog_compiler_c_o \
+ fix_srcfile_path \
exclude_expsyms \
include_expsyms; do
@@ -9368,7 +9757,7 @@ echo "$as_me: creating $ofile" >&6;}
# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
# Free Software Foundation, Inc.
#
# This file is part of GNU Libtool:
@@ -9604,6 +9993,10 @@ predeps=$lt_predeps
# shared library.
postdeps=$lt_postdeps
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path
@@ -9692,7 +10085,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols
@@ -9852,6 +10245,7 @@ postdep_objects_CXX=
predeps_CXX=
postdeps_CXX=
compiler_lib_search_path_CXX=
+compiler_lib_search_dirs_CXX=
# Source file extension for C++ test sources.
ac_ext=cpp
@@ -9861,10 +10255,10 @@ objext=o
objext_CXX=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+lt_simple_compile_test_code="int some_variable = 0;"
# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
@@ -9880,16 +10274,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -10096,7 +10490,7 @@ case $host_os in
# FIXME: insert proper C++ library support
ld_shlibs_CXX=no
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -10109,7 +10503,7 @@ case $host_os in
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
*-brtl*)
@@ -10145,7 +10539,7 @@ case $host_os in
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct_CXX=yes
+ :
else
# We have old collect2
hardcode_direct_CXX=unsupported
@@ -10223,11 +10617,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -10285,11 +10686,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -10357,59 +10765,31 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
darwin* | rhapsody*)
- case $host_os in
- rhapsody* | darwin1.[012])
- allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[012])
- allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
- ;;
- 10.*)
- allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
- ;;
- esac
- fi
- ;;
- esac
archive_cmds_need_lc_CXX=no
hardcode_direct_CXX=no
hardcode_automatic_CXX=yes
hardcode_shlibpath_var_CXX=unsupported
whole_archive_flag_spec_CXX=''
link_all_deplibs_CXX=yes
-
- if test "$GXX" = yes ; then
- lt_int_apple_cc_single_mod=no
+ allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+ if test "$GXX" = yes ; then
output_verbose_link_cmd='echo'
- if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
- lt_int_apple_cc_single_mod=yes
+ archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+ archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+ archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
fi
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- else
- archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- fi
- module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- else
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -10443,7 +10823,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
freebsd-elf*)
archive_cmds_need_lc_CXX=no
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
# conventions
ld_shlibs_CXX=yes
@@ -10492,9 +10872,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_separator_CXX=:
case $host_cpu in
- hppa*64*|ia64*)
- hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
- ;;
+ hppa*64*|ia64*) ;;
*)
export_dynamic_flag_spec_CXX='${wl}-E'
;;
@@ -10562,7 +10940,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
esac
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct_CXX=no
hardcode_shlibpath_var_CXX=no
hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
@@ -10602,7 +10980,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator_CXX=:
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# Kuck and Associates, Inc. (KAI) C++ Compiler
@@ -10654,7 +11032,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler
archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
@@ -10682,6 +11060,29 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# dependencies.
output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+
+ # Not sure whether something based on
+ # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+ # would be better.
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ esac
+ ;;
esac
;;
lynxos*)
@@ -10726,9 +11127,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- export_dynamic_flag_spec_CXX='${wl}-E'
- whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
fi
output_verbose_link_cmd='echo'
else
@@ -10895,15 +11296,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The C++ compiler is used as linker so we must use $wl
- # flag to pass the commands to the underlying system
- # linker. We must also pass each convience library through
- # to the system linker between allextract/defaultextract.
- # The C++ compiler will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
;;
esac
link_all_deplibs_CXX=yes
@@ -10950,6 +11346,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
fi
;;
esac
@@ -11037,7 +11439,6 @@ test "$ld_shlibs_CXX" = no && can_build_shared=no
GCC_CXX="$GXX"
LD_CXX="$LD"
-
cat > conftest.$ac_ext <<EOF
class Foo
{
@@ -11139,9 +11540,14 @@ fi
$rm -f confest.$objext
+compiler_lib_search_dirs_CXX=
+if test -n "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
# PORTME: override above test on systems where it is broken
case $host_os in
-interix3*)
+interix[3-9]*)
# Interix 3.5 installs completely hosed .la files for C++, so rather than
# hack all around it, let's just trust "g++" to DTRT.
predep_objects_CXX=
@@ -11149,19 +11555,51 @@ interix3*)
postdeps_CXX=
;;
+linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ #
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
solaris*)
case $cc_basename in
CC*)
+ # The more standards-conforming stlport4 library is
+ # incompatible with the Cstd library. Avoid specifying
+ # it if it's in CXXFLAGS. Ignore libCrun as
+ # -library=stlport4 depends on it.
+ case " $CXX $CXXFLAGS " in
+ *" -library=stlport4 "*)
+ solaris_use_stlport4=yes
+ ;;
+ esac
+
# Adding this requires a known-good setup of shared libraries for
# Sun compiler versions before 5.6, else PIC objects from an old
# archive will be linked into the output, leading to subtle bugs.
- postdeps_CXX='-lCstd -lCrun'
+ if test "$solaris_use_stlport4" != yes; then
+ postdeps_CXX='-library=Cstd -library=Crun'
+ fi
;;
esac
;;
esac
-
case " $postdeps_CXX " in
*" -lc "*) archive_cmds_need_lc_CXX=no ;;
esac
@@ -11192,12 +11630,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# like `-m68040'.
lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | os2* | pw32*)
+ mingw* | cygwin* | os2* | pw32*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
;;
darwin* | rhapsody*)
@@ -11209,7 +11649,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# DJGPP does not support shared libraries at all
lt_prog_compiler_pic_CXX=
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -11235,7 +11675,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
else
case $host_os in
- aix4* | aix5*)
+ aix[4-9]*)
# All AIX code is PIC.
if test "$host_cpu" = ia64; then
# AIX 5 now supports IA64 processor
@@ -11275,7 +11715,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
;;
esac
;;
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
# FreeBSD uses GNU C++
;;
hpux9* | hpux10* | hpux11*)
@@ -11318,7 +11758,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
;;
esac
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
KCC*)
# KAI C++ Compiler
@@ -11331,7 +11771,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_CXX='-KPIC'
lt_prog_compiler_static_CXX='-static'
;;
- pgCC*)
+ pgCC* | pgcpp*)
# Portland Group C++ compiler.
lt_prog_compiler_wl_CXX='-Wl,'
lt_prog_compiler_pic_CXX='-fpic'
@@ -11345,6 +11785,14 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_CXX='-non_shared'
;;
*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C++ 5.9
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ esac
;;
esac
;;
@@ -11454,12 +11902,12 @@ if test -n "$lt_prog_compiler_pic_CXX"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works_CXX=no
+ lt_cv_prog_compiler_pic_works_CXX=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -11470,27 +11918,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11473: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11921: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11477: \$? = $ac_status" >&5
+ echo "$as_me:11925: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_CXX=yes
+ lt_cv_prog_compiler_pic_works_CXX=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6
-if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
case $lt_prog_compiler_pic_CXX in
"" | " "*) ;;
*) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
@@ -11517,13 +11965,13 @@ esac
wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works_CXX=no
+ lt_cv_prog_compiler_static_works_CXX=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -11533,20 +11981,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_CXX=yes
+ lt_cv_prog_compiler_static_works_CXX=yes
fi
else
- lt_prog_compiler_static_works_CXX=yes
+ lt_cv_prog_compiler_static_works_CXX=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6
-if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
:
else
lt_prog_compiler_static_CXX=
@@ -11563,7 +12011,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -11574,11 +12022,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11577: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12025: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11581: \$? = $ac_status" >&5
+ echo "$as_me:12029: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -11631,7 +12079,7 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
case $host_os in
- aix4* | aix5*)
+ aix[4-9]*)
# If we're using GNU nm, then we don't want the "-C" option.
# -C means demangle to AIX nm, but means don't demangle with GNU nm
if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
@@ -11644,12 +12092,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
export_symbols_cmds_CXX="$ltdll_cmds"
;;
cygwin* | mingw*)
- export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
;;
*)
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
+ exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
echo "${ECHO_T}$ld_shlibs_CXX" >&6
@@ -11675,7 +12124,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -11733,20 +12182,7 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -11764,7 +12200,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -11903,12 +12339,7 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -11925,18 +12356,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -11974,7 +12393,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -12037,7 +12456,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -12092,7 +12511,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -12108,7 +12527,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -12121,18 +12540,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -12214,6 +12621,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -12310,6 +12721,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -12393,6 +12819,7 @@ if test -f "$ltmain"; then
predeps_CXX \
postdeps_CXX \
compiler_lib_search_path_CXX \
+ compiler_lib_search_dirs_CXX \
archive_cmds_CXX \
archive_expsym_cmds_CXX \
postinstall_cmds_CXX \
@@ -12408,6 +12835,7 @@ if test -f "$ltmain"; then
module_cmds_CXX \
module_expsym_cmds_CXX \
lt_cv_prog_compiler_c_o_CXX \
+ fix_srcfile_path_CXX \
exclude_expsyms_CXX \
include_expsyms_CXX; do
@@ -12640,6 +13068,10 @@ predeps=$lt_predeps_CXX
# shared library.
postdeps=$lt_postdeps_CXX
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
@@ -12728,7 +13160,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_CXX"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_CXX
@@ -12819,10 +13251,17 @@ objext=o
objext_F77=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+lt_simple_compile_test_code="\
+ subroutine t
+ return
+ end
+"
# Code to be used in simple link tests
-lt_simple_link_test_code=" program t\n end\n"
+lt_simple_link_test_code="\
+ program t
+ end
+"
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
@@ -12838,16 +13277,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -12885,7 +13324,7 @@ aix3*)
postinstall_cmds='$RANLIB $lib'
fi
;;
-aix4* | aix5*)
+aix[4-9]*)
if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
test "$enable_shared" = yes && enable_static=no
fi
@@ -12931,13 +13370,15 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
lt_prog_compiler_pic_F77='-DDLL_EXPORT'
;;
@@ -12947,7 +13388,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_F77='-fno-common'
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -13005,7 +13446,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic_F77='-DDLL_EXPORT'
@@ -13038,7 +13479,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_F77='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl_F77='-Wl,'
@@ -13057,6 +13498,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# All Alpha code is PIC.
lt_prog_compiler_static_F77='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ lt_prog_compiler_wl_F77=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -13066,6 +13523,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_F77='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic_F77='-KPIC'
lt_prog_compiler_static_F77='-Bstatic'
@@ -13128,12 +13589,12 @@ if test -n "$lt_prog_compiler_pic_F77"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works_F77=no
+ lt_cv_prog_compiler_pic_works_F77=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic_F77"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -13144,27 +13605,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13147: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13608: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13151: \$? = $ac_status" >&5
+ echo "$as_me:13612: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_F77=yes
+ lt_cv_prog_compiler_pic_works_F77=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6
-if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
case $lt_prog_compiler_pic_F77 in
"" | " "*) ;;
*) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
@@ -13191,13 +13652,13 @@ esac
wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_F77+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works_F77=no
+ lt_cv_prog_compiler_static_works_F77=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -13207,20 +13668,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_F77=yes
+ lt_cv_prog_compiler_static_works_F77=yes
fi
else
- lt_prog_compiler_static_works_F77=yes
+ lt_cv_prog_compiler_static_works_F77=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6
-if test x"$lt_prog_compiler_static_works_F77" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
:
else
lt_prog_compiler_static_F77=
@@ -13237,7 +13698,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -13248,11 +13709,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13251: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13712: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13255: \$? = $ac_status" >&5
+ echo "$as_me:13716: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -13332,12 +13793,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
for cc_temp in $compiler""; do
@@ -13396,7 +13858,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs_F77=no
@@ -13444,7 +13906,7 @@ EOF
allow_undefined_flag_F77=unsupported
always_export_symbols_F77=no
enable_shared_with_static_runtimes_F77=yes
- export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -13462,7 +13924,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct_F77=no
hardcode_shlibpath_var_F77=no
hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
@@ -13477,7 +13939,7 @@ EOF
archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -13495,13 +13957,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
ld_shlibs_F77=no
@@ -13606,7 +14077,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -13626,7 +14097,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -13660,7 +14131,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct_F77=yes
+ :
else
# We have old collect2
hardcode_direct_F77=unsupported
@@ -13728,11 +14199,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -13779,11 +14257,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -13835,7 +14320,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The linker will automatically build a .lib file if we build a DLL.
old_archive_From_new_cmds_F77='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes_F77=yes
;;
@@ -13868,19 +14353,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
link_all_deplibs_F77=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -13920,7 +14404,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_F77='-R$libdir'
hardcode_direct_F77=yes
@@ -14043,15 +14527,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
openbsd*)
if test -f /usr/libexec/ld.so; then
- hardcode_direct_F77=yes
- hardcode_shlibpath_var_F77=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
export_dynamic_flag_spec_F77='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec_F77='-R$libdir'
@@ -14060,10 +14544,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- ld_shlibs_F77=no
+ ld_shlibs_F77=no
fi
;;
@@ -14122,17 +14606,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs_F77=yes
;;
@@ -14189,7 +14672,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag_F77='${wl}-z,text'
archive_cmds_need_lc_F77=no
hardcode_shlibpath_var_F77=no
@@ -14266,7 +14749,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -14324,20 +14807,7 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -14355,7 +14825,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -14494,12 +14964,7 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -14516,18 +14981,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -14565,7 +15018,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -14628,7 +15081,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -14683,7 +15136,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -14699,7 +15152,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -14712,18 +15165,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -14805,6 +15246,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -14901,6 +15346,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -14984,6 +15444,7 @@ if test -f "$ltmain"; then
predeps_F77 \
postdeps_F77 \
compiler_lib_search_path_F77 \
+ compiler_lib_search_dirs_F77 \
archive_cmds_F77 \
archive_expsym_cmds_F77 \
postinstall_cmds_F77 \
@@ -14999,6 +15460,7 @@ if test -f "$ltmain"; then
module_cmds_F77 \
module_expsym_cmds_F77 \
lt_cv_prog_compiler_c_o_F77 \
+ fix_srcfile_path_F77 \
exclude_expsyms_F77 \
include_expsyms_F77; do
@@ -15231,6 +15693,10 @@ predeps=$lt_predeps_F77
# shared library.
postdeps=$lt_postdeps_F77
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_F77
@@ -15319,7 +15785,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_F77"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_F77
@@ -15378,10 +15844,10 @@ objext=o
objext_GCJ=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
+lt_simple_compile_test_code="class foo {}"
# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
@@ -15397,16 +15863,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -15444,7 +15910,7 @@ if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
else
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-fno-rtti -fno-exceptions"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -15455,11 +15921,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15458: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15924: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15462: \$? = $ac_status" >&5
+ echo "$as_me:15928: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -15510,14 +15976,16 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
;;
- beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
# PIC is the default for these OSes.
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ # Although the cygwin gcc ignores -fPIC, still need this for old-style
+ # (--disable-auto-import) libraries
+
;;
darwin* | rhapsody*)
@@ -15526,7 +15994,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_pic_GCJ='-fno-common'
;;
- interix3*)
+ interix[3-9]*)
# Interix 3.x gcc -fpic/-fPIC options generate broken code.
# Instead, we relocate shared libraries at runtime.
;;
@@ -15584,10 +16052,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
esac
;;
- mingw* | pw32* | os2*)
+ mingw* | cygwin* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
- lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+
;;
hpux9* | hpux10* | hpux11*)
@@ -15617,7 +16085,7 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_GCJ='-Bstatic'
;;
- linux*)
+ linux* | k*bsd*-gnu)
case $cc_basename in
icc* | ecc*)
lt_prog_compiler_wl_GCJ='-Wl,'
@@ -15636,6 +16104,22 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
# All Alpha code is PIC.
lt_prog_compiler_static_GCJ='-non_shared'
;;
+ *)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*)
+ # Sun C 5.9
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ ;;
+ *Sun\ F*)
+ # Sun Fortran 8.3 passes all unrecognized flags to the linker
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ lt_prog_compiler_wl_GCJ=''
+ ;;
+ esac
+ ;;
esac
;;
@@ -15645,6 +16129,10 @@ echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
lt_prog_compiler_static_GCJ='-non_shared'
;;
+ rdos*)
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
solaris*)
lt_prog_compiler_pic_GCJ='-KPIC'
lt_prog_compiler_static_GCJ='-Bstatic'
@@ -15707,12 +16195,12 @@ if test -n "$lt_prog_compiler_pic_GCJ"; then
echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
-if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_pic_works_GCJ=no
+ lt_cv_prog_compiler_pic_works_GCJ=no
ac_outfile=conftest.$ac_objext
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
@@ -15723,27 +16211,27 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15726: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16214: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15730: \$? = $ac_status" >&5
+ echo "$as_me:16218: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
$echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_pic_works_GCJ=yes
+ lt_cv_prog_compiler_pic_works_GCJ=yes
fi
fi
$rm conftest*
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6
-if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then
case $lt_prog_compiler_pic_GCJ in
"" | " "*) ;;
*) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
@@ -15770,13 +16258,13 @@ esac
wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
-if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
+if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_prog_compiler_static_works_GCJ=no
+ lt_cv_prog_compiler_static_works_GCJ=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
- printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
# The linker can only warn and ignore the option if not recognized
# So say no if there are warnings
@@ -15786,20 +16274,20 @@ else
$echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
- lt_prog_compiler_static_works_GCJ=yes
+ lt_cv_prog_compiler_static_works_GCJ=yes
fi
else
- lt_prog_compiler_static_works_GCJ=yes
+ lt_cv_prog_compiler_static_works_GCJ=yes
fi
fi
- $rm conftest*
+ $rm -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
-echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
-echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6
-if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
+if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then
:
else
lt_prog_compiler_static_GCJ=
@@ -15816,7 +16304,7 @@ else
mkdir conftest
cd conftest
mkdir out
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
lt_compiler_flag="-o out/conftest2.$ac_objext"
# Insert the option either (1) after the last *FLAGS variable, or
@@ -15827,11 +16315,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15830: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16318: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15834: \$? = $ac_status" >&5
+ echo "$as_me:16322: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -15911,12 +16399,13 @@ echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared librar
# it will be wrapped by ` (' and `)$', so one must not match beginning or
# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
# as well as any symbol that contains `d'.
- exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+ exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
# the symbol is explicitly referenced. Since portable code cannot
# rely on this symbol name, it's probably fine to never include it in
# preloaded symbol tables.
+ # Exclude shared library initialization/finalization symbols.
extract_expsyms_cmds=
# Just being paranoid about ensuring that cc_basename is set.
for cc_temp in $compiler""; do
@@ -15975,7 +16464,7 @@ cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
# See if GNU ld supports shared libraries.
case $host_os in
- aix3* | aix4* | aix5*)
+ aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs_GCJ=no
@@ -16023,7 +16512,7 @@ EOF
allow_undefined_flag_GCJ=unsupported
always_export_symbols_GCJ=no
enable_shared_with_static_runtimes_GCJ=yes
- export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -16041,7 +16530,7 @@ EOF
fi
;;
- interix3*)
+ interix[3-9]*)
hardcode_direct_GCJ=no
hardcode_shlibpath_var_GCJ=no
hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
@@ -16056,7 +16545,7 @@ EOF
archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
- linux*)
+ gnu* | linux* | k*bsd*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
tmp_addflag=
case $cc_basename,$host_cpu in
@@ -16074,13 +16563,22 @@ EOF
ifc* | ifort*) # Intel Fortran compiler
tmp_addflag=' -nofor_main' ;;
esac
- archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C 5.9
+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_sharedflag='-G' ;;
+ *Sun\ F*) # Sun Fortran 8.3
+ tmp_sharedflag='-G' ;;
+ *)
+ tmp_sharedflag='-shared' ;;
+ esac
+ archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
if test $supports_anon_versioning = yes; then
archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
$echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
fi
else
ld_shlibs_GCJ=no
@@ -16185,7 +16683,7 @@ _LT_EOF
fi
;;
- aix4* | aix5*)
+ aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
@@ -16205,7 +16703,7 @@ _LT_EOF
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
- case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
@@ -16239,7 +16737,7 @@ _LT_EOF
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
- hardcode_direct_GCJ=yes
+ :
else
# We have old collect2
hardcode_direct_GCJ=unsupported
@@ -16317,11 +16815,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -16378,11 +16883,18 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\(.*\)$/\1/
+ p
+ }
+ }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
-}'`; fi
+if test -z "$aix_libpath"; then
+ aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -16434,7 +16946,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# The linker will automatically build a .lib file if we build a DLL.
old_archive_From_new_cmds_GCJ='true'
# FIXME: Should let the user specify the lib program.
- old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs'
fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
enable_shared_with_static_runtimes_GCJ=yes
;;
@@ -16467,19 +16979,18 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
link_all_deplibs_GCJ=yes
if test "$GCC" = yes ; then
output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
- module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
- # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
- module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+ module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+ archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+ module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
else
case $cc_basename in
xlc*)
output_verbose_link_cmd='echo'
- archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring'
module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
# Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
- archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
;;
*)
@@ -16519,7 +17030,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | kfreebsd*-gnu | dragonfly*)
+ freebsd* | dragonfly*)
archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_GCJ='-R$libdir'
hardcode_direct_GCJ=yes
@@ -16642,15 +17153,15 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
openbsd*)
if test -f /usr/libexec/ld.so; then
- hardcode_direct_GCJ=yes
- hardcode_shlibpath_var_GCJ=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
export_dynamic_flag_spec_GCJ='${wl}-E'
- else
- case $host_os in
+ else
+ case $host_os in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_libdir_flag_spec_GCJ='-R$libdir'
@@ -16659,10 +17170,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
;;
- esac
+ esac
fi
else
- ld_shlibs_GCJ=no
+ ld_shlibs_GCJ=no
fi
;;
@@ -16721,17 +17232,16 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
case $host_os in
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
- # The compiler driver will combine linker options so we
- # cannot just pass the convience library names through
- # without $wl, iff we do not link with $LD.
- # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # The compiler driver will combine and reorder linker options,
+ # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- case $wlarc in
- '')
- whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
- *)
- whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
- esac ;;
+ if test "$GCC" = yes; then
+ whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ else
+ whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract'
+ fi
+ ;;
esac
link_all_deplibs_GCJ=yes
;;
@@ -16788,7 +17298,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
fi
;;
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
no_undefined_flag_GCJ='${wl}-z,text'
archive_cmds_need_lc_GCJ=no
hardcode_shlibpath_var_GCJ=no
@@ -16865,7 +17375,7 @@ x|xyes)
echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
$rm conftest*
- printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
@@ -16923,20 +17433,7 @@ shlibpath_overrides_runpath=unknown
version_type=none
dynamic_linker="$host_os ld.so"
sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi
+
need_lib_prefix=unknown
hardcode_into_libs=no
@@ -16954,7 +17451,7 @@ aix3*)
soname_spec='${libname}${release}${shared_ext}$major'
;;
-aix4* | aix5*)
+aix[4-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17093,12 +17590,7 @@ darwin* | rhapsody*)
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
- # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
- if test "$GCC" = yes; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
- else
- sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
- fi
+
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -17115,18 +17607,6 @@ freebsd1*)
dynamic_linker=no
;;
-kfreebsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -17164,7 +17644,7 @@ freebsd* | dragonfly*)
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
- freebsd*) # from 4.6 on
+ *) # from 4.6 on, and DragonFly
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
;;
@@ -17227,7 +17707,7 @@ hpux9* | hpux10* | hpux11*)
postinstall_cmds='chmod 555 $lib'
;;
-interix3*)
+interix[3-9]*)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17282,7 +17762,7 @@ linux*oldld* | linux*aout* | linux*coff*)
;;
# This must be Linux ELF.
-linux*)
+linux* | k*bsd*-gnu)
version_type=linux
need_lib_prefix=no
need_version=no
@@ -17298,7 +17778,7 @@ linux*)
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
@@ -17311,18 +17791,6 @@ linux*)
dynamic_linker='GNU/Linux ld.so'
;;
-knetbsd*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='GNU ld.so'
- ;;
-
netbsd*)
version_type=sunos
need_lib_prefix=no
@@ -17404,6 +17872,10 @@ osf3* | osf4* | osf5*)
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
;;
+rdos*)
+ dynamic_linker=no
+ ;;
+
solaris*)
version_type=linux
need_lib_prefix=no
@@ -17500,6 +17972,21 @@ echo "$as_me:$LINENO: result: $dynamic_linker" >&5
echo "${ECHO_T}$dynamic_linker" >&6
test "$dynamic_linker" = no && can_build_shared=no
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec"
+fi
+
+sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec"
+fi
+
+sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
if test "$GCC" = yes; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
@@ -17583,6 +18070,7 @@ if test -f "$ltmain"; then
predeps_GCJ \
postdeps_GCJ \
compiler_lib_search_path_GCJ \
+ compiler_lib_search_dirs_GCJ \
archive_cmds_GCJ \
archive_expsym_cmds_GCJ \
postinstall_cmds_GCJ \
@@ -17598,6 +18086,7 @@ if test -f "$ltmain"; then
module_cmds_GCJ \
module_expsym_cmds_GCJ \
lt_cv_prog_compiler_c_o_GCJ \
+ fix_srcfile_path_GCJ \
exclude_expsyms_GCJ \
include_expsyms_GCJ; do
@@ -17830,6 +18319,10 @@ predeps=$lt_predeps_GCJ
# shared library.
postdeps=$lt_postdeps_GCJ
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
@@ -17918,7 +18411,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_GCJ"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_GCJ
@@ -17976,7 +18469,7 @@ objext=o
objext_RC=$objext
# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
# Code to be used in simple link tests
lt_simple_link_test_code="$lt_simple_compile_test_code"
@@ -17995,16 +18488,16 @@ compiler=$CC
# save warnings/boilerplate of simple test code
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_compiler_boilerplate=`cat conftest.err`
$rm conftest*
ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
+$rm -r conftest*
# Allow CC to be a program name with arguments.
@@ -18064,6 +18557,7 @@ if test -f "$ltmain"; then
predeps_RC \
postdeps_RC \
compiler_lib_search_path_RC \
+ compiler_lib_search_dirs_RC \
archive_cmds_RC \
archive_expsym_cmds_RC \
postinstall_cmds_RC \
@@ -18079,6 +18573,7 @@ if test -f "$ltmain"; then
module_cmds_RC \
module_expsym_cmds_RC \
lt_cv_prog_compiler_c_o_RC \
+ fix_srcfile_path_RC \
exclude_expsyms_RC \
include_expsyms_RC; do
@@ -18311,6 +18806,10 @@ predeps=$lt_predeps_RC
# shared library.
postdeps=$lt_postdeps_RC
+# The directories searched by this compiler when creating a shared
+# library
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC
+
# The library search path used internally by the compiler when linking
# a shared library.
compiler_lib_search_path=$lt_compiler_lib_search_path_RC
@@ -18399,7 +18898,7 @@ sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path_RC"
+fix_srcfile_path=$lt_fix_srcfile_path
# Set to yes if exported symbols are required.
always_export_symbols=$always_export_symbols_RC
@@ -18830,6 +19329,76 @@ presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
{ (exit 1); exit 1; }; } ;;
esac
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_inline=$ac_kw; break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+
+
+case $ac_cv_c_inline in
+ inline | yes) ;;
+ *)
+ case $ac_cv_c_inline in
+ no) ac_val=;;
+ *) ac_val=$ac_cv_c_inline;;
+ esac
+ cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+ ;;
+esac
#
# We ignore pixman_major in the version here because the major version should
@@ -18841,11 +19410,11 @@ esac
-LT_VERSION_INFO="10:0:10"
+LT_VERSION_INFO="12:0:12"
PIXMAN_VERSION_MAJOR=0
-PIXMAN_VERSION_MINOR=10
+PIXMAN_VERSION_MINOR=12
PIXMAN_VERSION_MICRO=0
@@ -18860,6 +19429,53 @@ if test "x$GCC" = "xyes"; then
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac fi
+# Extract the first word of "perl", so it can be a program name with args.
+set dummy perl; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PERL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $PERL in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="no"
+ ;;
+esac
+fi
+PERL=$ac_cv_path_PERL
+
+if test -n "$PERL"; then
+ echo "$as_me:$LINENO: result: $PERL" >&5
+echo "${ECHO_T}$PERL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test "x$PERL" = xno; then
+ { { echo "$as_me:$LINENO: error: Perl is required to build pixman." >&5
+echo "$as_me: error: Perl is required to build pixman." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
have_gcc4=no
echo "$as_me:$LINENO: checking for -fvisibility" >&5
@@ -18868,7 +19484,7 @@ cat >conftest.$ac_ext <<_ACEOF
#if defined(__GNUC__) && (__GNUC__ >= 4)
#else
-#error Need GCC 4.0 for visibility
+error Need GCC 4.0 for visibility
#endif
int main () { return 0; }
@@ -18909,8 +19525,56 @@ fi
echo "$as_me:$LINENO: result: $have_gcc4" >&5
echo "${ECHO_T}$have_gcc4" >&6
+have_sunstudio8=no
+echo "$as_me:$LINENO: checking for -xldscope (Sun compilers)" >&5
+echo $ECHO_N "checking for -xldscope (Sun compilers)... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
-MMX_CFLAGS="-mmmx -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
+#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#else
+error Need Sun Studio 8 for visibility
+#endif
+int main () { return 0; }
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ have_sunstudio8=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test "x$have_sunstudio8" = "xyes"; then
+ CFLAGS="$CFLAGS -xldscope=hidden"
+fi
+echo "$as_me:$LINENO: result: $have_sunstudio8" >&5
+echo "${ECHO_T}$have_sunstudio8" >&6
+
+
+MMX_CFLAGS="-mmmx -Winline"
have_mmx_intrinsics=no
echo "$as_me:$LINENO: checking whether to use MMX intrinsics" >&5
@@ -18919,8 +19583,8 @@ xserver_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MMX_CFLAGS"
cat >conftest.$ac_ext <<_ACEOF
-#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
-#error "Need GCC >= 3.4 for MMX intrinsics"
+#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3))
+error "Need GCC >= 3.3 for MMX intrinsics"
#endif
#include <mmintrin.h>
int main () {
@@ -18958,8 +19622,18 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$xserver_save_CFLAGS
-echo "$as_me:$LINENO: result: $have_mmx_intrinsics" >&5
-echo "${ECHO_T}$have_mmx_intrinsics" >&6
+
+# Check whether --enable-mmx or --disable-mmx was given.
+if test "${enable_mmx+set}" = set; then
+ enableval="$enable_mmx"
+ enable_mmx=$enableval
+else
+ enable_mmx=auto
+fi;
+
+if test $enable_mmx = no ; then
+ have_mmx_intrinsics=disabled
+fi
if test $have_mmx_intrinsics = yes ; then
@@ -18971,6 +19645,14 @@ else
MMX_CFLAGS=
fi
+echo "$as_me:$LINENO: result: $have_mmx_intrinsics" >&5
+echo "${ECHO_T}$have_mmx_intrinsics" >&6
+if test $enable_mmx = yes && test $have_mmx_intrinsics = no ; then
+ { { echo "$as_me:$LINENO: error: MMX intrinsics not detected" >&5
+echo "$as_me: error: MMX intrinsics not detected" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
if test $have_mmx_intrinsics = yes; then
@@ -18983,24 +19665,28 @@ fi
+SSE2_CFLAGS="-mmmx -msse2 -Winline"
-have_sse_intrinsics=no
-echo "$as_me:$LINENO: checking whether to use SSE intrinsics" >&5
-echo $ECHO_N "checking whether to use SSE intrinsics... $ECHO_C" >&6
+have_sse2_intrinsics=no
+echo "$as_me:$LINENO: checking whether to use SSE2 intrinsics" >&5
+echo $ECHO_N "checking whether to use SSE2 intrinsics... $ECHO_C" >&6
xserver_save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -msse $MMX_CFLAGS"
+CFLAGS="$CFLAGS -msse2 $SSE2_CFLAGS"
cat >conftest.$ac_ext <<_ACEOF
-#if !defined(__amd64__) && !defined(__x86_64__)
-#error "Need x86-64 for SSE"
+#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
+# if !defined(__amd64__) && !defined(__x86_64__)
+# error "Need GCC >= 4.2 for SSE2 intrinsics on x86"
+# endif
#endif
#include <mmintrin.h>
#include <xmmintrin.h>
+#include <emmintrin.h>
int main () {
- __m64 v = _mm_cvtsi32_si64 (1);
- v = _mm_shuffle_pi16 (v, _MM_SHUFFLE(3, 3, 3, 3));
- return _mm_cvtsi64_si32 (v);
+ __m128i a, b, c;
+ c = _mm_xor_si128 (a, b);
+ return 0;
}
_ACEOF
rm -f conftest.$ac_objext
@@ -19025,7 +19711,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- have_sse_intrinsics=yes
+ have_sse2_intrinsics=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -19033,46 +19719,69 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$xserver_save_CFLAGS
-echo "$as_me:$LINENO: result: $have_sse_intrinsics" >&5
-echo "${ECHO_T}$have_sse_intrinsics" >&6
-if test $have_sse_intrinsics = yes ; then
+# Check whether --enable-sse2 or --disable-sse2 was given.
+if test "${enable_sse2+set}" = set; then
+ enableval="$enable_sse2"
+ enable_sse2=$enableval
+else
+ enable_sse2=auto
+fi;
+
+if test $enable_sse2 = no ; then
+ have_sse2_intrinsics=disabled
+fi
+
+if test $have_sse2_intrinsics = yes ; then
cat >>confdefs.h <<\_ACEOF
-#define USE_SSE 1
+#define USE_SSE2 1
_ACEOF
- MMX_CFLAGS="-msse $MMX_CFLAGS"
+fi
+
+echo "$as_me:$LINENO: result: $have_sse2_intrinsics" >&5
+echo "${ECHO_T}$have_sse2_intrinsics" >&6
+if test $enable_sse2 = yes && test $have_sse2_intrinsics = no ; then
+ { { echo "$as_me:$LINENO: error: SSE2 intrinsics not detected" >&5
+echo "$as_me: error: SSE2 intrinsics not detected" >&2;}
+ { (exit 1); exit 1; }; }
fi
-if test $have_sse_intrinsics = yes; then
- USE_SSE_TRUE=
- USE_SSE_FALSE='#'
+if test $have_sse2_intrinsics = yes; then
+ USE_SSE2_TRUE=
+ USE_SSE2_FALSE='#'
else
- USE_SSE_TRUE='#'
- USE_SSE_FALSE=
+ USE_SSE2_TRUE='#'
+ USE_SSE2_FALSE=
fi
-SSE_CFLAGS="-mmmx -msse2 -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
-have_sse2_intrinsics=no
-echo "$as_me:$LINENO: checking whether to use SSE2 intrinsics" >&5
-echo $ECHO_N "checking whether to use SSE2 intrinsics... $ECHO_C" >&6
-xserver_save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -msse2 $SSE_CFLAGS"
+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
+echo "$as_me:$LINENO: checking whether to use VMX/Altivec intrinsics" >&5
+echo $ECHO_N "checking whether to use VMX/Altivec intrinsics... $ECHO_C" >&6
+xserver_save_CFLAGS=$CFLAGS
+CFLAGS="$CFLAGS $VMX_CFLAGS"
cat >conftest.$ac_ext <<_ACEOF
-#include <mmintrin.h>
-#include <xmmintrin.h>
+#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 () {
- __m128i a, b, c;
- c = _mm_xor_si128 (a, b);
+ vector unsigned int v = vec_splat_u32 (1);
+ v = vec_sub (v, v);
return 0;
}
_ACEOF
@@ -19098,7 +19807,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- have_sse2_intrinsics=yes
+ have_vmx_intrinsics=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -19106,30 +19815,57 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS=$xserver_save_CFLAGS
-echo "$as_me:$LINENO: result: $have_sse2_intrinsics" >&5
-echo "${ECHO_T}$have_sse2_intrinsics" >&6
-if test $have_sse2_intrinsics = yes ; then
+# Check whether --enable-vmx or --disable-vmx was given.
+if test "${enable_vmx+set}" = set; then
+ enableval="$enable_vmx"
+ enable_vmx=$enableval
+else
+ enable_vmx=auto
+fi;
+
+if test $enable_vmx = no ; then
+ have_vmx_intrinsics=disabled
+fi
+
+if test $have_vmx_intrinsics = yes ; then
cat >>confdefs.h <<\_ACEOF
-#define USE_SSE2 1
+#define USE_VMX 1
_ACEOF
+else
+ VMX_CFLAGS=
+fi
+
+echo "$as_me:$LINENO: result: $have_vmx_intrinsics" >&5
+echo "${ECHO_T}$have_vmx_intrinsics" >&6
+if test $enable_vmx = yes && test $have_vmx_intrinsics = no ; then
+ { { echo "$as_me:$LINENO: error: VMX intrinsics not detected" >&5
+echo "$as_me: error: VMX intrinsics not detected" >&2;}
+ { (exit 1); exit 1; }; }
fi
-if test $have_sse2_intrinsics = yes; then
- USE_SSE2_TRUE=
- USE_SSE2_FALSE='#'
-else
- USE_SSE2_TRUE='#'
- USE_SSE2_FALSE=
-fi
+if test $have_vmx_intrinsics = yes; then
+ USE_VMX_TRUE=
+ USE_VMX_FALSE='#'
+else
+ USE_VMX_TRUE='#'
+ USE_VMX_FALSE=
+fi
+# Check whether --enable-gtk or --disable-gtk was given.
+if test "${enable_gtk+set}" = set; then
+ enableval="$enable_gtk"
+ enable_gtk=$enableval
+else
+ enable_gtk=auto
+fi;
@@ -19236,6 +19972,19 @@ echo "${ECHO_T}no" >&6
fi
fi
+if test $enable_gtk = auto ; then
+ if test -n "$PKG_CONFIG" && \
+ { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0\"") >&5
+ ($PKG_CONFIG --exists --print-errors "gtk+-2.0") 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ enable_gtk=yes
+else
+ enable_gtk=no
+fi
+fi
+if test $enable_gtk = yes ; then
pkg_failed=no
echo "$as_me:$LINENO: checking for GTK" >&5
@@ -19295,21 +20044,63 @@ fi
# Put the nasty error message in config.log where it belongs
echo "$GTK_PKG_ERRORS" >&5
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- HAVE_GTK=no
+ { { echo "$as_me:$LINENO: error: Package requirements (gtk+-2.0) were not met:
+
+$GTK_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables GTK_CFLAGS
+and GTK_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+echo "$as_me: error: Package requirements (gtk+-2.0) were not met:
+
+$GTK_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables GTK_CFLAGS
+and GTK_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&2;}
+ { (exit 1); exit 1; }; }
elif test $pkg_failed = untried; then
- HAVE_GTK=no
+ { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables GTK_CFLAGS
+and GTK_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&5
+echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables GTK_CFLAGS
+and GTK_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
else
GTK_CFLAGS=$pkg_cv_GTK_CFLAGS
GTK_LIBS=$pkg_cv_GTK_LIBS
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
- HAVE_GTK=yes
+ :
fi
+fi
+
-if test "x$HAVE_GTK" = xyes; then
+if test "x$enable_gtk" = xyes; then
HAVE_GTK_TRUE=
HAVE_GTK_FALSE='#'
else
@@ -19323,7 +20114,7 @@ fi
- ac_config_files="$ac_config_files pixman-1.pc Makefile pixman/Makefile pixman/pixman-version.h test/Makefile"
+ ac_config_files="$ac_config_files pixman-1.pc pixman-1-uninstalled.pc Makefile pixman/Makefile pixman/pixman-version.h test/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -19443,17 +20234,17 @@ echo "$as_me: error: conditional \"USE_MMX\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
-if test -z "${USE_SSE_TRUE}" && test -z "${USE_SSE_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"USE_SSE\" was never defined.
+if test -z "${USE_SSE2_TRUE}" && test -z "${USE_SSE2_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"USE_SSE2\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"USE_SSE\" was never defined.
+echo "$as_me: error: conditional \"USE_SSE2\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
-if test -z "${USE_SSE2_TRUE}" && test -z "${USE_SSE2_FALSE}"; then
- { { echo "$as_me:$LINENO: error: conditional \"USE_SSE2\" was never defined.
+if test -z "${USE_VMX_TRUE}" && test -z "${USE_VMX_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"USE_VMX\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"USE_SSE2\" was never defined.
+echo "$as_me: error: conditional \"USE_VMX\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -19735,7 +20526,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
-This file was extended by pixman $as_me 0.10.0, which was
+This file was extended by pixman $as_me 0.12.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19798,7 +20589,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-pixman config.status 0.10.0
+pixman config.status 0.12.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@@ -19909,6 +20700,7 @@ do
case "$ac_config_target" in
# Handling of arguments.
"pixman-1.pc" ) CONFIG_FILES="$CONFIG_FILES pixman-1.pc" ;;
+ "pixman-1-uninstalled.pc" ) CONFIG_FILES="$CONFIG_FILES pixman-1-uninstalled.pc" ;;
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"pixman/Makefile" ) CONFIG_FILES="$CONFIG_FILES pixman/Makefile" ;;
"pixman/pixman-version.h" ) CONFIG_FILES="$CONFIG_FILES pixman/pixman-version.h" ;;
@@ -20046,6 +20838,7 @@ s,@host@,$host,;t t
s,@host_cpu@,$host_cpu,;t t
s,@host_vendor@,$host_vendor,;t t
s,@host_os@,$host_os,;t t
+s,@SED@,$SED,;t t
s,@EGREP@,$EGREP,;t t
s,@LN_S@,$LN_S,;t t
s,@ECHO@,$ECHO,;t t
@@ -20053,6 +20846,10 @@ s,@AR@,$AR,;t t
s,@ac_ct_AR@,$ac_ct_AR,;t t
s,@RANLIB@,$RANLIB,;t t
s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@DSYMUTIL@,$DSYMUTIL,;t t
+s,@ac_ct_DSYMUTIL@,$ac_ct_DSYMUTIL,;t t
+s,@NMEDIT@,$NMEDIT,;t t
+s,@ac_ct_NMEDIT@,$ac_ct_NMEDIT,;t t
s,@CPP@,$CPP,;t t
s,@CXX@,$CXX,;t t
s,@CXXFLAGS@,$CXXFLAGS,;t t
@@ -20069,14 +20866,16 @@ s,@PIXMAN_VERSION_MAJOR@,$PIXMAN_VERSION_MAJOR,;t t
s,@PIXMAN_VERSION_MINOR@,$PIXMAN_VERSION_MINOR,;t t
s,@PIXMAN_VERSION_MICRO@,$PIXMAN_VERSION_MICRO,;t t
s,@LT_VERSION_INFO@,$LT_VERSION_INFO,;t t
+s,@PERL@,$PERL,;t t
s,@USE_MMX_TRUE@,$USE_MMX_TRUE,;t t
s,@USE_MMX_FALSE@,$USE_MMX_FALSE,;t t
-s,@USE_SSE_TRUE@,$USE_SSE_TRUE,;t t
-s,@USE_SSE_FALSE@,$USE_SSE_FALSE,;t t
s,@USE_SSE2_TRUE@,$USE_SSE2_TRUE,;t t
s,@USE_SSE2_FALSE@,$USE_SSE2_FALSE,;t t
s,@MMX_CFLAGS@,$MMX_CFLAGS,;t t
-s,@SSE_CFLAGS@,$SSE_CFLAGS,;t t
+s,@SSE2_CFLAGS@,$SSE2_CFLAGS,;t t
+s,@VMX_CFLAGS@,$VMX_CFLAGS,;t t
+s,@USE_VMX_TRUE@,$USE_VMX_TRUE,;t t
+s,@USE_VMX_FALSE@,$USE_VMX_FALSE,;t t
s,@PKG_CONFIG@,$PKG_CONFIG,;t t
s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t
diff --git a/lib/pixman/configure.ac b/lib/pixman/configure.ac
index 18c744cea..eb8879ca0 100644
--- a/lib/pixman/configure.ac
+++ b/lib/pixman/configure.ac
@@ -24,22 +24,18 @@ AC_PREREQ([2.57])
# Pixman versioning scheme
#
-# - The git version must at all times have an odd MICRO version
-# number.
+# - The version in git has an odd MICRO version number
#
-# - If you add API, increment the MICRO version to the next largest
-# odd number.
+# - Released versions both development and stable have an even MICRO
+# version number
#
-# - If you release a version that contains new API, then increment
-# MINOR and set MICRO to 0.
+# - Released development versions have an odd MINOR number
#
-# - If you release a new version that does not contain new API, then
-# increment MICRO to the next even number.
+# - Released stable versions have an event MINOR number
#
-# - After doing a release, increment MICRO again to make the version
-# number in git odd.
+# - Versions that break ABI must have a new MAJOR number
#
-# - If you break the ABI, then
+# - If you break the ABI, then at least this must be done:
#
# - increment MAJOR
#
@@ -54,9 +50,10 @@ AC_PREREQ([2.57])
# This ensures that binary incompatible versions can be installed
# in parallel. See http://www106.pair.com/rhp/parallel.html for
# more information
+#
m4_define([pixman_major], 0)
-m4_define([pixman_minor], 10)
+m4_define([pixman_minor], 12)
m4_define([pixman_micro], 0)
m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
@@ -70,7 +67,7 @@ AC_PROG_CC
AC_PROG_LIBTOOL
AC_CHECK_FUNCS([getisax])
AC_C_BIGENDIAN
-
+AC_C_INLINE
#
# We ignore pixman_major in the version here because the major version should
# always be encoded in the actual library name. Ie., the soname is:
@@ -102,6 +99,12 @@ if test "x$GCC" = "xyes"; then
*) CFLAGS="$CFLAGS -Wall" ;;
esac fi changequote([,])dnl
+AC_PATH_PROG(PERL, perl, no)
+if test "x$PERL" = xno; then
+ AC_MSG_ERROR([Perl is required to build pixman.])
+fi
+AC_SUBST(PERL)
+
dnl =========================================================================
dnl -fvisibility stuff
@@ -110,7 +113,7 @@ AC_MSG_CHECKING(for -fvisibility)
AC_COMPILE_IFELSE([
#if defined(__GNUC__) && (__GNUC__ >= 4)
#else
-#error Need GCC 4.0 for visibility
+error Need GCC 4.0 for visibility
#endif
int main () { return 0; }
], have_gcc4=yes)
@@ -120,10 +123,25 @@ if test "x$have_gcc4" = "xyes"; then
fi
AC_MSG_RESULT($have_gcc4)
+have_sunstudio8=no
+AC_MSG_CHECKING([for -xldscope (Sun compilers)])
+AC_COMPILE_IFELSE([
+#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#else
+error Need Sun Studio 8 for visibility
+#endif
+int main () { return 0; }
+], have_sunstudio8=yes)
+
+if test "x$have_sunstudio8" = "xyes"; then
+ CFLAGS="$CFLAGS -xldscope=hidden"
+fi
+AC_MSG_RESULT($have_sunstudio8)
+
dnl ===========================================================================
dnl Check for MMX
-MMX_CFLAGS="-mmmx -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
+MMX_CFLAGS="-mmmx -Winline"
have_mmx_intrinsics=no
AC_MSG_CHECKING(whether to use MMX intrinsics)
@@ -131,7 +149,7 @@ xserver_save_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $MMX_CFLAGS"
AC_COMPILE_IFELSE([
#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
-#error "Need GCC >= 3.4 for MMX intrinsics"
+error "Need GCC >= 3.4 for MMX intrinsics"
#endif
#include <mmintrin.h>
int main () {
@@ -139,7 +157,15 @@ int main () {
return _mm_cvtsi64_si32 (v);
}], have_mmx_intrinsics=yes)
CFLAGS=$xserver_save_CFLAGS
-AC_MSG_RESULT($have_mmx_intrinsics)
+
+AC_ARG_ENABLE(mmx,
+ [AC_HELP_STRING([--disable-mmx],
+ [disable MMX fast paths])],
+ [enable_mmx=$enableval], [enable_mmx=auto])
+
+if test $enable_mmx = no ; then
+ have_mmx_intrinsics=disabled
+fi
if test $have_mmx_intrinsics = yes ; then
AC_DEFINE(USE_MMX, 1, [use MMX compiler intrinsics])
@@ -147,77 +173,124 @@ else
MMX_CFLAGS=
fi
-AM_CONDITIONAL(USE_MMX, test $have_mmx_intrinsics = yes)
-
-dnl =======================================================
-
-dnl GCC 4.2 when compiling with -msse will generate SSE instructions
-dnl on its own. This means anything compiled with -mss can only be
-dnl run after a runtime check for SSE. Unfortunately, since we still
-dnl need to support MMX-but-not-SSE (such as the OLPC), this means we
-dnl can only use SSE when compiling for x86-64 (where SSE is always
-dnl supported).
-
-have_sse_intrinsics=no
-AC_MSG_CHECKING(whether to use SSE intrinsics)
-xserver_save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -msse $MMX_CFLAGS"
-
-AC_COMPILE_IFELSE([
-#if !defined(__amd64__) && !defined(__x86_64__)
-#error "Need x86-64 for SSE"
-#endif
-#include <mmintrin.h>
-#include <xmmintrin.h>
-int main () {
- __m64 v = _mm_cvtsi32_si64 (1);
- v = _mm_shuffle_pi16 (v, _MM_SHUFFLE(3, 3, 3, 3));
- return _mm_cvtsi64_si32 (v);
-}], have_sse_intrinsics=yes)
-CFLAGS=$xserver_save_CFLAGS
-AC_MSG_RESULT($have_sse_intrinsics)
-
-if test $have_sse_intrinsics = yes ; then
- AC_DEFINE(USE_SSE, 1, [use SSE compiler intrinsics])
- MMX_CFLAGS="-msse $MMX_CFLAGS"
+AC_MSG_RESULT($have_mmx_intrinsics)
+if test $enable_mmx = yes && test $have_mmx_intrinsics = no ; then
+ AC_MSG_ERROR([MMX intrinsics not detected])
fi
-AM_CONDITIONAL(USE_SSE, test $have_sse_intrinsics = yes)
-
+AM_CONDITIONAL(USE_MMX, test $have_mmx_intrinsics = yes)
dnl ===========================================================================
dnl Check for SSE2
-SSE_CFLAGS="-mmmx -msse2 -Winline --param inline-unit-growth=10000 --param large-function-growth=10000"
+SSE2_CFLAGS="-mmmx -msse2 -Winline"
have_sse2_intrinsics=no
AC_MSG_CHECKING(whether to use SSE2 intrinsics)
xserver_save_CFLAGS=$CFLAGS
-CFLAGS="$CFLAGS -msse2 $SSE_CFLAGS"
+CFLAGS="$CFLAGS -msse2 $SSE2_CFLAGS"
AC_COMPILE_IFELSE([
+#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
+# if !defined(__amd64__) && !defined(__x86_64__)
+# error "Need GCC >= 4.2 for SSE2 intrinsics on x86"
+# endif
+#endif
#include <mmintrin.h>
#include <xmmintrin.h>
+#include <emmintrin.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)
+
+AC_ARG_ENABLE(sse2,
+ [AC_HELP_STRING([--disable-sse2],
+ [disable SSE2 fast paths])],
+ [enable_sse2=$enableval], [enable_sse2=auto])
+
+if test $enable_sse2 = no ; then
+ have_sse2_intrinsics=disabled
+fi
if test $have_sse2_intrinsics = yes ; then
- AC_DEFINE(USE_SSE2, 1, [use SSE compiler intrinsics])
+ AC_DEFINE(USE_SSE2, 1, [use SSE2 compiler intrinsics])
+fi
+
+AC_MSG_RESULT($have_sse2_intrinsics)
+if test $enable_sse2 = yes && test $have_sse2_intrinsics = no ; then
+ AC_MSG_ERROR([SSE2 intrinsics not detected])
fi
AM_CONDITIONAL(USE_SSE2, test $have_sse2_intrinsics = yes)
dnl ========================================================
AC_SUBST(MMX_CFLAGS)
-AC_SUBST(SSE_CFLAGS)
+AC_SUBST(SSE2_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(whether to use VMX/Altivec intrinsics)
+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_ARG_ENABLE(vmx,
+ [AC_HELP_STRING([--disable-vmx],
+ [disable VMX fast paths])],
+ [enable_vmx=$enableval], [enable_vmx=auto])
+
+if test $enable_vmx = no ; then
+ have_vmx_intrinsics=disabled
+fi
+
+if test $have_vmx_intrinsics = yes ; then
+ AC_DEFINE(USE_VMX, 1, [use VMX compiler intrinsics])
+else
+ VMX_CFLAGS=
+fi
+
+AC_MSG_RESULT($have_vmx_intrinsics)
+if test $enable_vmx = yes && test $have_vmx_intrinsics = no ; then
+ AC_MSG_ERROR([VMX intrinsics not detected])
+fi
+
+AC_SUBST(VMX_CFLAGS)
+
+AM_CONDITIONAL(USE_VMX, test $have_vmx_intrinsics = yes)
+
+AC_ARG_ENABLE(gtk,
+ [AC_HELP_STRING([--enable-gtk],
+ [enable tests using GTK+ [default=auto]])],
+ [enable_gtk=$enableval], [enable_gtk=auto])
+
+PKG_PROG_PKG_CONFIG
+if test $enable_gtk = auto ; then
+ PKG_CHECK_EXISTS([gtk+-2.0], [enable_gtk=yes], [enable_gtk=no])
+fi
+if test $enable_gtk = yes ; then
+ PKG_CHECK_MODULES(GTK, [gtk+-2.0])
+fi
-PKG_CHECK_MODULES(GTK, [gtk+-2.0], [HAVE_GTK=yes], [HAVE_GTK=no])
-AM_CONDITIONAL(HAVE_GTK, [test "x$HAVE_GTK" = xyes])
+AM_CONDITIONAL(HAVE_GTK, [test "x$enable_gtk" = xyes])
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
@@ -225,6 +298,7 @@ AC_SUBST(DEP_CFLAGS)
AC_SUBST(DEP_LIBS)
AC_OUTPUT([pixman-1.pc
+ pixman-1-uninstalled.pc
Makefile
pixman/Makefile
pixman/pixman-version.h
diff --git a/lib/pixman/ltmain.sh b/lib/pixman/ltmain.sh
index 85faf0734..248cd4047 100644
--- a/lib/pixman/ltmain.sh
+++ b/lib/pixman/ltmain.sh
@@ -1,8 +1,8 @@
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008 Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This program is free software; you can redistribute it and/or modify
@@ -43,14 +43,22 @@ EXIT_FAILURE=1
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION=1.5.22
-TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
-
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes.
-if test -n "${ZSH_VERSION+set}" ; then
+VERSION=1.5.26
+TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
# Check that we have a working $echo.
if test "X$1" = X--no-reexec; then
@@ -105,11 +113,19 @@ esac
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
-if test "${LC_ALL+set}" = set; then
- save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
-fi
-if test "${LANG+set}" = set; then
- save_LANG="$LANG"; LANG=C; export LANG
+lt_env=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ lt_env=\"$lt_var=\$$lt_var \$lt_env\"
+ $lt_var=C
+ export $lt_var
+ fi"
+done
+
+if test -n "$lt_env"; then
+ lt_env="env $lt_env"
fi
# Make sure IFS has a sensible default
@@ -136,6 +152,8 @@ duplicate_deps=no
preserve_args=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
#####################################
# Shell function definitions:
@@ -196,7 +214,13 @@ func_win32_libid ()
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
$EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
win32_nmres=`eval $NM -f posix -A $1 | \
- $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+ $SED -n -e '1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
case $win32_nmres in
import*) win32_libid_type="x86 archive import";;
*) win32_libid_type="x86 archive static";;
@@ -327,7 +351,17 @@ func_extract_archives ()
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
- my_xdir="$my_gentop/$my_xlib"
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ extracted_serial=`expr $extracted_serial + 1`
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
$show "${rm}r $my_xdir"
$run ${rm}r "$my_xdir"
@@ -454,11 +488,12 @@ do
;;
--version)
- $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
- $echo
- $echo "Copyright (C) 2005 Free Software Foundation, Inc."
- $echo "This is free software; see the source for copying conditions. There is NO"
- $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+ echo "\
+$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit $?
;;
@@ -755,9 +790,11 @@ if test -z "$show_help"; then
*.class) xform=class ;;
*.cpp) xform=cpp ;;
*.cxx) xform=cxx ;;
- *.f90) xform=f90 ;;
+ *.[fF][09]?) xform=[fF][09]. ;;
*.for) xform=for ;;
*.java) xform=java ;;
+ *.obj) xform=obj ;;
+ *.sx) xform=sx ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@@ -926,7 +963,7 @@ EOF
$run $rm "$lobj" "$output_obj"
$show "$command"
- if $run eval "$command"; then :
+ if $run eval $lt_env "$command"; then :
else
test -n "$output_obj" && $run $rm $removelist
exit $EXIT_FAILURE
@@ -998,7 +1035,7 @@ EOF
command="$command$suppress_output"
$run $rm "$obj" "$output_obj"
$show "$command"
- if $run eval "$command"; then :
+ if $run eval $lt_env "$command"; then :
else
$run $rm $removelist
exit $EXIT_FAILURE
@@ -1131,6 +1168,7 @@ EOF
thread_safe=no
vinfo=
vinfo_number=no
+ single_module="${wl}-single_module"
func_infer_tag $base_compile
@@ -1138,8 +1176,9 @@ EOF
for arg
do
case $arg in
- -all-static | -static)
- if test "X$arg" = "X-all-static"; then
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi
@@ -1147,12 +1186,20 @@ EOF
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
- else
+ ;;
+ -static)
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=built
- fi
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
build_libtool_libs=no
build_old_libs=yes
break
@@ -1600,7 +1647,7 @@ EOF
continue
;;
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
compiler_flags="$compiler_flags $arg"
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
@@ -1608,6 +1655,11 @@ EOF
continue
;;
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
-module)
module=yes
continue
@@ -1621,10 +1673,11 @@ EOF
# -m* pass through architecture-specific compiler args for GCC
# -m*, -t[45]*, -txscale* pass through architecture-specific
# compiler args for GCC
- # -pg pass through profiling flag for GCC
+ # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+ # -F/path gives path to uninstalled frameworks, gcc on darwin
# @file GCC response files
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
- -t[45]*|-txscale*|@*)
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
@@ -1652,9 +1705,9 @@ EOF
-no-install)
case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
# The PATH hackery in wrapper scripts is required on Windows
- # in order for the loader to find any dlls it needs.
+ # and Darwin in order for the loader to find any dlls it needs.
$echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
$echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
fast_install=no
@@ -1713,7 +1766,7 @@ EOF
continue
;;
- -static)
+ -static | -static-libtool-libs)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
@@ -2106,7 +2159,7 @@ EOF
lib=
found=no
case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
@@ -2122,7 +2175,12 @@ EOF
continue
fi
name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
- for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
lib="$searchdir/lib${name}${search_ext}"
@@ -2503,7 +2561,9 @@ EOF
if test "$linkmode,$pass" = "prog,link"; then
if test -n "$library_names" &&
- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
# Make sure the rpath contains only unique directories.
@@ -2916,12 +2976,18 @@ EOF
# we do not want to link against static libs,
# but need to link against shared
eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -n "$deplibrary_names" ; then
for tmp in $deplibrary_names ; do
depdepl=$tmp
done
- if test -f "$path/$depdepl" ; then
+ if test -f "$deplibdir/$depdepl" ; then
+ depdepl="$deplibdir/$depdepl"
+ elif test -f "$path/$depdepl" ; then
depdepl="$path/$depdepl"
+ else
+ # Can't find it, oh well...
+ depdepl=
fi
# do not add paths which are already there
case " $newlib_search_path " in
@@ -3069,9 +3135,10 @@ EOF
case $linkmode in
oldlib)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
- fi
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
+ esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
@@ -3199,7 +3266,7 @@ EOF
# which has an extra 1 added just for fun
#
case $version_type in
- darwin|linux|osf|windows)
+ darwin|linux|osf|windows|none)
current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_revision"
@@ -3210,9 +3277,10 @@ EOF
age="0"
;;
irix|nonstopux)
- current=`expr $number_major + $number_minor - 1`
+ current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_minor"
+ lt_irix_increment=no
;;
esac
;;
@@ -3271,7 +3339,8 @@ EOF
versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options...
minor_current=`expr $current + 1`
- verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
;;
freebsd-aout)
@@ -3285,8 +3354,11 @@ EOF
;;
irix | nonstopux)
- major=`expr $current - $age + 1`
-
+ if test "X$lt_irix_increment" = "Xno"; then
+ major=`expr $current - $age`
+ else
+ major=`expr $current - $age + 1`
+ fi
case $version_type in
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
@@ -3437,11 +3509,11 @@ EOF
fi
# Eliminate all temporary directories.
- for path in $notinst_path; do
- lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
- deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
- dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
- done
+ #for path in $notinst_path; do
+ # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+ # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+ # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+ #done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
@@ -3542,13 +3614,12 @@ EOF
int main() { return 0; }
EOF
$rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
- if test "$?" -eq 0 ; then
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
ldd_output=`ldd conftest`
for i in $deplibs; do
name=`expr $i : '-l\(.*\)'`
# If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" -ne "0"; then
+ if test "$name" != "" && test "$name" != "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
@@ -3587,9 +3658,7 @@ EOF
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" != "0"; then
$rm conftest
- $LTCC $LTCFLAGS -o conftest conftest.c $i
- # Did it work?
- if test "$?" -eq 0 ; then
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
ldd_output=`ldd conftest`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
@@ -3621,7 +3690,7 @@ EOF
droppeddeps=yes
$echo
$echo "*** Warning! Library $i is needed by this library but I was not able to"
- $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** make it link in! You will probably need to install it or some"
$echo "*** library that it depends on before this library will be fully"
$echo "*** functional. Installing it before continuing would be even better."
fi
@@ -3907,7 +3976,10 @@ EOF
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
if test -n "$hardcode_libdir_flag_spec_ld"; then
- eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ case $archive_cmds in
+ *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
+ *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
+ esac
else
eval dep_rpath=\"$hardcode_libdir_flag_spec\"
fi
@@ -4217,9 +4289,10 @@ EOF
;;
obj)
- if test -n "$deplibs"; then
- $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
- fi
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
+ esac
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
@@ -4266,12 +4339,14 @@ EOF
reload_conv_objs=
gentop=
# reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
wl=
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
- eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
else
gentop="$output_objdir/${obj}x"
generated="$generated $gentop"
@@ -4719,16 +4794,16 @@ static const void *lt_preloaded_setup() {
case $host in
*cygwin* | *mingw* )
if test -f "$output_objdir/${outputname}.def" ; then
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
else
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
fi
;;
* )
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
;;
esac
;;
@@ -4743,13 +4818,13 @@ static const void *lt_preloaded_setup() {
# really was required.
# Nullify the symbol file.
- compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
fi
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
- compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
@@ -4836,7 +4911,7 @@ static const void *lt_preloaded_setup() {
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
- relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
else
# fast_install is set to needless
relink_command=
@@ -4873,7 +4948,7 @@ static const void *lt_preloaded_setup() {
fi
done
relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
fi
# Quote $echo for shipping.
@@ -5280,6 +5355,20 @@ EOF
Xsed='${SED} -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
@@ -5422,7 +5511,7 @@ else
;;
esac
$echo >> $output "\
- \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ \$echo \"\$0: cannot exec \$program \$*\"
exit $EXIT_FAILURE
fi
else
@@ -5608,7 +5697,7 @@ fi\
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
@@ -5957,9 +6046,9 @@ relink_command=\"$relink_command\""
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
- relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
else
- relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
fi
$echo "$modename: warning: relinking \`$file'" 1>&2
@@ -6168,7 +6257,7 @@ relink_command=\"$relink_command\""
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file"
# Replace the output file specification.
- relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
$show "$relink_command"
if $run eval "$relink_command"; then :
@@ -6345,8 +6434,10 @@ relink_command=\"$relink_command\""
if test -f "$dir/$objdir/$dlname"; then
dir="$dir/$objdir"
else
- $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
- exit $EXIT_FAILURE
+ if test ! -f "$dir/$dlname"; then
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit $EXIT_FAILURE
+ fi
fi
;;
@@ -6410,12 +6501,12 @@ relink_command=\"$relink_command\""
fi
# Restore saved environment variables
- if test "${save_LC_ALL+set}" = set; then
- LC_ALL="$save_LC_ALL"; export LC_ALL
- fi
- if test "${save_LANG+set}" = set; then
- LANG="$save_LANG"; export LANG
- fi
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ fi"
+ done
# Now prepare to actually exec the command.
exec_cmd="\$cmd$args"
@@ -6772,9 +6863,9 @@ The following components of LINK-COMMAND are treated specially:
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
+ try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX
- try to export only the symbols matching REGEX
+ try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
@@ -6788,9 +6879,11 @@ The following components of LINK-COMMAND are treated specially:
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -static do not do any dynamic linking of libtool libraries
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
+ specify library version info [each variable defaults to 0]
All other options (arguments beginning with \`-') are ignored.
diff --git a/lib/pixman/pixman-1-uninstalled.pc.in b/lib/pixman/pixman-1-uninstalled.pc.in
new file mode 100644
index 000000000..9a2afa1a5
--- /dev/null
+++ b/lib/pixman/pixman-1-uninstalled.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: Pixman
+Description: The pixman library (version 1)
+Version: @PACKAGE_VERSION@
+Cflags: -I${pc_top_builddir}/${pcfiledir}/pixman
+Libs: ${pc_top_builddir}/${pcfiledir}/libpixman-1-so.a
+
diff --git a/lib/pixman/pixman/Makefile.am b/lib/pixman/pixman/Makefile.am
index 190df4c57..399fb7d5d 100644
--- a/lib/pixman/pixman/Makefile.am
+++ b/lib/pixman/pixman/Makefile.am
@@ -1,14 +1,19 @@
lib_LTLIBRARIES = libpixman-1.la
-libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO)
+libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -no-undefined
libpixman_1_la_LIBADD = @DEP_LIBS@ -lm
+libpixman_1_la_CFLAGS = -DPIXMAN_DISABLE_DEPRECATED
libpixman_1_la_SOURCES = \
pixman.h \
pixman-access.c \
pixman-access-accessors.c \
- pixman-region.c \
+ pixman-region16.c \
+ pixman-region32.c \
pixman-private.h \
pixman-image.c \
- pixman-combine.c \
+ pixman-combine32.c \
+ pixman-combine32.h \
+ pixman-combine64.c \
+ pixman-combine64.h \
pixman-compose.c \
pixman-compose-accessors.c \
pixman-pict.c \
@@ -27,7 +32,18 @@ libpixmanincludedir = $(includedir)/pixman-1/
libpixmaninclude_HEADERS = pixman.h pixman-version.h
noinst_LTLIBRARIES =
-EXTRA_DIST = Makefile.win32
+pixman-combine32.c : combine.inc pixman-combine32.h combine.pl
+ $(PERL) $(srcdir)/combine.pl 8 < $(srcdir)/combine.inc > $@ || ($(RM) $@; exit 1)
+pixman-combine32.h : combine.h.inc combine.pl
+ $(PERL) $(srcdir)/combine.pl 8 < $(srcdir)/combine.h.inc > $@ || ($(RM) $@; exit 1)
+
+pixman-combine64.c : combine.inc pixman-combine64.h combine.pl
+ $(PERL) $(srcdir)/combine.pl 16 < $(srcdir)/combine.inc > $@ || ($(RM) $@; exit 1)
+pixman-combine64.h : combine.h.inc combine.pl
+ $(PERL) $(srcdir)/combine.pl 16 < $(srcdir)/combine.h.inc > $@ || ($(RM) $@; exit 1)
+
+EXTRA_DIST = Makefile.win32 combine.inc combine.pl pixman-region.c combine.h.inc
+CLEANFILES = pixman-combine32.c pixman-combine64.c pixman-combine32.h pixman-combine64.h
# mmx code
if USE_MMX
@@ -40,15 +56,26 @@ libpixman_mmx_la_LIBADD = $(DEP_LIBS)
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 \
+ pixman-combine32.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
+noinst_LTLIBRARIES += libpixman-sse2.la
+libpixman_sse2_la_SOURCES = \
+ pixman-sse2.c \
+ pixman-sse2.h
+libpixman_sse2_la_CFLAGS = $(DEP_CFLAGS) $(SSE2_CFLAGS)
+libpixman_sse2_la_LIBADD = $(DEP_LIBS)
+libpixman_1_la_LIBADD += libpixman-sse2.la
endif
diff --git a/lib/pixman/pixman/Makefile.in b/lib/pixman/pixman/Makefile.in
index d8e122e6e..02206f868 100644
--- a/lib/pixman/pixman/Makefile.in
+++ b/lib/pixman/pixman/Makefile.in
@@ -42,9 +42,13 @@ host_triplet = @host@
@USE_MMX_TRUE@am__append_1 = libpixman-mmx.la
@USE_MMX_TRUE@am__append_2 = libpixman-mmx.la
+# vmx code
+@USE_VMX_TRUE@am__append_3 = libpixman-vmx.la
+@USE_VMX_TRUE@am__append_4 = libpixman-vmx.la
+
# sse2 code
-@USE_SSE2_TRUE@am__append_3 = libpixman-sse.la
-@USE_SSE2_TRUE@am__append_4 = libpixman-sse.la
+@USE_SSE2_TRUE@am__append_5 = libpixman-sse2.la
+@USE_SSE2_TRUE@am__append_6 = libpixman-sse2.la
subdir = pixman
DIST_COMMON = $(libpixmaninclude_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/pixman-version.h.in
@@ -66,30 +70,48 @@ am__installdirs = "$(DESTDIR)$(libdir)" \
libLTLIBRARIES_INSTALL = $(INSTALL)
LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
@USE_MMX_TRUE@am__DEPENDENCIES_1 = libpixman-mmx.la
-@USE_SSE2_TRUE@am__DEPENDENCIES_2 = libpixman-sse.la
+@USE_VMX_TRUE@am__DEPENDENCIES_2 = libpixman-vmx.la
+@USE_SSE2_TRUE@am__DEPENDENCIES_3 = libpixman-sse2.la
libpixman_1_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_2)
-am_libpixman_1_la_OBJECTS = pixman-access.lo \
- pixman-access-accessors.lo pixman-region.lo pixman-image.lo \
- pixman-combine.lo pixman-compose.lo \
- pixman-compose-accessors.lo pixman-pict.lo pixman-source.lo \
- pixman-transformed.lo pixman-transformed-accessors.lo \
- pixman-utils.lo pixman-edge.lo pixman-edge-accessors.lo \
- pixman-trap.lo pixman-compute-region.lo pixman-timer.lo
+ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3)
+am_libpixman_1_la_OBJECTS = libpixman_1_la-pixman-access.lo \
+ libpixman_1_la-pixman-access-accessors.lo \
+ libpixman_1_la-pixman-region16.lo \
+ libpixman_1_la-pixman-region32.lo \
+ libpixman_1_la-pixman-image.lo \
+ libpixman_1_la-pixman-combine32.lo \
+ libpixman_1_la-pixman-combine64.lo \
+ libpixman_1_la-pixman-compose.lo \
+ libpixman_1_la-pixman-compose-accessors.lo \
+ libpixman_1_la-pixman-pict.lo libpixman_1_la-pixman-source.lo \
+ libpixman_1_la-pixman-transformed.lo \
+ libpixman_1_la-pixman-transformed-accessors.lo \
+ libpixman_1_la-pixman-utils.lo libpixman_1_la-pixman-edge.lo \
+ libpixman_1_la-pixman-edge-accessors.lo \
+ libpixman_1_la-pixman-trap.lo \
+ libpixman_1_la-pixman-compute-region.lo \
+ libpixman_1_la-pixman-timer.lo
libpixman_1_la_OBJECTS = $(am_libpixman_1_la_OBJECTS)
-am__DEPENDENCIES_3 =
-@USE_MMX_TRUE@libpixman_mmx_la_DEPENDENCIES = $(am__DEPENDENCIES_3)
+am__DEPENDENCIES_4 =
+@USE_MMX_TRUE@libpixman_mmx_la_DEPENDENCIES = $(am__DEPENDENCIES_4)
am__libpixman_mmx_la_SOURCES_DIST = pixman-mmx.c pixman-mmx.h
@USE_MMX_TRUE@am_libpixman_mmx_la_OBJECTS = \
@USE_MMX_TRUE@ libpixman_mmx_la-pixman-mmx.lo
libpixman_mmx_la_OBJECTS = $(am_libpixman_mmx_la_OBJECTS)
@USE_MMX_TRUE@am_libpixman_mmx_la_rpath =
-@USE_SSE2_TRUE@libpixman_sse_la_DEPENDENCIES = $(am__DEPENDENCIES_3)
-am__libpixman_sse_la_SOURCES_DIST = pixman-sse.c pixman-sse.h
-@USE_SSE2_TRUE@am_libpixman_sse_la_OBJECTS = \
-@USE_SSE2_TRUE@ libpixman_sse_la-pixman-sse.lo
-libpixman_sse_la_OBJECTS = $(am_libpixman_sse_la_OBJECTS)
-@USE_SSE2_TRUE@am_libpixman_sse_la_rpath =
+@USE_SSE2_TRUE@libpixman_sse2_la_DEPENDENCIES = $(am__DEPENDENCIES_4)
+am__libpixman_sse2_la_SOURCES_DIST = pixman-sse2.c pixman-sse2.h
+@USE_SSE2_TRUE@am_libpixman_sse2_la_OBJECTS = \
+@USE_SSE2_TRUE@ libpixman_sse2_la-pixman-sse2.lo
+libpixman_sse2_la_OBJECTS = $(am_libpixman_sse2_la_OBJECTS)
+@USE_SSE2_TRUE@am_libpixman_sse2_la_rpath =
+@USE_VMX_TRUE@libpixman_vmx_la_DEPENDENCIES = $(am__DEPENDENCIES_4)
+am__libpixman_vmx_la_SOURCES_DIST = pixman-vmx.c pixman-vmx.h \
+ pixman-combine32.h
+@USE_VMX_TRUE@am_libpixman_vmx_la_OBJECTS = \
+@USE_VMX_TRUE@ libpixman_vmx_la-pixman-vmx.lo
+libpixman_vmx_la_OBJECTS = $(am_libpixman_vmx_la_OBJECTS)
+@USE_VMX_TRUE@am_libpixman_vmx_la_rpath =
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -102,10 +124,11 @@ CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(libpixman_1_la_SOURCES) $(libpixman_mmx_la_SOURCES) \
- $(libpixman_sse_la_SOURCES)
+ $(libpixman_sse2_la_SOURCES) $(libpixman_vmx_la_SOURCES)
DIST_SOURCES = $(libpixman_1_la_SOURCES) \
$(am__libpixman_mmx_la_SOURCES_DIST) \
- $(am__libpixman_sse_la_SOURCES_DIST)
+ $(am__libpixman_sse2_la_SOURCES_DIST) \
+ $(am__libpixman_vmx_la_SOURCES_DIST)
libpixmanincludeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(libpixmaninclude_HEADERS)
ETAGS = etags
@@ -134,6 +157,7 @@ DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEP_CFLAGS = @DEP_CFLAGS@
DEP_LIBS = @DEP_LIBS@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -159,6 +183,7 @@ LTLIBOBJS = @LTLIBOBJS@
LT_VERSION_INFO = @LT_VERSION_INFO@
MAKEINFO = @MAKEINFO@
MMX_CFLAGS = @MMX_CFLAGS@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -167,26 +192,31 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
PIXMAN_VERSION_MAJOR = @PIXMAN_VERSION_MAJOR@
PIXMAN_VERSION_MICRO = @PIXMAN_VERSION_MICRO@
PIXMAN_VERSION_MINOR = @PIXMAN_VERSION_MINOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-SSE_CFLAGS = @SSE_CFLAGS@
+SSE2_CFLAGS = @SSE2_CFLAGS@
STRIP = @STRIP@
USE_MMX_FALSE = @USE_MMX_FALSE@
USE_MMX_TRUE = @USE_MMX_TRUE@
USE_SSE2_FALSE = @USE_SSE2_FALSE@
USE_SSE2_TRUE = @USE_SSE2_TRUE@
-USE_SSE_FALSE = @USE_SSE_FALSE@
-USE_SSE_TRUE = @USE_SSE_TRUE@
+USE_VMX_FALSE = @USE_VMX_FALSE@
+USE_VMX_TRUE = @USE_VMX_TRUE@
VERSION = @VERSION@
+VMX_CFLAGS = @VMX_CFLAGS@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
@@ -228,16 +258,22 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
lib_LTLIBRARIES = libpixman-1.la
-libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO)
-libpixman_1_la_LIBADD = @DEP_LIBS@ -lm $(am__append_2) $(am__append_4)
+libpixman_1_la_LDFLAGS = -version-info $(LT_VERSION_INFO) -no-undefined
+libpixman_1_la_LIBADD = @DEP_LIBS@ -lm $(am__append_2) $(am__append_4) \
+ $(am__append_6)
+libpixman_1_la_CFLAGS = -DPIXMAN_DISABLE_DEPRECATED
libpixman_1_la_SOURCES = \
pixman.h \
pixman-access.c \
pixman-access-accessors.c \
- pixman-region.c \
+ pixman-region16.c \
+ pixman-region32.c \
pixman-private.h \
pixman-image.c \
- pixman-combine.c \
+ pixman-combine32.c \
+ pixman-combine32.h \
+ pixman-combine64.c \
+ pixman-combine64.h \
pixman-compose.c \
pixman-compose-accessors.c \
pixman-pict.c \
@@ -254,20 +290,28 @@ libpixman_1_la_SOURCES = \
libpixmanincludedir = $(includedir)/pixman-1/
libpixmaninclude_HEADERS = pixman.h pixman-version.h
-noinst_LTLIBRARIES = $(am__append_1) $(am__append_3)
-EXTRA_DIST = Makefile.win32
+noinst_LTLIBRARIES = $(am__append_1) $(am__append_3) $(am__append_5)
+EXTRA_DIST = Makefile.win32 combine.inc combine.pl pixman-region.c combine.h.inc
+CLEANFILES = pixman-combine32.c pixman-combine64.c pixman-combine32.h pixman-combine64.h
@USE_MMX_TRUE@libpixman_mmx_la_SOURCES = \
@USE_MMX_TRUE@ pixman-mmx.c \
@USE_MMX_TRUE@ pixman-mmx.h
@USE_MMX_TRUE@libpixman_mmx_la_CFLAGS = $(DEP_CFLAGS) $(MMX_CFLAGS)
@USE_MMX_TRUE@libpixman_mmx_la_LIBADD = $(DEP_LIBS)
-@USE_SSE2_TRUE@libpixman_sse_la_SOURCES = \
-@USE_SSE2_TRUE@ pixman-sse.c \
-@USE_SSE2_TRUE@ pixman-sse.h
-
-@USE_SSE2_TRUE@libpixman_sse_la_CFLAGS = $(DEP_CFLAGS) $(SSE_CFLAGS)
-@USE_SSE2_TRUE@libpixman_sse_la_LIBADD = $(DEP_LIBS)
+@USE_VMX_TRUE@libpixman_vmx_la_SOURCES = \
+@USE_VMX_TRUE@ pixman-vmx.c \
+@USE_VMX_TRUE@ pixman-vmx.h \
+@USE_VMX_TRUE@ pixman-combine32.h
+
+@USE_VMX_TRUE@libpixman_vmx_la_CFLAGS = $(DEP_CFLAGS) $(VMX_CFLAGS)
+@USE_VMX_TRUE@libpixman_vmx_la_LIBADD = $(DEP_LIBS)
+@USE_SSE2_TRUE@libpixman_sse2_la_SOURCES = \
+@USE_SSE2_TRUE@ pixman-sse2.c \
+@USE_SSE2_TRUE@ pixman-sse2.h
+
+@USE_SSE2_TRUE@libpixman_sse2_la_CFLAGS = $(DEP_CFLAGS) $(SSE2_CFLAGS)
+@USE_SSE2_TRUE@libpixman_sse2_la_LIBADD = $(DEP_LIBS)
all: all-am
.SUFFIXES:
@@ -343,8 +387,10 @@ libpixman-1.la: $(libpixman_1_la_OBJECTS) $(libpixman_1_la_DEPENDENCIES)
$(LINK) -rpath $(libdir) $(libpixman_1_la_LDFLAGS) $(libpixman_1_la_OBJECTS) $(libpixman_1_la_LIBADD) $(LIBS)
libpixman-mmx.la: $(libpixman_mmx_la_OBJECTS) $(libpixman_mmx_la_DEPENDENCIES)
$(LINK) $(am_libpixman_mmx_la_rpath) $(libpixman_mmx_la_LDFLAGS) $(libpixman_mmx_la_OBJECTS) $(libpixman_mmx_la_LIBADD) $(LIBS)
-libpixman-sse.la: $(libpixman_sse_la_OBJECTS) $(libpixman_sse_la_DEPENDENCIES)
- $(LINK) $(am_libpixman_sse_la_rpath) $(libpixman_sse_la_LDFLAGS) $(libpixman_sse_la_OBJECTS) $(libpixman_sse_la_LIBADD) $(LIBS)
+libpixman-sse2.la: $(libpixman_sse2_la_OBJECTS) $(libpixman_sse2_la_DEPENDENCIES)
+ $(LINK) $(am_libpixman_sse2_la_rpath) $(libpixman_sse2_la_LDFLAGS) $(libpixman_sse2_la_OBJECTS) $(libpixman_sse2_la_LIBADD) $(LIBS)
+libpixman-vmx.la: $(libpixman_vmx_la_OBJECTS) $(libpixman_vmx_la_DEPENDENCIES)
+ $(LINK) $(am_libpixman_vmx_la_rpath) $(libpixman_vmx_la_LDFLAGS) $(libpixman_vmx_la_OBJECTS) $(libpixman_vmx_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -352,25 +398,28 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-access-accessors.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-access.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-combine32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-combine64.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-compose-accessors.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-compose.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-compute-region.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-edge-accessors.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-edge.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-image.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-pict.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-region16.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-region32.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-source.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-timer.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-transformed-accessors.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-transformed.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-trap.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_1_la-pixman-utils.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_mmx_la-pixman-mmx.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_sse_la-pixman-sse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-access-accessors.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-access.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-combine.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-compose-accessors.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-compose.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-compute-region.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-edge-accessors.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-edge.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-image.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-pict.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-region.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-source.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-timer.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-transformed-accessors.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-transformed.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-trap.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixman-utils.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_sse2_la-pixman-sse2.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libpixman_vmx_la-pixman-vmx.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@@ -393,6 +442,139 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+libpixman_1_la-pixman-access.lo: pixman-access.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-access.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-access.Tpo" -c -o libpixman_1_la-pixman-access.lo `test -f 'pixman-access.c' || echo '$(srcdir)/'`pixman-access.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-access.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-access.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-access.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-access.c' object='libpixman_1_la-pixman-access.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-access.lo `test -f 'pixman-access.c' || echo '$(srcdir)/'`pixman-access.c
+
+libpixman_1_la-pixman-access-accessors.lo: pixman-access-accessors.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-access-accessors.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-access-accessors.Tpo" -c -o libpixman_1_la-pixman-access-accessors.lo `test -f 'pixman-access-accessors.c' || echo '$(srcdir)/'`pixman-access-accessors.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-access-accessors.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-access-accessors.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-access-accessors.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-access-accessors.c' object='libpixman_1_la-pixman-access-accessors.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-access-accessors.lo `test -f 'pixman-access-accessors.c' || echo '$(srcdir)/'`pixman-access-accessors.c
+
+libpixman_1_la-pixman-region16.lo: pixman-region16.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-region16.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-region16.Tpo" -c -o libpixman_1_la-pixman-region16.lo `test -f 'pixman-region16.c' || echo '$(srcdir)/'`pixman-region16.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-region16.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-region16.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-region16.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-region16.c' object='libpixman_1_la-pixman-region16.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-region16.lo `test -f 'pixman-region16.c' || echo '$(srcdir)/'`pixman-region16.c
+
+libpixman_1_la-pixman-region32.lo: pixman-region32.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-region32.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-region32.Tpo" -c -o libpixman_1_la-pixman-region32.lo `test -f 'pixman-region32.c' || echo '$(srcdir)/'`pixman-region32.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-region32.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-region32.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-region32.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-region32.c' object='libpixman_1_la-pixman-region32.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-region32.lo `test -f 'pixman-region32.c' || echo '$(srcdir)/'`pixman-region32.c
+
+libpixman_1_la-pixman-image.lo: pixman-image.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-image.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-image.Tpo" -c -o libpixman_1_la-pixman-image.lo `test -f 'pixman-image.c' || echo '$(srcdir)/'`pixman-image.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-image.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-image.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-image.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-image.c' object='libpixman_1_la-pixman-image.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-image.lo `test -f 'pixman-image.c' || echo '$(srcdir)/'`pixman-image.c
+
+libpixman_1_la-pixman-combine32.lo: pixman-combine32.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-combine32.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-combine32.Tpo" -c -o libpixman_1_la-pixman-combine32.lo `test -f 'pixman-combine32.c' || echo '$(srcdir)/'`pixman-combine32.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-combine32.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-combine32.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-combine32.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-combine32.c' object='libpixman_1_la-pixman-combine32.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-combine32.lo `test -f 'pixman-combine32.c' || echo '$(srcdir)/'`pixman-combine32.c
+
+libpixman_1_la-pixman-combine64.lo: pixman-combine64.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-combine64.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-combine64.Tpo" -c -o libpixman_1_la-pixman-combine64.lo `test -f 'pixman-combine64.c' || echo '$(srcdir)/'`pixman-combine64.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-combine64.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-combine64.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-combine64.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-combine64.c' object='libpixman_1_la-pixman-combine64.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-combine64.lo `test -f 'pixman-combine64.c' || echo '$(srcdir)/'`pixman-combine64.c
+
+libpixman_1_la-pixman-compose.lo: pixman-compose.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-compose.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-compose.Tpo" -c -o libpixman_1_la-pixman-compose.lo `test -f 'pixman-compose.c' || echo '$(srcdir)/'`pixman-compose.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-compose.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-compose.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-compose.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-compose.c' object='libpixman_1_la-pixman-compose.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-compose.lo `test -f 'pixman-compose.c' || echo '$(srcdir)/'`pixman-compose.c
+
+libpixman_1_la-pixman-compose-accessors.lo: pixman-compose-accessors.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-compose-accessors.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-compose-accessors.Tpo" -c -o libpixman_1_la-pixman-compose-accessors.lo `test -f 'pixman-compose-accessors.c' || echo '$(srcdir)/'`pixman-compose-accessors.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-compose-accessors.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-compose-accessors.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-compose-accessors.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-compose-accessors.c' object='libpixman_1_la-pixman-compose-accessors.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-compose-accessors.lo `test -f 'pixman-compose-accessors.c' || echo '$(srcdir)/'`pixman-compose-accessors.c
+
+libpixman_1_la-pixman-pict.lo: pixman-pict.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-pict.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-pict.Tpo" -c -o libpixman_1_la-pixman-pict.lo `test -f 'pixman-pict.c' || echo '$(srcdir)/'`pixman-pict.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-pict.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-pict.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-pict.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-pict.c' object='libpixman_1_la-pixman-pict.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-pict.lo `test -f 'pixman-pict.c' || echo '$(srcdir)/'`pixman-pict.c
+
+libpixman_1_la-pixman-source.lo: pixman-source.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-source.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-source.Tpo" -c -o libpixman_1_la-pixman-source.lo `test -f 'pixman-source.c' || echo '$(srcdir)/'`pixman-source.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-source.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-source.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-source.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-source.c' object='libpixman_1_la-pixman-source.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-source.lo `test -f 'pixman-source.c' || echo '$(srcdir)/'`pixman-source.c
+
+libpixman_1_la-pixman-transformed.lo: pixman-transformed.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-transformed.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-transformed.Tpo" -c -o libpixman_1_la-pixman-transformed.lo `test -f 'pixman-transformed.c' || echo '$(srcdir)/'`pixman-transformed.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-transformed.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-transformed.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-transformed.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-transformed.c' object='libpixman_1_la-pixman-transformed.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-transformed.lo `test -f 'pixman-transformed.c' || echo '$(srcdir)/'`pixman-transformed.c
+
+libpixman_1_la-pixman-transformed-accessors.lo: pixman-transformed-accessors.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-transformed-accessors.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-transformed-accessors.Tpo" -c -o libpixman_1_la-pixman-transformed-accessors.lo `test -f 'pixman-transformed-accessors.c' || echo '$(srcdir)/'`pixman-transformed-accessors.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-transformed-accessors.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-transformed-accessors.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-transformed-accessors.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-transformed-accessors.c' object='libpixman_1_la-pixman-transformed-accessors.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-transformed-accessors.lo `test -f 'pixman-transformed-accessors.c' || echo '$(srcdir)/'`pixman-transformed-accessors.c
+
+libpixman_1_la-pixman-utils.lo: pixman-utils.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-utils.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-utils.Tpo" -c -o libpixman_1_la-pixman-utils.lo `test -f 'pixman-utils.c' || echo '$(srcdir)/'`pixman-utils.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-utils.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-utils.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-utils.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-utils.c' object='libpixman_1_la-pixman-utils.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-utils.lo `test -f 'pixman-utils.c' || echo '$(srcdir)/'`pixman-utils.c
+
+libpixman_1_la-pixman-edge.lo: pixman-edge.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-edge.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-edge.Tpo" -c -o libpixman_1_la-pixman-edge.lo `test -f 'pixman-edge.c' || echo '$(srcdir)/'`pixman-edge.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-edge.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-edge.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-edge.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-edge.c' object='libpixman_1_la-pixman-edge.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-edge.lo `test -f 'pixman-edge.c' || echo '$(srcdir)/'`pixman-edge.c
+
+libpixman_1_la-pixman-edge-accessors.lo: pixman-edge-accessors.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-edge-accessors.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-edge-accessors.Tpo" -c -o libpixman_1_la-pixman-edge-accessors.lo `test -f 'pixman-edge-accessors.c' || echo '$(srcdir)/'`pixman-edge-accessors.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-edge-accessors.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-edge-accessors.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-edge-accessors.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-edge-accessors.c' object='libpixman_1_la-pixman-edge-accessors.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-edge-accessors.lo `test -f 'pixman-edge-accessors.c' || echo '$(srcdir)/'`pixman-edge-accessors.c
+
+libpixman_1_la-pixman-trap.lo: pixman-trap.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-trap.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-trap.Tpo" -c -o libpixman_1_la-pixman-trap.lo `test -f 'pixman-trap.c' || echo '$(srcdir)/'`pixman-trap.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-trap.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-trap.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-trap.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-trap.c' object='libpixman_1_la-pixman-trap.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-trap.lo `test -f 'pixman-trap.c' || echo '$(srcdir)/'`pixman-trap.c
+
+libpixman_1_la-pixman-compute-region.lo: pixman-compute-region.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-compute-region.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-compute-region.Tpo" -c -o libpixman_1_la-pixman-compute-region.lo `test -f 'pixman-compute-region.c' || echo '$(srcdir)/'`pixman-compute-region.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-compute-region.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-compute-region.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-compute-region.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-compute-region.c' object='libpixman_1_la-pixman-compute-region.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-compute-region.lo `test -f 'pixman-compute-region.c' || echo '$(srcdir)/'`pixman-compute-region.c
+
+libpixman_1_la-pixman-timer.lo: pixman-timer.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -MT libpixman_1_la-pixman-timer.lo -MD -MP -MF "$(DEPDIR)/libpixman_1_la-pixman-timer.Tpo" -c -o libpixman_1_la-pixman-timer.lo `test -f 'pixman-timer.c' || echo '$(srcdir)/'`pixman-timer.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_1_la-pixman-timer.Tpo" "$(DEPDIR)/libpixman_1_la-pixman-timer.Plo"; else rm -f "$(DEPDIR)/libpixman_1_la-pixman-timer.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-timer.c' object='libpixman_1_la-pixman-timer.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_1_la_CFLAGS) $(CFLAGS) -c -o libpixman_1_la-pixman-timer.lo `test -f 'pixman-timer.c' || echo '$(srcdir)/'`pixman-timer.c
+
libpixman_mmx_la-pixman-mmx.lo: pixman-mmx.c
@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_mmx_la_CFLAGS) $(CFLAGS) -MT libpixman_mmx_la-pixman-mmx.lo -MD -MP -MF "$(DEPDIR)/libpixman_mmx_la-pixman-mmx.Tpo" -c -o libpixman_mmx_la-pixman-mmx.lo `test -f 'pixman-mmx.c' || echo '$(srcdir)/'`pixman-mmx.c; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_mmx_la-pixman-mmx.Tpo" "$(DEPDIR)/libpixman_mmx_la-pixman-mmx.Plo"; else rm -f "$(DEPDIR)/libpixman_mmx_la-pixman-mmx.Tpo"; exit 1; fi
@@ -400,12 +582,19 @@ libpixman_mmx_la-pixman-mmx.lo: pixman-mmx.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_mmx_la_CFLAGS) $(CFLAGS) -c -o libpixman_mmx_la-pixman-mmx.lo `test -f 'pixman-mmx.c' || echo '$(srcdir)/'`pixman-mmx.c
-libpixman_sse_la-pixman-sse.lo: pixman-sse.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_sse_la_CFLAGS) $(CFLAGS) -MT libpixman_sse_la-pixman-sse.lo -MD -MP -MF "$(DEPDIR)/libpixman_sse_la-pixman-sse.Tpo" -c -o libpixman_sse_la-pixman-sse.lo `test -f 'pixman-sse.c' || echo '$(srcdir)/'`pixman-sse.c; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_sse_la-pixman-sse.Tpo" "$(DEPDIR)/libpixman_sse_la-pixman-sse.Plo"; else rm -f "$(DEPDIR)/libpixman_sse_la-pixman-sse.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-sse.c' object='libpixman_sse_la-pixman-sse.lo' libtool=yes @AMDEPBACKSLASH@
+libpixman_sse2_la-pixman-sse2.lo: pixman-sse2.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_sse2_la_CFLAGS) $(CFLAGS) -MT libpixman_sse2_la-pixman-sse2.lo -MD -MP -MF "$(DEPDIR)/libpixman_sse2_la-pixman-sse2.Tpo" -c -o libpixman_sse2_la-pixman-sse2.lo `test -f 'pixman-sse2.c' || echo '$(srcdir)/'`pixman-sse2.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_sse2_la-pixman-sse2.Tpo" "$(DEPDIR)/libpixman_sse2_la-pixman-sse2.Plo"; else rm -f "$(DEPDIR)/libpixman_sse2_la-pixman-sse2.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-sse2.c' object='libpixman_sse2_la-pixman-sse2.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_sse2_la_CFLAGS) $(CFLAGS) -c -o libpixman_sse2_la-pixman-sse2.lo `test -f 'pixman-sse2.c' || echo '$(srcdir)/'`pixman-sse2.c
+
+libpixman_vmx_la-pixman-vmx.lo: pixman-vmx.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_vmx_la_CFLAGS) $(CFLAGS) -MT libpixman_vmx_la-pixman-vmx.lo -MD -MP -MF "$(DEPDIR)/libpixman_vmx_la-pixman-vmx.Tpo" -c -o libpixman_vmx_la-pixman-vmx.lo `test -f 'pixman-vmx.c' || echo '$(srcdir)/'`pixman-vmx.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libpixman_vmx_la-pixman-vmx.Tpo" "$(DEPDIR)/libpixman_vmx_la-pixman-vmx.Plo"; else rm -f "$(DEPDIR)/libpixman_vmx_la-pixman-vmx.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pixman-vmx.c' object='libpixman_vmx_la-pixman-vmx.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_sse_la_CFLAGS) $(CFLAGS) -c -o libpixman_sse_la-pixman-sse.lo `test -f 'pixman-sse.c' || echo '$(srcdir)/'`pixman-sse.c
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libpixman_vmx_la_CFLAGS) $(CFLAGS) -c -o libpixman_vmx_la-pixman-vmx.lo `test -f 'pixman-vmx.c' || echo '$(srcdir)/'`pixman-vmx.c
mostlyclean-libtool:
-rm -f *.lo
@@ -533,6 +722,7 @@ install-strip:
mostlyclean-generic:
clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
@@ -606,6 +796,16 @@ uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
tags uninstall uninstall-am uninstall-info-am \
uninstall-libLTLIBRARIES uninstall-libpixmanincludeHEADERS
+
+pixman-combine32.c : combine.inc pixman-combine32.h combine.pl
+ $(PERL) $(srcdir)/combine.pl 8 < $(srcdir)/combine.inc > $@ || ($(RM) $@; exit 1)
+pixman-combine32.h : combine.h.inc combine.pl
+ $(PERL) $(srcdir)/combine.pl 8 < $(srcdir)/combine.h.inc > $@ || ($(RM) $@; exit 1)
+
+pixman-combine64.c : combine.inc pixman-combine64.h combine.pl
+ $(PERL) $(srcdir)/combine.pl 16 < $(srcdir)/combine.inc > $@ || ($(RM) $@; exit 1)
+pixman-combine64.h : combine.h.inc combine.pl
+ $(PERL) $(srcdir)/combine.pl 16 < $(srcdir)/combine.h.inc > $@ || ($(RM) $@; exit 1)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/lib/pixman/pixman/Makefile.win32 b/lib/pixman/pixman/Makefile.win32
index bee828902..ad30f8c46 100644
--- a/lib/pixman/pixman/Makefile.win32
+++ b/lib/pixman/pixman/Makefile.win32
@@ -3,32 +3,42 @@ LIBRARY = pixman-1
CC = cl
LINK = link
-ifeq ($(CFG),)
-CFG=release
+CFG_VAR = $(CFG)
+ifeq ($(CFG_VAR),)
+CFG_VAR=release
endif
-ifeq ($(MMX),)
-MMX=1
+MMX_VAR = $(MMX)
+ifeq ($(MMX_VAR),)
+MMX_VAR=on
+endif
+
+SSE2_VAR = $(SSE2)
+ifeq ($(SSE2_VAR),)
+SSE2_VAR=on
endif
CFLAGS = -MD -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -I../pixman/src -I. -DPACKAGE=$(LIBRARY) -DPACKAGE_VERSION="" -DPACKAGE_BUGREPORT=""
MMX_CFLAGS = -DUSE_MMX -w14710 -w14714
+SSE2_CFLAGS = -DUSE_SSE2
# optimization flags
-ifeq ($(CFG),debug)
+ifeq ($(CFG_VAR),debug)
CFLAGS += -Od -Zi
else
CFLAGS += -O2
endif
SOURCES = \
- pixman-region.c \
pixman-image.c \
pixman-access.c \
pixman-access-accessors.c \
- pixman-combine.c \
+ pixman-region16.c \
+ pixman-region32.c \
pixman-compose.c \
pixman-compose-accessors.c \
+ pixman-combine32.c \
+ pixman-combine64.c \
pixman-pict.c \
pixman-source.c \
pixman-transformed.c \
@@ -42,24 +52,31 @@ SOURCES = \
$(NULL)
# MMX compilation flags
-ifeq ($(MMX),1)
+ifeq ($(MMX_VAR),on)
CFLAGS += $(MMX_CFLAGS)
SOURCES += pixman-mmx.c
endif
-OBJECTS = $(patsubst %.c, $(CFG)/%.obj, $(SOURCES))
+# SSE2 compilation flags
+ifeq ($(SSE2_VAR),on)
+CFLAGS += $(SSE2_CFLAGS)
+SOURCES += pixman-sse2.c
+endif
+
+OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
# targets
-all: inform informMMX $(CFG)/$(LIBRARY).lib
+all: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib
@exit 0
clean: inform clean_r
@exit 0
-pixman: inform informMMX $(CFG)/$(LIBRARY).lib
+pixman: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib
@exit 0
inform:
ifneq ($(CFG),release)
ifneq ($(CFG),debug)
+ifneq ($(CFG),)
@echo "Invalid specified configuration option : "$(CFG)"."
@echo
@echo -n "Possible choices for configuration are "
@@ -67,26 +84,56 @@ ifneq ($(CFG),debug)
@echo ""
@exit 1
endif
+ @echo "Using default RELEASE configuration... (use CFG=release or CFG=debug)"
+endif
endif
informMMX:
-ifneq ($(MMX),0)
-ifneq ($(MMX),1)
- @echo "Invalid specified MMX option : "$(MMX)"."
+ifneq ($(MMX),off)
+ifneq ($(MMX),on)
+ifneq ($(MMX),)
+ @echo "Invalid specified MMX option : "$(MMX_VAR)"."
@echo
- @echo -n "Possible choices for MMX are 0 or 1"
+ @echo -n "Possible choices for MMX are 'on' or 'off'"
@echo ""
@exit 1
endif
+ @echo "Setting MMX flag to default value 'on'... (use MMX=on or MMX=off)"
+endif
+endif
+
+informSSE2:
+ifneq ($(SSE2),off)
+ifneq ($(SSE2),on)
+ifneq ($(SSE2),)
+ @echo "Invalid specified SSE option : "$(SSE2)"."
+ @echo
+ @echo -n "Possible choices for SSE2 are 'on' or 'off'"
+ @echo ""
+ @exit 1
+endif
+ @echo "Setting SSE2 flag to default value 'on'... (use SSE2=on or SSE2=off)"
+endif
endif
# pixman compilation and linking
-$(CFG)/%.obj: %.c
- @mkdir -p $(CFG)
+$(CFG_VAR)/%.obj: %.c
+ @mkdir -p $(CFG_VAR)
@$(CC) -c $(CFLAGS) -Fo"$@" $<
-$(CFG)/$(LIBRARY).lib: $(OBJECTS)
+$(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
lib -NOLOGO -OUT:$@ $(OBJECTS) || exit 0
+pixman-combine32.c: combine.inc pixman-combine32.h combine.pl
+ perl ./combine.pl 8 < $< > $@ || ($(RM) $@; exit 1)
+pixman-combine32.h: combine.h.inc combine.pl
+ perl ./combine.pl 8 < $< > $@ || ($(RM) $@; exit 1)
+
+pixman-combine64.c: combine.inc pixman-combine64.h combine.pl
+ perl ./combine.pl 16 < $< > $@ || ($(RM) $@; exit 1)
+pixman-combine64.h: combine.h.inc combine.pl
+ perl ./combine.pl 16 < $< > $@ || ($(RM) $@; exit 1)
+
clean_r:
- @rm -f $(CFG)/*.obj $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
+ @rm -f $(CFG_VAR)/*.obj $(CFG_VAR)/*.lib $(CFG_VAR)/*.pdb $(CFG)/*.ilk || exit 0
+ @rm -f $(CFG)/*.obj $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk pixman-combine32.c pixman-combine64.c || exit 0
diff --git a/lib/pixman/pixman/combine.h.inc b/lib/pixman/pixman/combine.h.inc
new file mode 100644
index 000000000..8c70cb78d
--- /dev/null
+++ b/lib/pixman/pixman/combine.h.inc
@@ -0,0 +1,227 @@
+
+#define COMPONENT_SIZE
+#define MASK
+#define ONE_HALF
+
+#define G_SHIFT
+#define B_SHIFT
+#define A_SHIFT
+#define G_MASK
+#define B_MASK
+#define A_MASK
+
+#define RB_MASK
+#define AG_MASK
+#define RB_ONE_HALF
+#define RB_MASK_PLUS_ONE
+
+#define Alpha(x) ((x) >> A_SHIFT)
+
+/*
+ * Helper macros.
+ */
+
+#define IntMult(a,b,t) ( (t) = (a) * (b) + ONE_HALF, ( ( ( (t)>>G_SHIFT ) + (t) )>>G_SHIFT ) )
+#define IntDiv(a,b) (((comp2_t) (a) * MASK) / (b))
+
+#define GetComp(v,i) ((comp2_t) (comp1_t) ((v) >> i))
+
+#define Add(x,y,i,t) ((t) = GetComp(x,i) + GetComp(y,i), \
+ (comp4_t) ((comp1_t) ((t) | (0 - ((t) >> G_SHIFT)))) << (i))
+
+#define FbGen(x,y,i,ax,ay,t,u,v) ((t) = (IntMult(GetComp(y,i),ay,(u)) + \
+ IntMult(GetComp(x,i),ax,(v))), \
+ (comp4_t) ((comp1_t) ((t) | \
+ (0 - ((t) >> G_SHIFT)))) << (i))
+
+/*
+ The methods below use some tricks to be able to do two color
+ components at the same time.
+*/
+
+/*
+ x_c = (x_c * a) / 255
+*/
+#define FbByteMul(x, a) do { \
+ comp4_t t = ((x & RB_MASK) * a) + RB_ONE_HALF; \
+ t = (t + ((t >> COMPONENT_SIZE) & RB_MASK)) >> COMPONENT_SIZE; \
+ t &= RB_MASK; \
+ \
+ x = (((x >> COMPONENT_SIZE) & RB_MASK) * a) + RB_ONE_HALF; \
+ x = (x + ((x >> COMPONENT_SIZE) & RB_MASK)); \
+ x &= RB_MASK << COMPONENT_SIZE; \
+ x += t; \
+ } while (0)
+
+/*
+ x_c = (x_c * a) / 255 + y
+*/
+#define FbByteMulAdd(x, a, y) do { \
+ /* multiply and divide: trunc((i + 128)*257/65536) */ \
+ comp4_t t = ((x & RB_MASK) * a) + RB_ONE_HALF; \
+ t = (t + ((t >> COMPONENT_SIZE) & RB_MASK)) >> COMPONENT_SIZE; \
+ t &= RB_MASK; \
+ \
+ /* add */ \
+ t += y & RB_MASK; \
+ \
+ /* saturate */ \
+ t |= RB_MASK_PLUS_ONE - ((t >> COMPONENT_SIZE) & RB_MASK); \
+ t &= RB_MASK; \
+ \
+ /* multiply and divide */ \
+ x = (((x >> COMPONENT_SIZE) & RB_MASK) * a) + RB_ONE_HALF; \
+ x = (x + ((x >> COMPONENT_SIZE) & RB_MASK)) >> COMPONENT_SIZE; \
+ x &= RB_MASK; \
+ \
+ /* add */ \
+ x += (y >> COMPONENT_SIZE) & RB_MASK; \
+ \
+ /* saturate */ \
+ x |= RB_MASK_PLUS_ONE - ((x >> COMPONENT_SIZE) & RB_MASK); \
+ x &= RB_MASK; \
+ \
+ /* recombine */ \
+ x <<= COMPONENT_SIZE; \
+ x += t; \
+ } while (0)
+
+/*
+ x_c = (x_c * a + y_c * b) / 255
+*/
+#define FbByteAddMul(x, a, y, b) do { \
+ comp4_t t; \
+ comp4_t r = (x >> A_SHIFT) * a + (y >> A_SHIFT) * b + ONE_HALF; \
+ r += (r >> G_SHIFT); \
+ r >>= G_SHIFT; \
+ \
+ t = (x & G_MASK) * a + (y & G_MASK) * b; \
+ t += (t >> G_SHIFT) + (ONE_HALF << G_SHIFT); \
+ t >>= B_SHIFT; \
+ \
+ t |= r << B_SHIFT; \
+ t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
+ t &= RB_MASK; \
+ t <<= G_SHIFT; \
+ \
+ r = ((x >> B_SHIFT) & MASK) * a + \
+ ((y >> B_SHIFT) & MASK) * b + ONE_HALF; \
+ r += (r >> G_SHIFT); \
+ r >>= G_SHIFT; \
+ \
+ x = (x & MASK) * a + (y & MASK) * b + ONE_HALF; \
+ x += (x >> G_SHIFT); \
+ x >>= G_SHIFT; \
+ x |= r << B_SHIFT; \
+ x |= RB_MASK_PLUS_ONE - ((x >> G_SHIFT) & RB_MASK); \
+ x &= RB_MASK; \
+ x |= t; \
+ } while (0)
+
+/*
+ x_c = (x_c * a + y_c *b) / 256
+*/
+#define FbByteAddMul_256(x, a, y, b) do { \
+ comp4_t t = (x & RB_MASK) * a + (y & RB_MASK) * b; \
+ t >>= G_SHIFT; \
+ t &= RB_MASK; \
+ \
+ x = ((x >> G_SHIFT) & RB_MASK) * a + \
+ ((y >> G_SHIFT) & RB_MASK) * b; \
+ x &= AG_MASK; \
+ x += t; \
+ } while (0)
+
+/*
+ x_c = (x_c * a_c) / 255
+*/
+#define FbByteMulC(x, a) do { \
+ comp4_t t; \
+ comp4_t r = (x & MASK) * (a & MASK); \
+ r |= (x & B_MASK) * ((a >> B_SHIFT) & MASK); \
+ r += RB_ONE_HALF; \
+ r = (r + ((r >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \
+ r &= RB_MASK; \
+ \
+ x >>= G_SHIFT; \
+ t = (x & MASK) * ((a >> G_SHIFT) & MASK); \
+ t |= (x & B_MASK) * (a >> A_SHIFT); \
+ t += RB_ONE_HALF; \
+ t = t + ((t >> G_SHIFT) & RB_MASK); \
+ x = r | (t & AG_MASK); \
+ } while (0)
+
+/*
+ x_c = (x_c * a) / 255 + y
+*/
+#define FbByteMulAddC(x, a, y) do { \
+ comp4_t t; \
+ comp4_t r = (x & MASK) * (a & MASK); \
+ r |= (x & B_MASK) * ((a >> B_SHIFT) & MASK); \
+ r += RB_ONE_HALF; \
+ r = (r + ((r >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \
+ r &= RB_MASK; \
+ r += y & RB_MASK; \
+ r |= RB_MASK_PLUS_ONE - ((r >> G_SHIFT) & RB_MASK); \
+ r &= RB_MASK; \
+ \
+ x >>= G_SHIFT; \
+ t = (x & MASK) * ((a >> G_SHIFT) & MASK); \
+ t |= (x & B_MASK) * (a >> A_SHIFT); \
+ t += RB_ONE_HALF; \
+ t = (t + ((t >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \
+ t &= RB_MASK; \
+ t += (y >> G_SHIFT) & RB_MASK; \
+ t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
+ t &= RB_MASK; \
+ x = r | (t << G_SHIFT); \
+ } while (0)
+
+/*
+ x_c = (x_c * a_c + y_c * b) / 255
+*/
+#define FbByteAddMulC(x, a, y, b) do { \
+ comp4_t t; \
+ comp4_t r = (x >> A_SHIFT) * (a >> A_SHIFT) + \
+ (y >> A_SHIFT) * b; \
+ r += (r >> G_SHIFT) + ONE_HALF; \
+ r >>= G_SHIFT; \
+ \
+ t = (x & G_MASK) * ((a >> G_SHIFT) & MASK) + (y & G_MASK) * b; \
+ t += (t >> G_SHIFT) + (ONE_HALF << G_SHIFT); \
+ t >>= B_SHIFT; \
+ \
+ t |= r << B_SHIFT; \
+ t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
+ t &= RB_MASK; \
+ t <<= G_SHIFT; \
+ \
+ r = ((x >> B_SHIFT) & MASK) * ((a >> B_SHIFT) & MASK) + \
+ ((y >> B_SHIFT) & MASK) * b + ONE_HALF; \
+ r += (r >> G_SHIFT); \
+ r >>= G_SHIFT; \
+ \
+ x = (x & MASK) * (a & MASK) + (y & MASK) * b + ONE_HALF; \
+ x += (x >> G_SHIFT); \
+ x >>= G_SHIFT; \
+ x |= r << B_SHIFT; \
+ x |= RB_MASK_PLUS_ONE - ((x >> G_SHIFT) & RB_MASK); \
+ x &= RB_MASK; \
+ x |= t; \
+ } while (0)
+
+/*
+ x_c = min(x_c + y_c, 255)
+*/
+#define FbByteAdd(x, y) do { \
+ comp4_t t; \
+ comp4_t r = (x & RB_MASK) + (y & RB_MASK); \
+ r |= RB_MASK_PLUS_ONE - ((r >> G_SHIFT) & RB_MASK); \
+ r &= RB_MASK; \
+ \
+ t = ((x >> G_SHIFT) & RB_MASK) + ((y >> G_SHIFT) & RB_MASK); \
+ t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \
+ r |= (t & RB_MASK) << G_SHIFT; \
+ x = r; \
+ } while (0)
+
diff --git a/lib/pixman/pixman/pixman-combine.c b/lib/pixman/pixman/combine.inc
index 0d9c066c7..9f88dee15 100644
--- a/lib/pixman/pixman/pixman-combine.c
+++ b/lib/pixman/pixman/combine.inc
@@ -5,6 +5,9 @@
#include <string.h>
#include "pixman-private.h"
+
+#include "pixman-combine.h"
+
/*
* There are two ways of handling alpha -- either as a single unified value or
* a separate value for each component, hence each macro must have two
@@ -17,13 +20,13 @@
/*
* Combine src and mask
*/
-FASTCALL void
-pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int width)
+FASTCALL static void
+pixman_fbCombineMaskU (comp4_t *src, const comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t a = *(mask + i) >> 24;
- uint32_t s = *(src + i);
+ comp4_t a = *(mask + i) >> A_SHIFT;
+ comp4_t s = *(src + i);
FbByteMul(s, a);
*(src + i) = s;
}
@@ -34,26 +37,26 @@ pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int width)
*/
FASTCALL static void
-fbCombineClear (uint32_t *dest, const uint32_t *src, int width)
+fbCombineClear (comp4_t *dest, const comp4_t *src, int width)
{
- memset(dest, 0, width*sizeof(uint32_t));
+ memset(dest, 0, width*sizeof(comp4_t));
}
FASTCALL static void
-fbCombineSrcU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineSrcU (comp4_t *dest, const comp4_t *src, int width)
{
- memcpy(dest, src, width*sizeof(uint32_t));
+ memcpy(dest, src, width*sizeof(comp4_t));
}
/* if the Src is opaque, call fbCombineSrcU */
FASTCALL static void
-fbCombineOverU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineOverU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t ia = Alpha(~s);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t ia = Alpha(~s);
FbByteMulAdd(d, ia, s);
*(dest + i) = d;
@@ -62,13 +65,13 @@ fbCombineOverU (uint32_t *dest, const uint32_t *src, int width)
/* if the Dst is opaque, this is a noop */
FASTCALL static void
-fbCombineOverReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineOverReverseU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t ia = Alpha(~*(dest + i));
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t ia = Alpha(~*(dest + i));
FbByteMulAdd(s, ia, d);
*(dest + i) = s;
}
@@ -76,12 +79,12 @@ fbCombineOverReverseU (uint32_t *dest, const uint32_t *src, int width)
/* if the Dst is opaque, call fbCombineSrcU */
FASTCALL static void
-fbCombineInU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineInU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t a = Alpha(*(dest + i));
+ comp4_t s = *(src + i);
+ comp4_t a = Alpha(*(dest + i));
FbByteMul(s, a);
*(dest + i) = s;
}
@@ -89,12 +92,12 @@ fbCombineInU (uint32_t *dest, const uint32_t *src, int width)
/* if the Src is opaque, this is a noop */
FASTCALL static void
-fbCombineInReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineInReverseU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t a = Alpha(*(src + i));
+ comp4_t d = *(dest + i);
+ comp4_t a = Alpha(*(src + i));
FbByteMul(d, a);
*(dest + i) = d;
}
@@ -102,12 +105,12 @@ fbCombineInReverseU (uint32_t *dest, const uint32_t *src, int width)
/* if the Dst is opaque, call fbCombineClear */
FASTCALL static void
-fbCombineOutU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineOutU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t a = Alpha(~*(dest + i));
+ comp4_t s = *(src + i);
+ comp4_t a = Alpha(~*(dest + i));
FbByteMul(s, a);
*(dest + i) = s;
}
@@ -115,12 +118,12 @@ fbCombineOutU (uint32_t *dest, const uint32_t *src, int width)
/* if the Src is opaque, call fbCombineClear */
FASTCALL static void
-fbCombineOutReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineOutReverseU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t a = Alpha(~*(src + i));
+ comp4_t d = *(dest + i);
+ comp4_t a = Alpha(~*(src + i));
FbByteMul(d, a);
*(dest + i) = d;
}
@@ -130,14 +133,14 @@ fbCombineOutReverseU (uint32_t *dest, const uint32_t *src, int width)
/* if the Dst is opaque, call fbCombineOverU */
/* if both the Src and Dst are opaque, call fbCombineSrcU */
FASTCALL static void
-fbCombineAtopU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineAtopU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t dest_a = Alpha(d);
- uint32_t src_ia = Alpha(~s);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t dest_a = Alpha(d);
+ comp4_t src_ia = Alpha(~s);
FbByteAddMul(s, dest_a, d, src_ia);
*(dest + i) = s;
@@ -148,14 +151,14 @@ fbCombineAtopU (uint32_t *dest, const uint32_t *src, int width)
/* if the Dst is opaque, call fbCombineInReverseU */
/* if both the Src and Dst are opaque, call fbCombineDstU */
FASTCALL static void
-fbCombineAtopReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineAtopReverseU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t src_a = Alpha(s);
- uint32_t dest_ia = Alpha(~d);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t src_a = Alpha(s);
+ comp4_t dest_ia = Alpha(~d);
FbByteAddMul(s, dest_ia, d, src_a);
*(dest + i) = s;
@@ -166,14 +169,14 @@ fbCombineAtopReverseU (uint32_t *dest, const uint32_t *src, int width)
/* if the Dst is opaque, call fbCombineOverReverseU */
/* if both the Src and Dst are opaque, call fbCombineClear */
FASTCALL static void
-fbCombineXorU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineXorU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t src_ia = Alpha(~s);
- uint32_t dest_ia = Alpha(~d);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t src_ia = Alpha(~s);
+ comp4_t dest_ia = Alpha(~d);
FbByteAddMul(s, dest_ia, d, src_ia);
*(dest + i) = s;
@@ -181,12 +184,12 @@ fbCombineXorU (uint32_t *dest, const uint32_t *src, int width)
}
FASTCALL static void
-fbCombineAddU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineAddU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
FbByteAdd(d, s);
*(dest + i) = d;
}
@@ -196,19 +199,19 @@ fbCombineAddU (uint32_t *dest, const uint32_t *src, int width)
/* if the Dst is opaque, call fbCombineAddU */
/* if both the Src and Dst are opaque, call fbCombineAddU */
FASTCALL static void
-fbCombineSaturateU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineSaturateU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint16_t sa, da;
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp2_t sa, da;
- sa = s >> 24;
- da = ~d >> 24;
+ sa = s >> A_SHIFT;
+ da = ~d >> A_SHIFT;
if (sa > da)
{
- sa = FbIntDiv(da, sa);
+ sa = IntDiv(da, sa);
FbByteMul(s, sa);
};
FbByteAdd(d, s);
@@ -257,20 +260,20 @@ fbCombineSaturateU (uint32_t *dest, const uint32_t *src, int width)
#define CombineXor (CombineAOut|CombineBOut)
/* portion covered by a but not b */
-FASTCALL static uint8_t
-fbCombineDisjointOutPart (uint8_t a, uint8_t b)
+FASTCALL static comp1_t
+fbCombineDisjointOutPart (comp1_t a, comp1_t b)
{
/* min (1, (1-b) / a) */
b = ~b; /* 1 - b */
if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */
- return 0xff; /* 1 */
- return FbIntDiv(b,a); /* (1-b) / a */
+ return MASK; /* 1 */
+ return IntDiv(b,a); /* (1-b) / a */
}
/* portion covered by both a and b */
-FASTCALL static uint8_t
-fbCombineDisjointInPart (uint8_t a, uint8_t b)
+FASTCALL static comp1_t
+fbCombineDisjointInPart (comp1_t a, comp1_t b)
{
/* max (1-(1-b)/a,0) */
/* = - min ((1-b)/a - 1, 0) */
@@ -279,12 +282,12 @@ fbCombineDisjointInPart (uint8_t a, uint8_t b)
b = ~b; /* 1 - b */
if (b >= a) /* 1 - b >= a -> (1-b)/a >= 1 */
return 0; /* 1 - 1 */
- return ~FbIntDiv(b,a); /* 1 - (1-b) / a */
+ return ~IntDiv(b,a); /* 1 - (1-b) / a */
}
/* portion covered by a but not b */
-FASTCALL static uint8_t
-fbCombineConjointOutPart (uint8_t a, uint8_t b)
+FASTCALL static comp1_t
+fbCombineConjointOutPart (comp1_t a, comp1_t b)
{
/* max (1-b/a,0) */
/* = 1-min(b/a,1) */
@@ -293,31 +296,31 @@ fbCombineConjointOutPart (uint8_t a, uint8_t b)
if (b >= a) /* b >= a -> b/a >= 1 */
return 0x00; /* 0 */
- return ~FbIntDiv(b,a); /* 1 - b/a */
+ return ~IntDiv(b,a); /* 1 - b/a */
}
/* portion covered by both a and b */
-FASTCALL static uint8_t
-fbCombineConjointInPart (uint8_t a, uint8_t b)
+FASTCALL static comp1_t
+fbCombineConjointInPart (comp1_t a, comp1_t b)
{
/* min (1,b/a) */
if (b >= a) /* b >= a -> b/a >= 1 */
- return 0xff; /* 1 */
- return FbIntDiv(b,a); /* b/a */
+ return MASK; /* 1 */
+ return IntDiv(b,a); /* b/a */
}
FASTCALL static void
-fbCombineDisjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8_t combine)
+fbCombineDisjointGeneralU (comp4_t *dest, const comp4_t *src, int width, comp1_t combine)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t m,n,o,p;
- uint16_t Fa, Fb, t, u, v;
- uint8_t sa = s >> 24;
- uint8_t da = d >> 24;
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t m,n,o,p;
+ comp2_t Fa, Fb, t, u, v;
+ comp1_t sa = s >> A_SHIFT;
+ comp1_t da = d >> A_SHIFT;
switch (combine & CombineA) {
default:
@@ -330,7 +333,7 @@ fbCombineDisjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8
Fa = fbCombineDisjointInPart (sa, da);
break;
case CombineA:
- Fa = 0xff;
+ Fa = MASK;
break;
}
@@ -345,32 +348,32 @@ fbCombineDisjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8
Fb = fbCombineDisjointInPart (da, sa);
break;
case CombineB:
- Fb = 0xff;
+ Fb = MASK;
break;
}
m = FbGen (s,d,0,Fa,Fb,t, u, v);
- n = FbGen (s,d,8,Fa,Fb,t, u, v);
- o = FbGen (s,d,16,Fa,Fb,t, u, v);
- p = FbGen (s,d,24,Fa,Fb,t, u, v);
+ n = FbGen (s,d,G_SHIFT,Fa,Fb,t, u, v);
+ o = FbGen (s,d,B_SHIFT,Fa,Fb,t, u, v);
+ p = FbGen (s,d,A_SHIFT,Fa,Fb,t, u, v);
s = m|n|o|p;
*(dest + i) = s;
}
}
FASTCALL static void
-fbCombineDisjointOverU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointOverU (comp4_t *dest, const comp4_t *src, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint16_t a = s >> 24;
+ comp4_t s = *(src + i);
+ comp2_t a = s >> A_SHIFT;
if (a != 0x00)
{
- if (a != 0xff)
+ if (a != MASK)
{
- uint32_t d = *(dest + i);
- a = fbCombineDisjointOutPart (d >> 24, a);
+ comp4_t d = *(dest + i);
+ a = fbCombineDisjointOutPart (d >> A_SHIFT, a);
FbByteMulAdd(d, a, s);
s = d;
}
@@ -380,58 +383,58 @@ fbCombineDisjointOverU (uint32_t *dest, const uint32_t *src, int width)
}
FASTCALL static void
-fbCombineDisjointInU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointInU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineAIn);
}
FASTCALL static void
-fbCombineDisjointInReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointInReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineBIn);
}
FASTCALL static void
-fbCombineDisjointOutU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointOutU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineAOut);
}
FASTCALL static void
-fbCombineDisjointOutReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointOutReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineBOut);
}
FASTCALL static void
-fbCombineDisjointAtopU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointAtopU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineAAtop);
}
FASTCALL static void
-fbCombineDisjointAtopReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointAtopReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineBAtop);
}
FASTCALL static void
-fbCombineDisjointXorU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineDisjointXorU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineDisjointGeneralU (dest, src, width, CombineXor);
}
FASTCALL static void
-fbCombineConjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8_t combine)
+fbCombineConjointGeneralU (comp4_t *dest, const comp4_t *src, int width, comp1_t combine)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t d = *(dest + i);
- uint32_t m,n,o,p;
- uint16_t Fa, Fb, t, u, v;
- uint8_t sa = s >> 24;
- uint8_t da = d >> 24;
+ comp4_t s = *(src + i);
+ comp4_t d = *(dest + i);
+ comp4_t m,n,o,p;
+ comp2_t Fa, Fb, t, u, v;
+ comp1_t sa = s >> A_SHIFT;
+ comp1_t da = d >> A_SHIFT;
switch (combine & CombineA) {
default:
@@ -444,7 +447,7 @@ fbCombineConjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8
Fa = fbCombineConjointInPart (sa, da);
break;
case CombineA:
- Fa = 0xff;
+ Fa = MASK;
break;
}
@@ -459,71 +462,71 @@ fbCombineConjointGeneralU (uint32_t *dest, const uint32_t *src, int width, uint8
Fb = fbCombineConjointInPart (da, sa);
break;
case CombineB:
- Fb = 0xff;
+ Fb = MASK;
break;
}
m = FbGen (s,d,0,Fa,Fb,t, u, v);
- n = FbGen (s,d,8,Fa,Fb,t, u, v);
- o = FbGen (s,d,16,Fa,Fb,t, u, v);
- p = FbGen (s,d,24,Fa,Fb,t, u, v);
+ n = FbGen (s,d,G_SHIFT,Fa,Fb,t, u, v);
+ o = FbGen (s,d,B_SHIFT,Fa,Fb,t, u, v);
+ p = FbGen (s,d,A_SHIFT,Fa,Fb,t, u, v);
s = m|n|o|p;
*(dest + i) = s;
}
}
FASTCALL static void
-fbCombineConjointOverU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointOverU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineAOver);
}
FASTCALL static void
-fbCombineConjointOverReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointOverReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineBOver);
}
FASTCALL static void
-fbCombineConjointInU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointInU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineAIn);
}
FASTCALL static void
-fbCombineConjointInReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointInReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineBIn);
}
FASTCALL static void
-fbCombineConjointOutU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointOutU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineAOut);
}
FASTCALL static void
-fbCombineConjointOutReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointOutReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineBOut);
}
FASTCALL static void
-fbCombineConjointAtopU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointAtopU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineAAtop);
}
FASTCALL static void
-fbCombineConjointAtopReverseU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointAtopReverseU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineBAtop);
}
FASTCALL static void
-fbCombineConjointXorU (uint32_t *dest, const uint32_t *src, int width)
+fbCombineConjointXorU (comp4_t *dest, const comp4_t *src, int width)
{
fbCombineConjointGeneralU (dest, src, width, CombineXor);
}
@@ -533,12 +536,12 @@ fbCombineConjointXorU (uint32_t *dest, const uint32_t *src, int width)
/********************************************************************************/
FASTCALL static void
-fbCombineMaskC (uint32_t *src, uint32_t *mask)
+fbCombineMaskC (comp4_t *src, comp4_t *mask)
{
- uint32_t a = *mask;
+ comp4_t a = *mask;
- uint32_t x;
- uint16_t xa;
+ comp4_t x;
+ comp2_t xa;
if (!a)
{
@@ -547,16 +550,16 @@ fbCombineMaskC (uint32_t *src, uint32_t *mask)
}
x = *(src);
- if (a == 0xffffffff)
+ if (a == ~0)
{
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
+ x = x >> A_SHIFT;
+ x |= x << G_SHIFT;
+ x |= x << B_SHIFT;
*(mask) = x;
return;
}
- xa = x >> 24;
+ xa = x >> A_SHIFT;
FbByteMulC(x, a);
*(src) = x;
FbByteMul(a, xa);
@@ -564,10 +567,10 @@ fbCombineMaskC (uint32_t *src, uint32_t *mask)
}
FASTCALL static void
-fbCombineMaskValueC (uint32_t *src, const uint32_t *mask)
+fbCombineMaskValueC (comp4_t *src, const comp4_t *mask)
{
- uint32_t a = *mask;
- uint32_t x;
+ comp4_t a = *mask;
+ comp4_t x;
if (!a)
{
@@ -575,7 +578,7 @@ fbCombineMaskValueC (uint32_t *src, const uint32_t *mask)
return;
}
- if (a == 0xffffffff)
+ if (a == ~0)
return;
x = *(src);
@@ -584,22 +587,22 @@ fbCombineMaskValueC (uint32_t *src, const uint32_t *mask)
}
FASTCALL static void
-fbCombineMaskAlphaC (const uint32_t *src, uint32_t *mask)
+fbCombineMaskAlphaC (const comp4_t *src, comp4_t *mask)
{
- uint32_t a = *(mask);
- uint32_t x;
+ comp4_t a = *(mask);
+ comp4_t x;
if (!a)
return;
- x = *(src) >> 24;
- if (x == 0xff)
+ x = *(src) >> A_SHIFT;
+ if (x == MASK)
return;
- if (a == 0xffffffff)
+ if (a == ~0)
{
- x = x >> 24;
- x |= x << 8;
- x |= x << 16;
+ x = x >> A_SHIFT;
+ x |= x << G_SHIFT;
+ x |= x << B_SHIFT;
*(mask) = x;
return;
}
@@ -611,19 +614,19 @@ fbCombineMaskAlphaC (const uint32_t *src, uint32_t *mask)
FASTCALL static void
-fbCombineClearC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineClearC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
- memset(dest, 0, width*sizeof(uint32_t));
+ memset(dest, 0, width*sizeof(comp4_t));
}
FASTCALL static void
-fbCombineSrcC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineSrcC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
fbCombineMaskValueC (&s, &m);
@@ -632,23 +635,23 @@ fbCombineSrcC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineOverC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t a;
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t a;
fbCombineMaskC (&s, &m);
a = ~m;
- if (a != 0xffffffff)
+ if (a != ~0)
{
if (a)
{
- uint32_t d = *(dest + i);
+ comp4_t d = *(dest + i);
FbByteMulAddC(d, a, s);
s = d;
}
@@ -658,22 +661,22 @@ fbCombineOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineOverReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t a = ~d >> 24;
+ comp4_t d = *(dest + i);
+ comp4_t a = ~d >> A_SHIFT;
if (a)
{
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
fbCombineMaskValueC (&s, &m);
- if (a != 0xff)
+ if (a != MASK)
{
FbByteMulAdd(s, a, d);
}
@@ -683,21 +686,21 @@ fbCombineOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineInC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint16_t a = d >> 24;
- uint32_t s = 0;
+ comp4_t d = *(dest + i);
+ comp2_t a = d >> A_SHIFT;
+ comp4_t s = 0;
if (a)
{
- uint32_t m = *(mask + i);
+ comp4_t m = *(mask + i);
s = *(src + i);
fbCombineMaskValueC (&s, &m);
- if (a != 0xff)
+ if (a != MASK)
{
FbByteMul(s, a);
}
@@ -707,21 +710,21 @@ fbCombineInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineInReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t a;
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t a;
fbCombineMaskAlphaC (&s, &m);
a = m;
- if (a != 0xffffffff)
+ if (a != ~0)
{
- uint32_t d = 0;
+ comp4_t d = 0;
if (a)
{
d = *(dest + i);
@@ -733,22 +736,22 @@ fbCombineInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineOutC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint16_t a = ~d >> 24;
- uint32_t s = 0;
+ comp4_t d = *(dest + i);
+ comp2_t a = ~d >> A_SHIFT;
+ comp4_t s = 0;
if (a)
{
- uint32_t m = *(mask + i);
+ comp4_t m = *(mask + i);
s = *(src + i);
fbCombineMaskValueC (&s, &m);
- if (a != 0xff)
+ if (a != MASK)
{
FbByteMul(s, a);
}
@@ -758,21 +761,21 @@ fbCombineOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineOutReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t a;
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t a;
fbCombineMaskAlphaC (&s, &m);
a = ~m;
- if (a != 0xffffffff)
+ if (a != ~0)
{
- uint32_t d = 0;
+ comp4_t d = 0;
if (a)
{
d = *(dest + i);
@@ -784,16 +787,16 @@ fbCombineOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineAtopC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t ad;
- uint16_t as = d >> 24;
+ comp4_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t ad;
+ comp2_t as = d >> A_SHIFT;
fbCombineMaskC (&s, &m);
@@ -805,17 +808,17 @@ fbCombineAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineAtopReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t ad;
- uint16_t as = ~d >> 24;
+ comp4_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t ad;
+ comp2_t as = ~d >> A_SHIFT;
fbCombineMaskC (&s, &m);
@@ -827,16 +830,16 @@ fbCombineAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineXorC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t d = *(dest + i);
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t ad;
- uint16_t as = ~d >> 24;
+ comp4_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t ad;
+ comp2_t as = ~d >> A_SHIFT;
fbCombineMaskC (&s, &m);
@@ -848,14 +851,14 @@ fbCombineXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineAddC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineAddC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s = *(src + i);
- uint32_t m = *(mask + i);
- uint32_t d = *(dest + i);
+ comp4_t s = *(src + i);
+ comp4_t m = *(mask + i);
+ comp4_t d = *(dest + i);
fbCombineMaskValueC (&s, &m);
@@ -865,15 +868,15 @@ fbCombineAddC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
}
FASTCALL static void
-fbCombineSaturateC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineSaturateC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s, d;
- uint16_t sa, sr, sg, sb, da;
- uint16_t t, u, v;
- uint32_t m,n,o,p;
+ comp4_t s, d;
+ comp2_t sa, sr, sg, sb, da;
+ comp2_t t, u, v;
+ comp4_t m,n,o,p;
d = *(dest + i);
s = *(src + i);
@@ -881,53 +884,53 @@ fbCombineSaturateC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
fbCombineMaskC (&s, &m);
- sa = (m >> 24);
- sr = (m >> 16) & 0xff;
- sg = (m >> 8) & 0xff;
- sb = (m ) & 0xff;
- da = ~d >> 24;
+ sa = (m >> A_SHIFT);
+ sr = (m >> B_SHIFT) & MASK;
+ sg = (m >> G_SHIFT) & MASK;
+ sb = m & MASK;
+ da = ~d >> A_SHIFT;
if (sb <= da)
- m = FbAdd(s,d,0,t);
+ m = Add(s,d,0,t);
else
- m = FbGen (s, d, 0, (da << 8) / sb, 0xff, t, u, v);
+ m = FbGen (s, d, 0, (da << G_SHIFT) / sb, MASK, t, u, v);
if (sg <= da)
- n = FbAdd(s,d,8,t);
+ n = Add(s,d,G_SHIFT,t);
else
- n = FbGen (s, d, 8, (da << 8) / sg, 0xff, t, u, v);
+ n = FbGen (s, d, G_SHIFT, (da << G_SHIFT) / sg, MASK, t, u, v);
if (sr <= da)
- o = FbAdd(s,d,16,t);
+ o = Add(s,d,B_SHIFT,t);
else
- o = FbGen (s, d, 16, (da << 8) / sr, 0xff, t, u, v);
+ o = FbGen (s, d, B_SHIFT, (da << G_SHIFT) / sr, MASK, t, u, v);
if (sa <= da)
- p = FbAdd(s,d,24,t);
+ p = Add(s,d,A_SHIFT,t);
else
- p = FbGen (s, d, 24, (da << 8) / sa, 0xff, t, u, v);
+ p = FbGen (s, d, A_SHIFT, (da << G_SHIFT) / sa, MASK, t, u, v);
*(dest + i) = m|n|o|p;
}
}
FASTCALL static void
-fbCombineDisjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width, uint8_t combine)
+fbCombineDisjointGeneralC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width, comp1_t combine)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s, d;
- uint32_t m,n,o,p;
- uint32_t Fa, Fb;
- uint16_t t, u, v;
- uint32_t sa;
- uint8_t da;
+ comp4_t s, d;
+ comp4_t m,n,o,p;
+ comp4_t Fa, Fb;
+ comp2_t t, u, v;
+ comp4_t sa;
+ comp1_t da;
s = *(src + i);
m = *(mask + i);
d = *(dest + i);
- da = d >> 24;
+ da = d >> A_SHIFT;
fbCombineMaskC (&s, &m);
@@ -938,21 +941,21 @@ fbCombineDisjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int wi
Fa = 0;
break;
case CombineAOut:
- m = fbCombineDisjointOutPart ((uint8_t) (sa >> 0), da);
- n = fbCombineDisjointOutPart ((uint8_t) (sa >> 8), da) << 8;
- o = fbCombineDisjointOutPart ((uint8_t) (sa >> 16), da) << 16;
- p = fbCombineDisjointOutPart ((uint8_t) (sa >> 24), da) << 24;
+ m = (comp4_t)fbCombineDisjointOutPart ((comp1_t) (sa >> 0), da);
+ n = (comp4_t)fbCombineDisjointOutPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
+ o = (comp4_t)fbCombineDisjointOutPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ p = (comp4_t)fbCombineDisjointOutPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineAIn:
- m = fbCombineDisjointInPart ((uint8_t) (sa >> 0), da);
- n = fbCombineDisjointInPart ((uint8_t) (sa >> 8), da) << 8;
- o = fbCombineDisjointInPart ((uint8_t) (sa >> 16), da) << 16;
- p = fbCombineDisjointInPart ((uint8_t) (sa >> 24), da) << 24;
+ m = (comp4_t)fbCombineDisjointInPart ((comp1_t) (sa >> 0), da);
+ n = (comp4_t)fbCombineDisjointInPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
+ o = (comp4_t)fbCombineDisjointInPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ p = (comp4_t)fbCombineDisjointInPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineA:
- Fa = 0xffffffff;
+ Fa = ~0;
break;
}
@@ -961,97 +964,97 @@ fbCombineDisjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int wi
Fb = 0;
break;
case CombineBOut:
- m = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 0));
- n = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 8)) << 8;
- o = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 16)) << 16;
- p = fbCombineDisjointOutPart (da, (uint8_t) (sa >> 24)) << 24;
+ m = (comp4_t)fbCombineDisjointOutPart (da, (comp1_t) (sa >> 0));
+ n = (comp4_t)fbCombineDisjointOutPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
+ o = (comp4_t)fbCombineDisjointOutPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ p = (comp4_t)fbCombineDisjointOutPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineBIn:
- m = fbCombineDisjointInPart (da, (uint8_t) (sa >> 0));
- n = fbCombineDisjointInPart (da, (uint8_t) (sa >> 8)) << 8;
- o = fbCombineDisjointInPart (da, (uint8_t) (sa >> 16)) << 16;
- p = fbCombineDisjointInPart (da, (uint8_t) (sa >> 24)) << 24;
+ m = (comp4_t)fbCombineDisjointInPart (da, (comp1_t) (sa >> 0));
+ n = (comp4_t)fbCombineDisjointInPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
+ o = (comp4_t)fbCombineDisjointInPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ p = (comp4_t)fbCombineDisjointInPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineB:
- Fb = 0xffffffff;
+ Fb = ~0;
break;
}
- m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v);
- n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v);
- o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v);
- p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v);
+ m = FbGen (s,d,0,GetComp(Fa,0),GetComp(Fb,0),t, u, v);
+ n = FbGen (s,d,G_SHIFT,GetComp(Fa,G_SHIFT),GetComp(Fb,G_SHIFT),t, u, v);
+ o = FbGen (s,d,B_SHIFT,GetComp(Fa,B_SHIFT),GetComp(Fb,B_SHIFT),t, u, v);
+ p = FbGen (s,d,A_SHIFT,GetComp(Fa,A_SHIFT),GetComp(Fb,A_SHIFT),t, u, v);
s = m|n|o|p;
*(dest + i) = s;
}
}
FASTCALL static void
-fbCombineDisjointOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointOverC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOver);
}
FASTCALL static void
-fbCombineDisjointInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointInC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineAIn);
}
FASTCALL static void
-fbCombineDisjointInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointInReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineBIn);
}
FASTCALL static void
-fbCombineDisjointOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointOutC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineAOut);
}
FASTCALL static void
-fbCombineDisjointOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointOutReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineBOut);
}
FASTCALL static void
-fbCombineDisjointAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointAtopC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineAAtop);
}
FASTCALL static void
-fbCombineDisjointAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointAtopReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineBAtop);
}
FASTCALL static void
-fbCombineDisjointXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineDisjointXorC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineDisjointGeneralC (dest, src, mask, width, CombineXor);
}
FASTCALL static void
-fbCombineConjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width, uint8_t combine)
+fbCombineConjointGeneralC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width, comp1_t combine)
{
int i;
for (i = 0; i < width; ++i) {
- uint32_t s, d;
- uint32_t m,n,o,p;
- uint32_t Fa, Fb;
- uint16_t t, u, v;
- uint32_t sa;
- uint8_t da;
+ comp4_t s, d;
+ comp4_t m,n,o,p;
+ comp4_t Fa, Fb;
+ comp2_t t, u, v;
+ comp4_t sa;
+ comp1_t da;
s = *(src + i);
m = *(mask + i);
d = *(dest + i);
- da = d >> 24;
+ da = d >> A_SHIFT;
fbCombineMaskC (&s, &m);
@@ -1062,21 +1065,21 @@ fbCombineConjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int wi
Fa = 0;
break;
case CombineAOut:
- m = fbCombineConjointOutPart ((uint8_t) (sa >> 0), da);
- n = fbCombineConjointOutPart ((uint8_t) (sa >> 8), da) << 8;
- o = fbCombineConjointOutPart ((uint8_t) (sa >> 16), da) << 16;
- p = fbCombineConjointOutPart ((uint8_t) (sa >> 24), da) << 24;
+ m = (comp4_t)fbCombineConjointOutPart ((comp1_t) (sa >> 0), da);
+ n = (comp4_t)fbCombineConjointOutPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
+ o = (comp4_t)fbCombineConjointOutPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ p = (comp4_t)fbCombineConjointOutPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineAIn:
- m = fbCombineConjointInPart ((uint8_t) (sa >> 0), da);
- n = fbCombineConjointInPart ((uint8_t) (sa >> 8), da) << 8;
- o = fbCombineConjointInPart ((uint8_t) (sa >> 16), da) << 16;
- p = fbCombineConjointInPart ((uint8_t) (sa >> 24), da) << 24;
+ m = (comp4_t)fbCombineConjointInPart ((comp1_t) (sa >> 0), da);
+ n = (comp4_t)fbCombineConjointInPart ((comp1_t) (sa >> G_SHIFT), da) << G_SHIFT;
+ o = (comp4_t)fbCombineConjointInPart ((comp1_t) (sa >> B_SHIFT), da) << B_SHIFT;
+ p = (comp4_t)fbCombineConjointInPart ((comp1_t) (sa >> A_SHIFT), da) << A_SHIFT;
Fa = m|n|o|p;
break;
case CombineA:
- Fa = 0xffffffff;
+ Fa = ~0;
break;
}
@@ -1085,87 +1088,87 @@ fbCombineConjointGeneralC (uint32_t *dest, uint32_t *src, uint32_t *mask, int wi
Fb = 0;
break;
case CombineBOut:
- m = fbCombineConjointOutPart (da, (uint8_t) (sa >> 0));
- n = fbCombineConjointOutPart (da, (uint8_t) (sa >> 8)) << 8;
- o = fbCombineConjointOutPart (da, (uint8_t) (sa >> 16)) << 16;
- p = fbCombineConjointOutPart (da, (uint8_t) (sa >> 24)) << 24;
+ m = (comp4_t)fbCombineConjointOutPart (da, (comp1_t) (sa >> 0));
+ n = (comp4_t)fbCombineConjointOutPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
+ o = (comp4_t)fbCombineConjointOutPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ p = (comp4_t)fbCombineConjointOutPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineBIn:
- m = fbCombineConjointInPart (da, (uint8_t) (sa >> 0));
- n = fbCombineConjointInPart (da, (uint8_t) (sa >> 8)) << 8;
- o = fbCombineConjointInPart (da, (uint8_t) (sa >> 16)) << 16;
- p = fbCombineConjointInPart (da, (uint8_t) (sa >> 24)) << 24;
+ m = (comp4_t)fbCombineConjointInPart (da, (comp1_t) (sa >> 0));
+ n = (comp4_t)fbCombineConjointInPart (da, (comp1_t) (sa >> G_SHIFT)) << G_SHIFT;
+ o = (comp4_t)fbCombineConjointInPart (da, (comp1_t) (sa >> B_SHIFT)) << B_SHIFT;
+ p = (comp4_t)fbCombineConjointInPart (da, (comp1_t) (sa >> A_SHIFT)) << A_SHIFT;
Fb = m|n|o|p;
break;
case CombineB:
- Fb = 0xffffffff;
+ Fb = ~0;
break;
}
- m = FbGen (s,d,0,FbGet8(Fa,0),FbGet8(Fb,0),t, u, v);
- n = FbGen (s,d,8,FbGet8(Fa,8),FbGet8(Fb,8),t, u, v);
- o = FbGen (s,d,16,FbGet8(Fa,16),FbGet8(Fb,16),t, u, v);
- p = FbGen (s,d,24,FbGet8(Fa,24),FbGet8(Fb,24),t, u, v);
+ m = FbGen (s,d,0,GetComp(Fa,0),GetComp(Fb,0),t, u, v);
+ n = FbGen (s,d,G_SHIFT,GetComp(Fa,G_SHIFT),GetComp(Fb,G_SHIFT),t, u, v);
+ o = FbGen (s,d,B_SHIFT,GetComp(Fa,B_SHIFT),GetComp(Fb,B_SHIFT),t, u, v);
+ p = FbGen (s,d,A_SHIFT,GetComp(Fa,A_SHIFT),GetComp(Fb,A_SHIFT),t, u, v);
s = m|n|o|p;
*(dest + i) = s;
}
}
FASTCALL static void
-fbCombineConjointOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointOverC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineAOver);
}
FASTCALL static void
-fbCombineConjointOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointOverReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineBOver);
}
FASTCALL static void
-fbCombineConjointInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointInC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineAIn);
}
FASTCALL static void
-fbCombineConjointInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointInReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineBIn);
}
FASTCALL static void
-fbCombineConjointOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointOutC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineAOut);
}
FASTCALL static void
-fbCombineConjointOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointOutReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineBOut);
}
FASTCALL static void
-fbCombineConjointAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointAtopC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineAAtop);
}
FASTCALL static void
-fbCombineConjointAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointAtopReverseC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineBAtop);
}
FASTCALL static void
-fbCombineConjointXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+fbCombineConjointXorC (comp4_t *dest, comp4_t *src, comp4_t *mask, int width)
{
fbCombineConjointGeneralC (dest, src, mask, width, CombineXor);
}
-CombineFuncU pixman_fbCombineFuncU[] = {
+static CombineFuncU pixman_fbCombineFuncU[] = {
fbCombineClear,
fbCombineSrcU,
NULL, /* CombineDst */
@@ -1212,7 +1215,7 @@ CombineFuncU pixman_fbCombineFuncU[] = {
fbCombineConjointXorU,
};
-CombineFuncC pixman_fbCombineFuncC[] = {
+static CombineFuncC pixman_fbCombineFuncC[] = {
fbCombineClearC,
fbCombineSrcC,
NULL, /* Dest */
@@ -1258,3 +1261,9 @@ CombineFuncC pixman_fbCombineFuncC[] = {
fbCombineConjointAtopReverseC,
fbCombineConjointXorC,
};
+
+FbComposeFunctions pixman_composeFunctions = {
+ pixman_fbCombineFuncU,
+ pixman_fbCombineFuncC,
+ pixman_fbCombineMaskU
+};
diff --git a/lib/pixman/pixman/combine.pl b/lib/pixman/pixman/combine.pl
new file mode 100644
index 000000000..f8df60374
--- /dev/null
+++ b/lib/pixman/pixman/combine.pl
@@ -0,0 +1,81 @@
+$usage = "Usage: combine.pl { 8 | 16 } < combine.inc";
+
+$#ARGV == 0 or die $usage;
+
+# Get the component size.
+$size = int($ARGV[0]);
+$size == 8 or $size == 16 or die $usage;
+
+$pixel_size = $size * 4;
+$half_pixel_size = $size * 2;
+
+sub mask {
+ my $str = shift;
+ my $suffix;
+ $suffix = "ULL" if $size > 8;
+
+ return "0x" . $str . $suffix;
+}
+
+# Generate mask strings.
+$nibbles = $size / 4;
+$mask = "f" x $nibbles;
+$zero_mask = "0" x $nibbles;
+$one_half = "8" . "0" x ($nibbles - 1);
+
+print "/* WARNING: This file is generated by combine.pl from combine.inc.\n";
+print " Please edit one of those files rather than this one. */\n";
+print "\n";
+
+print "#line 1 \"combine.inc\"\n";
+
+$mask_ = mask($mask);
+$one_half_ = mask($one_half);
+$g_mask = mask($mask . $zero_mask);
+$b_mask = mask($mask . $zero_mask x 2);
+$a_mask = mask($mask . $zero_mask x 3);
+$rb_mask = mask($mask . $zero_mask . $mask);
+$ag_mask = mask($mask . $zero_mask . $mask . $zero_mask);
+$rb_one_half = mask($one_half . $zero_mask . $one_half);
+$rb_mask_plus_one = mask("1" . $zero_mask x 2 . "1" . $zero_mask);
+
+while (<STDIN>) {
+ # Mask and 1/2 value for a single component.
+ s/#define COMPONENT_SIZE\b/$& $size/;
+ s/#define MASK\b/$& $mask_/;
+ s/#define ONE_HALF\b/$& $one_half_/;
+
+ # Shifts and masks for green, blue, and alpha.
+ s/#define G_SHIFT\b/$& $size/;
+ s/#define B_SHIFT\b/$& $size * 2/;
+ s/#define A_SHIFT\b/$& $size * 3/;
+ s/#define G_MASK\b/$& $g_mask/;
+ s/#define B_MASK\b/$& $b_mask/;
+ s/#define A_MASK\b/$& $a_mask/;
+
+ # Special values for dealing with red + blue at the same time.
+ s/#define RB_MASK\b/$& $rb_mask/;
+ s/#define AG_MASK\b/$& $ag_mask/;
+ s/#define RB_ONE_HALF\b/$& $rb_one_half/;
+ s/#define RB_MASK_PLUS_ONE\b/$& $rb_mask_plus_one/;
+
+ # Add 32/64 suffix to combining function types.
+ s/\bCombineFuncC\b/CombineFuncC$pixel_size/;
+ s/\bCombineFuncU\b/CombineFuncU$pixel_size/;
+ s/\bCombineMaskU\b/CombineMaskU$pixel_size/;
+ s/\bFbComposeFunctions\b/FbComposeFunctions$pixel_size/;
+
+ # Convert comp*_t values into the appropriate real types.
+ s/comp1_t/uint${size}_t/g;
+ s/comp2_t/uint${half_pixel_size}_t/g;
+ s/comp4_t/uint${pixel_size}_t/g;
+
+ # Change the function table name for the 64-bit version.
+ s/pixman_composeFunctions/pixman_composeFunctions64/ if $size == 16;
+
+ # Change the header for the 64-bit version
+ s/pixman-combine.h/pixman-combine64.h/ if $size == 16;
+ s/pixman-combine.h/pixman-combine32.h/ if $size == 8;
+
+ print;
+}
diff --git a/lib/pixman/pixman/pixman-access.c b/lib/pixman/pixman/pixman-access.c
index 94af2065c..d01f8bd59 100644
--- a/lib/pixman/pixman/pixman-access.c
+++ b/lib/pixman/pixman/pixman-access.c
@@ -2,6 +2,7 @@
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
* 2005 Lars Knoll & Zack Rusin, Trolltech
+ * 2008 Aaron Plattner, NVIDIA Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -27,19 +28,15 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <string.h>
+#include <assert.h>
#include "pixman-private.h"
-#ifdef PIXMAN_FB_ACCESSORS
-#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture_accessors
-#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture_accessors
-#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture_accessors
-#else
-#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture
-#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture
-#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture
-#endif
+#define Red(x) (((x) >> 16) & 0xff)
+#define Green(x) (((x) >> 8) & 0xff)
+#define Blue(x) ((x) & 0xff)
/*
* YV12 setup and access macros
@@ -123,6 +120,52 @@ fbFetch_x8b8g8r8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer)
}
static FASTCALL void
+fbFetch_a2b10g10r10 (bits_image_t *pict, int x, int y, int width, uint64_t *buffer)
+{
+ const uint32_t *bits = pict->bits + y*pict->rowstride;
+ const uint32_t *pixel = bits + x;
+ const uint32_t *end = pixel + width;
+ while (pixel < end) {
+ uint32_t p = READ(pict, pixel++);
+ uint64_t a = p >> 30;
+ uint64_t b = (p >> 20) & 0x3ff;
+ uint64_t g = (p >> 10) & 0x3ff;
+ uint64_t r = p & 0x3ff;
+
+ r = r << 6 | r >> 4;
+ g = g << 6 | g >> 4;
+ b = b << 6 | b >> 4;
+
+ a <<= 62;
+ a |= a >> 2;
+ a |= a >> 4;
+ a |= a >> 8;
+
+ *buffer++ = a << 48 | r << 32 | g << 16 | b;
+ }
+}
+
+static FASTCALL void
+fbFetch_x2b10g10r10 (bits_image_t *pict, int x, int y, int width, uint64_t *buffer)
+{
+ const uint32_t *bits = pict->bits + y*pict->rowstride;
+ const uint32_t *pixel = (uint32_t *)bits + x;
+ const uint32_t *end = pixel + width;
+ while (pixel < end) {
+ uint32_t p = READ(pict, pixel++);
+ uint64_t b = (p >> 20) & 0x3ff;
+ uint64_t g = (p >> 10) & 0x3ff;
+ uint64_t r = p & 0x3ff;
+
+ r = r << 6 | r >> 4;
+ g = g << 6 | g >> 4;
+ b = b << 6 | b >> 4;
+
+ *buffer++ = 0xffffULL << 48 | r << 32 | g << 16 | b;
+ }
+}
+
+static FASTCALL void
fbFetch_r8g8b8 (bits_image_t *pict, int x, int y, int width, uint32_t *buffer)
{
const uint32_t *bits = pict->bits + y*pict->rowstride;
@@ -643,13 +686,16 @@ fbFetch_yv12 (bits_image_t *pict, int x, int line, int width, uint32_t *buffer)
}
}
-fetchProc FETCH_PROC_FOR_PICTURE (bits_image_t * pict)
+fetchProc32 ACCESS(pixman_fetchProcForPicture32) (bits_image_t * pict)
{
switch(pict->format) {
case PIXMAN_a8r8g8b8: return fbFetch_a8r8g8b8;
case PIXMAN_x8r8g8b8: return fbFetch_x8r8g8b8;
case PIXMAN_a8b8g8r8: return fbFetch_a8b8g8r8;
case PIXMAN_x8b8g8r8: return fbFetch_x8b8g8r8;
+ /* These two require wide compositing */
+ case PIXMAN_a2b10g10r10: return NULL;
+ case PIXMAN_x2b10g10r10: return NULL;
/* 24bpp formats */
case PIXMAN_r8g8b8: return fbFetch_r8g8b8;
@@ -699,8 +745,66 @@ fetchProc FETCH_PROC_FOR_PICTURE (bits_image_t * pict)
return NULL;
}
+static FASTCALL void
+fbFetch64_generic (bits_image_t *pict, int x, int y, int width, uint64_t *buffer)
+{
+ fetchProc32 fetch32 = ACCESS(pixman_fetchProcForPicture32) (pict);
+
+ // Fetch the pixels into the first half of buffer and then expand them in
+ // place.
+ fetch32(pict, x, y, width, (uint32_t*)buffer);
+ pixman_expand(buffer, (uint32_t*)buffer, pict->format, width);
+}
+
+fetchProc64 ACCESS(pixman_fetchProcForPicture64) (bits_image_t * pict)
+{
+ switch(pict->format) {
+ case PIXMAN_a2b10g10r10: return fbFetch_a2b10g10r10;
+ case PIXMAN_x2b10g10r10: return fbFetch_x2b10g10r10;
+ default: return fbFetch64_generic;
+ }
+}
+
/**************************** Pixel wise fetching *****************************/
+static FASTCALL uint64_t
+fbFetchPixel_a2b10g10r10 (bits_image_t *pict, int offset, int line)
+{
+ uint32_t *bits = pict->bits + line*pict->rowstride;
+ uint32_t p = READ(pict, bits + offset);
+ uint64_t a = p >> 30;
+ uint64_t b = (p >> 20) & 0x3ff;
+ uint64_t g = (p >> 10) & 0x3ff;
+ uint64_t r = p & 0x3ff;
+
+ r = r << 6 | r >> 4;
+ g = g << 6 | g >> 4;
+ b = b << 6 | b >> 4;
+
+ a <<= 62;
+ a |= a >> 2;
+ a |= a >> 4;
+ a |= a >> 8;
+
+ return a << 48 | r << 32 | g << 16 | b;
+}
+
+static FASTCALL uint64_t
+fbFetchPixel_x2b10g10r10 (bits_image_t *pict, int offset, int line)
+{
+ uint32_t *bits = pict->bits + line*pict->rowstride;
+ uint32_t p = READ(pict, bits + offset);
+ uint64_t b = (p >> 20) & 0x3ff;
+ uint64_t g = (p >> 10) & 0x3ff;
+ uint64_t r = p & 0x3ff;
+
+ r = r << 6 | r >> 4;
+ g = g << 6 | g >> 4;
+ b = b << 6 | b >> 4;
+
+ return 0xffffULL << 48 | r << 32 | g << 16 | b;
+}
+
static FASTCALL uint32_t
fbFetchPixel_a8r8g8b8 (bits_image_t *pict, int offset, int line)
{
@@ -1154,13 +1258,34 @@ fbFetchPixel_yv12 (bits_image_t *pict, int offset, int line)
(b >= 0 ? b < 0x1000000 ? (b >> 16) & 0x0000ff : 0x0000ff : 0);
}
-fetchPixelProc FETCH_PIXEL_PROC_FOR_PICTURE (bits_image_t * pict)
+/*
+ * XXX: The transformed fetch path only works at 32-bpp so far. When all paths
+ * have wide versions, this can be removed.
+ *
+ * WARNING: This function loses precision!
+ */
+static FASTCALL uint32_t
+fbFetchPixel32_generic_lossy (bits_image_t *pict, int offset, int line)
+{
+ fetchPixelProc64 fetchPixel64 = ACCESS(pixman_fetchPixelProcForPicture64) (pict);
+ const uint64_t argb16Pixel = fetchPixel64(pict, offset, line);
+ uint32_t argb8Pixel;
+
+ pixman_contract(&argb8Pixel, &argb16Pixel, 1);
+
+ return argb8Pixel;
+}
+
+fetchPixelProc32 ACCESS(pixman_fetchPixelProcForPicture32) (bits_image_t * pict)
{
switch(pict->format) {
case PIXMAN_a8r8g8b8: return fbFetchPixel_a8r8g8b8;
case PIXMAN_x8r8g8b8: return fbFetchPixel_x8r8g8b8;
case PIXMAN_a8b8g8r8: return fbFetchPixel_a8b8g8r8;
case PIXMAN_x8b8g8r8: return fbFetchPixel_x8b8g8r8;
+ /* These two require wide compositing */
+ case PIXMAN_a2b10g10r10: return fbFetchPixel32_generic_lossy;
+ case PIXMAN_x2b10g10r10: return fbFetchPixel32_generic_lossy;
/* 24bpp formats */
case PIXMAN_r8g8b8: return fbFetchPixel_r8g8b8;
@@ -1210,12 +1335,62 @@ fetchPixelProc FETCH_PIXEL_PROC_FOR_PICTURE (bits_image_t * pict)
return NULL;
}
+static FASTCALL uint64_t
+fbFetchPixel64_generic (bits_image_t *pict, int offset, int line)
+{
+ fetchPixelProc32 fetchPixel32 = ACCESS(pixman_fetchPixelProcForPicture32) (pict);
+ uint32_t argb8Pixel = fetchPixel32(pict, offset, line);
+ uint64_t argb16Pixel;
+
+ pixman_expand(&argb16Pixel, &argb8Pixel, pict->format, 1);
+
+ return argb16Pixel;
+}
+
+fetchPixelProc64 ACCESS(pixman_fetchPixelProcForPicture64) (bits_image_t * pict)
+{
+ switch(pict->format) {
+ case PIXMAN_a2b10g10r10: return fbFetchPixel_a2b10g10r10;
+ case PIXMAN_x2b10g10r10: return fbFetchPixel_x2b10g10r10;
+ default: return fbFetchPixel64_generic;
+ }
+}
+
/*********************************** Store ************************************/
#define Splita(v) uint32_t a = ((v) >> 24), r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff
#define Split(v) uint32_t r = ((v) >> 16) & 0xff, g = ((v) >> 8) & 0xff, b = (v) & 0xff
static FASTCALL void
+fbStore_a2b10g10r10 (pixman_image_t *image,
+ uint32_t *bits, const uint64_t *values, int x, int width, const pixman_indexed_t * indexed)
+{
+ int i;
+ uint32_t *pixel = bits + x;
+ for (i = 0; i < width; ++i) {
+ WRITE(image, pixel++,
+ ((values[i] >> 32) & 0xc0000000) | // A
+ ((values[i] >> 38) & 0x3ff) | // R
+ ((values[i] >> 12) & 0xffc00) | // G
+ ((values[i] << 14) & 0x3ff00000)); // B
+ }
+}
+
+static FASTCALL void
+fbStore_x2b10g10r10 (pixman_image_t *image,
+ uint32_t *bits, const uint64_t *values, int x, int width, const pixman_indexed_t * indexed)
+{
+ int i;
+ uint32_t *pixel = bits + x;
+ for (i = 0; i < width; ++i) {
+ WRITE(image, pixel++,
+ ((values[i] >> 38) & 0x3ff) | // R
+ ((values[i] >> 12) & 0xffc00) | // G
+ ((values[i] << 14) & 0x3ff00000)); // B
+ }
+}
+
+static FASTCALL void
fbStore_a8r8g8b8 (pixman_image_t *image,
uint32_t *bits, const uint32_t *values, int x, int width, const pixman_indexed_t * indexed)
{
@@ -1465,7 +1640,7 @@ fbStore_b2g3r3 (pixman_image_t *image,
Split(values[i]);
WRITE(image, pixel++,
((b ) & 0xc0) |
- ((g >> 2) & 0x1c) |
+ ((g >> 2) & 0x38) |
((r >> 5) ));
}
}
@@ -1634,7 +1809,7 @@ fbStore_g1 (pixman_image_t *image,
}
-storeProc STORE_PROC_FOR_PICTURE (bits_image_t * pict)
+storeProc32 ACCESS(pixman_storeProcForPicture32) (bits_image_t * pict)
{
switch(pict->format) {
case PIXMAN_a8r8g8b8: return fbStore_a8r8g8b8;
@@ -1684,3 +1859,128 @@ storeProc STORE_PROC_FOR_PICTURE (bits_image_t * pict)
return NULL;
}
}
+
+/*
+ * Contracts a 64bpp image to 32bpp and then stores it using a regular 32-bit
+ * store proc.
+ */
+static FASTCALL void
+fbStore64_generic (pixman_image_t *image,
+ uint32_t *bits, const uint64_t *values, int x, int width, const pixman_indexed_t * indexed)
+{
+ bits_image_t *pict = (bits_image_t*)image;
+ storeProc32 store32 = ACCESS(pixman_storeProcForPicture32) (pict);
+ uint32_t *argb8Pixels;
+
+ assert(image->common.type == BITS);
+ assert(store32);
+
+ argb8Pixels = pixman_malloc_ab (width, sizeof(uint32_t));
+ if (!argb8Pixels) return;
+
+ // Contract the scanline. We could do this in place if values weren't
+ // const.
+ pixman_contract(argb8Pixels, values, width);
+ store32(image, bits, argb8Pixels, x, width, indexed);
+
+ free(argb8Pixels);
+}
+
+storeProc64 ACCESS(pixman_storeProcForPicture64) (bits_image_t * pict)
+{
+ switch(pict->format) {
+ case PIXMAN_a2b10g10r10: return fbStore_a2b10g10r10;
+ case PIXMAN_x2b10g10r10: return fbStore_x2b10g10r10;
+ default: return fbStore64_generic;
+ }
+}
+
+#ifndef PIXMAN_FB_ACCESSORS
+/*
+ * Helper routine to expand a color component from 0 < n <= 8 bits to 16 bits by
+ * replication.
+ */
+static inline uint64_t expand16(const uint8_t val, int nbits)
+{
+ // Start out with the high bit of val in the high bit of result.
+ uint16_t result = (uint16_t)val << (16 - nbits);
+
+ if (nbits == 0)
+ return 0;
+
+ // Copy the bits in result, doubling the number of bits each time, until we
+ // fill all 16 bits.
+ while (nbits < 16) {
+ result |= result >> nbits;
+ nbits *= 2;
+ }
+
+ return result;
+}
+
+/*
+ * This function expands images from ARGB8 format to ARGB16. To preserve
+ * precision, it needs to know the original source format. For example, if the
+ * source was PIXMAN_x1r5g5b5 and the red component contained bits 12345, then
+ * the expanded value is 12345123. To correctly expand this to 16 bits, it
+ * should be 1234512345123451 and not 1234512312345123.
+ */
+void pixman_expand(uint64_t *dst, const uint32_t *src,
+ pixman_format_code_t format, int width)
+{
+ /*
+ * Determine the sizes of each component and the masks and shifts required
+ * to extract them from the source pixel.
+ */
+ const int a_size = PIXMAN_FORMAT_A(format),
+ r_size = PIXMAN_FORMAT_R(format),
+ g_size = PIXMAN_FORMAT_G(format),
+ b_size = PIXMAN_FORMAT_B(format);
+ const int a_shift = 32 - a_size,
+ r_shift = 24 - r_size,
+ g_shift = 16 - g_size,
+ b_shift = 8 - b_size;
+ const uint8_t a_mask = ~(~0 << a_size),
+ r_mask = ~(~0 << r_size),
+ g_mask = ~(~0 << g_size),
+ b_mask = ~(~0 << b_size);
+ int i;
+
+ /* Start at the end so that we can do the expansion in place when src == dst */
+ for (i = width - 1; i >= 0; i--)
+ {
+ const uint32_t pixel = src[i];
+ // Extract the components.
+ const uint8_t a = (pixel >> a_shift) & a_mask,
+ r = (pixel >> r_shift) & r_mask,
+ g = (pixel >> g_shift) & g_mask,
+ b = (pixel >> b_shift) & b_mask;
+ const uint64_t a16 = a_size ? expand16(a, a_size) : 0xffff,
+ r16 = expand16(r, r_size),
+ g16 = expand16(g, g_size),
+ b16 = expand16(b, b_size);
+
+ dst[i] = a16 << 48 | r16 << 32 | g16 << 16 | b16;
+ }
+}
+
+/*
+ * Contracting is easier than expanding. We just need to truncate the
+ * components.
+ */
+void pixman_contract(uint32_t *dst, const uint64_t *src, int width)
+{
+ int i;
+
+ /* Start at the beginning so that we can do the contraction in place when
+ * src == dst */
+ for (i = 0; i < width; i++)
+ {
+ const uint8_t a = src[i] >> 56,
+ r = src[i] >> 40,
+ g = src[i] >> 24,
+ b = src[i] >> 8;
+ dst[i] = a << 24 | r << 16 | g << 8 | b;
+ }
+}
+#endif // PIXMAN_FB_ACCESSORS
diff --git a/lib/pixman/pixman/pixman-compose.c b/lib/pixman/pixman/pixman-compose.c
index 6f524d6f8..c583ea60e 100644
--- a/lib/pixman/pixman/pixman-compose.c
+++ b/lib/pixman/pixman/pixman-compose.c
@@ -2,6 +2,7 @@
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
* 2005 Lars Knoll & Zack Rusin, Trolltech
+ * 2008 Aaron Plattner, NVIDIA Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -37,29 +38,8 @@
#ifdef PIXMAN_FB_ACCESSORS
#define PIXMAN_COMPOSITE_RECT_GENERAL pixman_composite_rect_general_accessors
-#define PIXMAN_COMPOSE_FUNCTIONS pixman_composeFunctions_accessors
-
-#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture_accessors
-#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture_accessors
-#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture_accessors
-
-#define FB_FETCH_TRANSFORMED fbFetchTransformed_accessors
-#define FB_FETCH_EXTERNAL_ALPHA fbFetchExternalAlpha_accessors
-#define FB_STORE_EXTERNAL_ALPHA fbStoreExternalAlpha_accessors
-
#else
-
#define PIXMAN_COMPOSITE_RECT_GENERAL pixman_composite_rect_general_no_accessors
-#define PIXMAN_COMPOSE_FUNCTIONS pixman_composeFunctions
-
-#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture
-#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture
-#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture
-
-#define FB_FETCH_TRANSFORMED fbFetchTransformed
-#define FB_FETCH_EXTERNAL_ALPHA fbFetchExternalAlpha
-#define FB_STORE_EXTERNAL_ALPHA fbStoreExternalAlpha
-
#endif
static unsigned int
@@ -126,7 +106,20 @@ static void fbFetchSolid(bits_image_t * pict, int x, int y, int width, uint32_t
{
uint32_t color;
uint32_t *end;
- fetchPixelProc fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict);
+ fetchPixelProc32 fetch = ACCESS(pixman_fetchPixelProcForPicture32)(pict);
+
+ color = fetch(pict, 0, 0);
+
+ end = buffer + width;
+ while (buffer < end)
+ *(buffer++) = color;
+}
+
+static void fbFetchSolid64(bits_image_t * pict, int x, int y, int width, uint64_t *buffer, void *unused, uint32_t unused2)
+{
+ uint64_t color;
+ uint64_t *end;
+ fetchPixelProc64 fetch = ACCESS(pixman_fetchPixelProcForPicture64)(pict);
color = fetch(pict, 0, 0);
@@ -137,26 +130,38 @@ static void fbFetchSolid(bits_image_t * pict, int x, int y, int width, uint32_t
static void fbFetch(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
{
- fetchProc fetch = FETCH_PROC_FOR_PICTURE(pict);
+ fetchProc32 fetch = ACCESS(pixman_fetchProcForPicture32)(pict);
fetch(pict, x, y, width, buffer);
}
-#ifdef PIXMAN_FB_ACCESSORS /* The accessor version can't be parameterized from outside */
-static const
-#endif
-FbComposeFunctions PIXMAN_COMPOSE_FUNCTIONS = {
- pixman_fbCombineFuncU,
- pixman_fbCombineFuncC,
- pixman_fbCombineMaskU
-};
+static void fbFetch64(bits_image_t * pict, int x, int y, int width, uint64_t *buffer, void *unused, uint32_t unused2)
+{
+ fetchProc64 fetch = ACCESS(pixman_fetchProcForPicture64)(pict);
+
+ fetch(pict, x, y, width, buffer);
+}
static void
fbStore(bits_image_t * pict, int x, int y, int width, uint32_t *buffer)
{
uint32_t *bits;
int32_t stride;
- storeProc store = STORE_PROC_FOR_PICTURE(pict);
+ storeProc32 store = ACCESS(pixman_storeProcForPicture32)(pict);
+ const pixman_indexed_t * indexed = pict->indexed;
+
+ bits = pict->bits;
+ stride = pict->rowstride;
+ bits += y*stride;
+ store((pixman_image_t *)pict, bits, buffer, x, width, indexed);
+}
+
+static void
+fbStore64(bits_image_t * pict, int x, int y, int width, uint64_t *buffer)
+{
+ uint32_t *bits;
+ int32_t stride;
+ storeProc64 store = ACCESS(pixman_storeProcForPicture64)(pict);
const pixman_indexed_t * indexed = pict->indexed;
bits = pict->bits;
@@ -169,15 +174,70 @@ typedef void (*scanStoreProc)(pixman_image_t *, int, int, int, uint32_t *);
typedef void (*scanFetchProc)(pixman_image_t *, int, int, int, uint32_t *,
uint32_t *, uint32_t);
+static inline scanFetchProc get_fetch_source_pict(const int wide)
+{
+ if (wide)
+ return (scanFetchProc)pixmanFetchSourcePict64;
+ else
+ return (scanFetchProc)pixmanFetchSourcePict;
+}
+
+static inline scanFetchProc get_fetch_solid(const int wide)
+{
+ if (wide)
+ return (scanFetchProc)fbFetchSolid64;
+ else
+ return (scanFetchProc)fbFetchSolid;
+}
+
+static inline scanFetchProc get_fetch(const int wide)
+{
+ if (wide)
+ return (scanFetchProc)fbFetch64;
+ else
+ return (scanFetchProc)fbFetch;
+}
+
+static inline scanFetchProc get_fetch_external_alpha(const int wide)
+{
+ if (wide)
+ return (scanFetchProc)ACCESS(fbFetchExternalAlpha64);
+ else
+ return (scanFetchProc)ACCESS(fbFetchExternalAlpha);
+}
+
+static inline scanFetchProc get_fetch_transformed(const int wide)
+{
+ if (wide)
+ return (scanFetchProc)ACCESS(fbFetchTransformed64);
+ else
+ return (scanFetchProc)ACCESS(fbFetchTransformed);
+}
+
+static inline scanStoreProc get_store(const int wide)
+{
+ if (wide)
+ return (scanStoreProc)fbStore64;
+ else
+ return (scanStoreProc)fbStore;
+}
+
+static inline scanStoreProc get_store_external_alpha(const int wide)
+{
+ if (wide)
+ return (scanStoreProc)ACCESS(fbStoreExternalAlpha64);
+ else
+ return (scanStoreProc)ACCESS(fbStoreExternalAlpha);
+}
+
#ifndef PIXMAN_FB_ACCESSORS
static
#endif
void
PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
- uint32_t *scanline_buffer)
+ void *src_buffer, void *mask_buffer,
+ void *dest_buffer, const int wide)
{
- uint32_t *src_buffer = scanline_buffer;
- uint32_t *dest_buffer = src_buffer + data->width;
int i;
scanStoreProc store;
scanFetchProc fetchSrc = NULL, fetchMask = NULL, fetchDest = NULL;
@@ -191,7 +251,7 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
fetchSrc = NULL;
else if (IS_SOURCE_IMAGE (data->src))
{
- fetchSrc = (scanFetchProc)pixmanFetchSourcePict;
+ fetchSrc = get_fetch_source_pict(wide);
srcClass = SourcePictureClassify ((source_image_t *)data->src,
data->xSrc, data->ySrc,
data->width, data->height);
@@ -202,23 +262,23 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
if (bits->common.alpha_map)
{
- fetchSrc = (scanFetchProc)FB_FETCH_EXTERNAL_ALPHA;
+ fetchSrc = get_fetch_external_alpha(wide);
}
else if ((bits->common.repeat == PIXMAN_REPEAT_NORMAL || bits->common.repeat == PIXMAN_REPEAT_PAD) &&
bits->width == 1 &&
bits->height == 1)
{
- fetchSrc = (scanFetchProc)fbFetchSolid;
+ fetchSrc = get_fetch_solid(wide);
srcClass = SOURCE_IMAGE_CLASS_HORIZONTAL;
}
else if (!bits->common.transform && bits->common.filter != PIXMAN_FILTER_CONVOLUTION
&& bits->common.repeat != PIXMAN_REPEAT_PAD)
{
- fetchSrc = (scanFetchProc)fbFetch;
+ fetchSrc = get_fetch(wide);
}
else
{
- fetchSrc = (scanFetchProc)FB_FETCH_TRANSFORMED;
+ fetchSrc = get_fetch_transformed(wide);
}
}
@@ -241,34 +301,34 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
if (bits->common.alpha_map)
{
- fetchMask = (scanFetchProc)FB_FETCH_EXTERNAL_ALPHA;
+ fetchMask = get_fetch_external_alpha(wide);
}
else if ((bits->common.repeat == PIXMAN_REPEAT_NORMAL || bits->common.repeat == PIXMAN_REPEAT_PAD) &&
bits->width == 1 && bits->height == 1)
{
- fetchMask = (scanFetchProc)fbFetchSolid;
+ fetchMask = get_fetch_solid(wide);
maskClass = SOURCE_IMAGE_CLASS_HORIZONTAL;
}
else if (!bits->common.transform && bits->common.filter != PIXMAN_FILTER_CONVOLUTION
&& bits->common.repeat != PIXMAN_REPEAT_PAD)
- fetchMask = (scanFetchProc)fbFetch;
+ fetchMask = get_fetch(wide);
else
- fetchMask = (scanFetchProc)FB_FETCH_TRANSFORMED;
+ fetchMask = get_fetch_transformed(wide);
}
}
if (data->dest->common.alpha_map)
{
- fetchDest = (scanFetchProc)FB_FETCH_EXTERNAL_ALPHA;
- store = (scanStoreProc)FB_STORE_EXTERNAL_ALPHA;
+ fetchDest = get_fetch_external_alpha(wide);
+ store = get_store_external_alpha(wide);
if (data->op == PIXMAN_OP_CLEAR || data->op == PIXMAN_OP_SRC)
fetchDest = NULL;
}
else
{
- fetchDest = (scanFetchProc)fbFetch;
- store = (scanStoreProc)fbStore;
+ fetchDest = get_fetch(wide);
+ store = get_store(wide);
switch (data->op)
{
@@ -282,7 +342,11 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
switch (data->dest->bits.format) {
case PIXMAN_a8r8g8b8:
case PIXMAN_x8r8g8b8:
- store = NULL;
+ // Skip the store step and composite directly into the
+ // destination if the output format of the compose func matches
+ // the destination format.
+ if (!wide)
+ store = NULL;
break;
default:
break;
@@ -312,8 +376,9 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
data->mask->common.component_alpha &&
PIXMAN_FORMAT_RGB (data->mask->bits.format))
{
- uint32_t *mask_buffer = dest_buffer + data->width;
- CombineFuncC compose = PIXMAN_COMPOSE_FUNCTIONS.combineC[data->op];
+ CombineFuncC32 compose =
+ wide ? (CombineFuncC32)pixman_composeFunctions64.combineC[data->op] :
+ pixman_composeFunctions.combineC[data->op];
if (!compose)
return;
@@ -376,14 +441,14 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
}
else
{
- uint32_t *src_mask_buffer = 0, *mask_buffer = 0;
- CombineFuncU compose = PIXMAN_COMPOSE_FUNCTIONS.combineU[data->op];
+ void *src_mask_buffer = 0;
+ const int useMask = (fetchMask != NULL);
+ CombineFuncU32 compose =
+ wide ? (CombineFuncU32)pixman_composeFunctions64.combineU[data->op] :
+ pixman_composeFunctions.combineU[data->op];
if (!compose)
return;
- if (fetchMask)
- mask_buffer = dest_buffer + data->width;
-
for (i = 0; i < data->height; ++i) {
/* fill first half of scanline with source */
if (fetchSrc)
@@ -404,9 +469,13 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
fetchSrc (data->src, data->xSrc, data->ySrc + i,
data->width, src_buffer, 0, 0);
- if (mask_buffer)
+ if (useMask)
{
- PIXMAN_COMPOSE_FUNCTIONS.combineU[PIXMAN_OP_IN] (mask_buffer, src_buffer, data->width);
+ if (wide)
+ pixman_composeFunctions64.combineU[PIXMAN_OP_IN] (mask_buffer, src_buffer, data->width);
+ else
+ pixman_composeFunctions.combineU[PIXMAN_OP_IN] (mask_buffer, src_buffer, data->width);
+
src_mask_buffer = mask_buffer;
}
else
@@ -417,13 +486,19 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
else
{
fetchSrc (data->src, data->xSrc, data->ySrc + i,
- data->width, src_buffer, mask_buffer,
- 0xff000000);
-
- if (mask_buffer)
- PIXMAN_COMPOSE_FUNCTIONS.combineMaskU (src_buffer,
- mask_buffer,
- data->width);
+ data->width, src_buffer,
+ useMask ? mask_buffer : NULL, 0xff000000);
+
+ if (useMask) {
+ if (wide)
+ pixman_composeFunctions64.combineMaskU (src_buffer,
+ mask_buffer,
+ data->width);
+ else
+ pixman_composeFunctions.combineMaskU (src_buffer,
+ mask_buffer,
+ data->width);
+ }
src_mask_buffer = src_buffer;
}
@@ -433,7 +508,10 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
fetchMask (data->mask, data->xMask, data->yMask + i,
data->width, mask_buffer, 0, 0);
- PIXMAN_COMPOSE_FUNCTIONS.combineU[PIXMAN_OP_IN] (mask_buffer, src_buffer, data->width);
+ if (wide)
+ pixman_composeFunctions64.combineU[PIXMAN_OP_IN] (mask_buffer, src_buffer, data->width);
+ else
+ pixman_composeFunctions.combineU[PIXMAN_OP_IN] (mask_buffer, src_buffer, data->width);
src_mask_buffer = mask_buffer;
}
@@ -465,10 +543,35 @@ PIXMAN_COMPOSITE_RECT_GENERAL (const FbComposeData *data,
#ifndef PIXMAN_FB_ACCESSORS
+#define SCANLINE_BUFFER_LENGTH 2048
+
void
-pixman_composite_rect_general (const FbComposeData *data,
- uint32_t *scanline_buffer)
+pixman_composite_rect_general (const FbComposeData *data)
{
+ uint32_t _scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
+ const pixman_format_code_t srcFormat = data->src->type == BITS ? data->src->bits.format : 0;
+ const pixman_format_code_t maskFormat = data->mask && data->mask->type == BITS ? data->mask->bits.format : 0;
+ const pixman_format_code_t destFormat = data->dest->type == BITS ? data->dest->bits.format : 0;
+ const int srcWide = PIXMAN_FORMAT_16BPC(srcFormat);
+ const int maskWide = data->mask && PIXMAN_FORMAT_16BPC(maskFormat);
+ const int destWide = PIXMAN_FORMAT_16BPC(destFormat);
+ const int wide = srcWide || maskWide || destWide;
+ const int Bpp = wide ? 8 : 4;
+ uint8_t *scanline_buffer = (uint8_t*)_scanline_buffer;
+ uint8_t *src_buffer, *mask_buffer, *dest_buffer;
+
+ if (data->width * Bpp > SCANLINE_BUFFER_LENGTH * sizeof(uint32_t))
+ {
+ scanline_buffer = pixman_malloc_abc (data->width, 3, Bpp);
+
+ if (!scanline_buffer)
+ return;
+ }
+
+ src_buffer = scanline_buffer;
+ mask_buffer = src_buffer + data->width * Bpp;
+ dest_buffer = mask_buffer + data->width * Bpp;
+
if (data->src->common.read_func ||
data->src->common.write_func ||
(data->mask && data->mask->common.read_func) ||
@@ -476,12 +579,18 @@ pixman_composite_rect_general (const FbComposeData *data,
data->dest->common.read_func ||
data->dest->common.write_func)
{
- pixman_composite_rect_general_accessors (data, scanline_buffer);
+ pixman_composite_rect_general_accessors (data, src_buffer, mask_buffer,
+ dest_buffer, wide);
}
else
{
- pixman_composite_rect_general_no_accessors (data, scanline_buffer);
+ pixman_composite_rect_general_no_accessors (data, src_buffer,
+ mask_buffer, dest_buffer,
+ wide);
}
+
+ if ((void*)scanline_buffer != (void*)_scanline_buffer)
+ free (scanline_buffer);
}
#endif
diff --git a/lib/pixman/pixman/pixman-compute-region.c b/lib/pixman/pixman/pixman-compute-region.c
index f9b9de718..a93cee0ba 100644
--- a/lib/pixman/pixman/pixman-compute-region.c
+++ b/lib/pixman/pixman/pixman-compute-region.c
@@ -21,7 +21,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_CONFIG_H
#include <config.h>
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include "pixman-private.h"
@@ -29,16 +32,16 @@
#define BOUND(v) (int16_t) ((v) < INT16_MIN ? INT16_MIN : (v) > INT16_MAX ? INT16_MAX : (v))
static inline pixman_bool_t
-miClipPictureReg (pixman_region16_t * pRegion,
- pixman_region16_t * pClip,
+miClipPictureReg (pixman_region32_t * pRegion,
+ pixman_region32_t * pClip,
int dx,
int dy)
{
- if (pixman_region_n_rects(pRegion) == 1 &&
- pixman_region_n_rects(pClip) == 1)
+ if (pixman_region32_n_rects(pRegion) == 1 &&
+ pixman_region32_n_rects(pClip) == 1)
{
- pixman_box16_t * pRbox = pixman_region_rectangles(pRegion, NULL);
- pixman_box16_t * pCbox = pixman_region_rectangles(pClip, NULL);
+ pixman_box32_t * pRbox = pixman_region32_rectangles(pRegion, NULL);
+ pixman_box32_t * pCbox = pixman_region32_rectangles(pClip, NULL);
int v;
if (pRbox->x1 < (v = pCbox->x1 + dx))
@@ -52,26 +55,26 @@ miClipPictureReg (pixman_region16_t * pRegion,
if (pRbox->x1 >= pRbox->x2 ||
pRbox->y1 >= pRbox->y2)
{
- pixman_region_init (pRegion);
+ pixman_region32_init (pRegion);
}
}
- else if (!pixman_region_not_empty (pClip))
+ else if (!pixman_region32_not_empty (pClip))
return FALSE;
else
{
if (dx || dy)
- pixman_region_translate (pRegion, -dx, -dy);
- if (!pixman_region_intersect (pRegion, pRegion, pClip))
+ pixman_region32_translate (pRegion, -dx, -dy);
+ if (!pixman_region32_intersect (pRegion, pRegion, pClip))
return FALSE;
if (dx || dy)
- pixman_region_translate(pRegion, dx, dy);
+ pixman_region32_translate(pRegion, dx, dy);
}
- return pixman_region_not_empty(pRegion);
+ return pixman_region32_not_empty(pRegion);
}
static inline pixman_bool_t
-miClipPictureSrc (pixman_region16_t * pRegion,
+miClipPictureSrc (pixman_region32_t * pRegion,
pixman_image_t * pPicture,
int dx,
int dy)
@@ -95,13 +98,13 @@ miClipPictureSrc (pixman_region16_t * pRegion,
*/
if (pPicture->common.has_client_clip)
{
- pixman_region_translate ( pRegion, dx, dy);
+ pixman_region32_translate ( pRegion, dx, dy);
- if (!pixman_region_intersect (pRegion, pRegion,
- (pixman_region16_t *) pPicture->common.src_clip))
+ if (!pixman_region32_intersect (pRegion, pRegion,
+ pPicture->common.src_clip))
return FALSE;
- pixman_region_translate ( pRegion, -dx, -dy);
+ pixman_region32_translate ( pRegion, -dx, -dy);
}
return TRUE;
@@ -121,18 +124,18 @@ miClipPictureSrc (pixman_region16_t * pRegion,
*/
pixman_bool_t
-pixman_compute_composite_region (pixman_region16_t * pRegion,
- pixman_image_t * pSrc,
- pixman_image_t * pMask,
- pixman_image_t * pDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height)
+pixman_compute_composite_region32 (pixman_region32_t * pRegion,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
{
int v;
@@ -147,13 +150,13 @@ pixman_compute_composite_region (pixman_region16_t * pRegion,
if (pRegion->extents.x1 >= pRegion->extents.x2 ||
pRegion->extents.y1 >= pRegion->extents.y2)
{
- pixman_region_init (pRegion);
+ pixman_region32_init (pRegion);
return FALSE;
}
/* clip against dst */
if (!miClipPictureReg (pRegion, &pDst->common.clip_region, 0, 0))
{
- pixman_region_fini (pRegion);
+ pixman_region32_fini (pRegion);
return FALSE;
}
if (pDst->common.alpha_map)
@@ -162,14 +165,14 @@ pixman_compute_composite_region (pixman_region16_t * pRegion,
-pDst->common.alpha_origin.x,
-pDst->common.alpha_origin.y))
{
- pixman_region_fini (pRegion);
+ pixman_region32_fini (pRegion);
return FALSE;
}
}
/* clip against src */
if (!miClipPictureSrc (pRegion, pSrc, xDst - xSrc, yDst - ySrc))
{
- pixman_region_fini (pRegion);
+ pixman_region32_fini (pRegion);
return FALSE;
}
if (pSrc->common.alpha_map)
@@ -178,7 +181,7 @@ pixman_compute_composite_region (pixman_region16_t * pRegion,
xDst - (xSrc + pSrc->common.alpha_origin.x),
yDst - (ySrc + pSrc->common.alpha_origin.y)))
{
- pixman_region_fini (pRegion);
+ pixman_region32_fini (pRegion);
return FALSE;
}
}
@@ -187,7 +190,7 @@ pixman_compute_composite_region (pixman_region16_t * pRegion,
{
if (!miClipPictureSrc (pRegion, pMask, xDst - xMask, yDst - yMask))
{
- pixman_region_fini (pRegion);
+ pixman_region32_fini (pRegion);
return FALSE;
}
if (pMask->common.alpha_map)
@@ -196,7 +199,7 @@ pixman_compute_composite_region (pixman_region16_t * pRegion,
xDst - (xMask + pMask->common.alpha_origin.x),
yDst - (yMask + pMask->common.alpha_origin.y)))
{
- pixman_region_fini (pRegion);
+ pixman_region32_fini (pRegion);
return FALSE;
}
}
@@ -204,3 +207,36 @@ pixman_compute_composite_region (pixman_region16_t * pRegion,
return TRUE;
}
+
+PIXMAN_EXPORT pixman_bool_t
+pixman_compute_composite_region (pixman_region16_t * pRegion,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ pixman_region32_t r32;
+ pixman_bool_t retval;
+
+ pixman_region32_init (&r32);
+
+ retval = pixman_compute_composite_region32 (&r32, pSrc, pMask, pDst,
+ xSrc, ySrc, xMask, yMask, xDst, yDst,
+ width, height);
+
+ if (retval)
+ {
+ if (!pixman_region16_copy_from_region32 (pRegion, &r32))
+ retval = FALSE;
+ }
+
+ pixman_region32_fini (&r32);
+ return retval;
+}
diff --git a/lib/pixman/pixman/pixman-edge.c b/lib/pixman/pixman/pixman-edge.c
index 717284f7d..b9246af5f 100644
--- a/lib/pixman/pixman/pixman-edge.c
+++ b/lib/pixman/pixman/pixman-edge.c
@@ -315,7 +315,7 @@ PIXMAN_RASTERIZE_EDGES (pixman_image_t *image,
#ifndef PIXMAN_FB_ACCESSORS
-void
+PIXMAN_EXPORT void
pixman_rasterize_edges (pixman_image_t *image,
pixman_edge_t *l,
pixman_edge_t *r,
diff --git a/lib/pixman/pixman/pixman-image.c b/lib/pixman/pixman/pixman-image.c
index 9b6846e16..e80c47935 100644
--- a/lib/pixman/pixman/pixman-image.c
+++ b/lib/pixman/pixman/pixman-image.c
@@ -30,6 +30,8 @@
#include "pixman-private.h"
+#define Alpha(x) ((x) >> 24)
+
static void
init_source_image (source_image_t *image)
{
@@ -79,8 +81,8 @@ allocate_image (void)
{
image_common_t *common = &image->common;
- pixman_region_init (&common->full_region);
- pixman_region_init (&common->clip_region);
+ pixman_region32_init (&common->full_region);
+ pixman_region32_init (&common->clip_region);
common->src_clip = &common->full_region;
common->has_client_clip = FALSE;
common->transform = NULL;
@@ -99,7 +101,7 @@ allocate_image (void)
}
/* Ref Counting */
-pixman_image_t *
+PIXMAN_EXPORT pixman_image_t *
pixman_image_ref (pixman_image_t *image)
{
image->common.ref_count++;
@@ -108,7 +110,7 @@ pixman_image_ref (pixman_image_t *image)
}
/* returns TRUE when the image is freed */
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
pixman_image_unref (pixman_image_t *image)
{
image_common_t *common = (image_common_t *)image;
@@ -117,8 +119,8 @@ pixman_image_unref (pixman_image_t *image)
if (common->ref_count == 0)
{
- pixman_region_fini (&common->clip_region);
- pixman_region_fini (&common->full_region);
+ pixman_region32_fini (&common->clip_region);
+ pixman_region32_fini (&common->full_region);
if (common->transform)
free (common->transform);
@@ -156,7 +158,7 @@ pixman_image_unref (pixman_image_t *image)
}
/* Constructors */
-pixman_image_t *
+PIXMAN_EXPORT pixman_image_t *
pixman_image_create_solid_fill (pixman_color_t *color)
{
pixman_image_t *img = allocate_image();
@@ -171,7 +173,7 @@ pixman_image_create_solid_fill (pixman_color_t *color)
return img;
}
-pixman_image_t *
+PIXMAN_EXPORT pixman_image_t *
pixman_image_create_linear_gradient (pixman_point_fixed_t *p1,
pixman_point_fixed_t *p2,
const pixman_gradient_stop_t *stops,
@@ -204,7 +206,7 @@ pixman_image_create_linear_gradient (pixman_point_fixed_t *p1,
}
-pixman_image_t *
+PIXMAN_EXPORT pixman_image_t *
pixman_image_create_radial_gradient (pixman_point_fixed_t *inner,
pixman_point_fixed_t *outer,
pixman_fixed_t inner_radius,
@@ -248,7 +250,7 @@ pixman_image_create_radial_gradient (pixman_point_fixed_t *inner,
return image;
}
-pixman_image_t *
+PIXMAN_EXPORT pixman_image_t *
pixman_image_create_conical_gradient (pixman_point_fixed_t *center,
pixman_fixed_t angle,
const pixman_gradient_stop_t *stops,
@@ -321,20 +323,20 @@ create_bits (pixman_format_code_t format,
static void
reset_clip_region (pixman_image_t *image)
{
- pixman_region_fini (&image->common.clip_region);
+ pixman_region32_fini (&image->common.clip_region);
if (image->type == BITS)
{
- pixman_region_init_rect (&image->common.clip_region, 0, 0,
- image->bits.width, image->bits.height);
+ pixman_region32_init_rect (&image->common.clip_region, 0, 0,
+ image->bits.width, image->bits.height);
}
else
{
- pixman_region_init (&image->common.clip_region);
+ pixman_region32_init (&image->common.clip_region);
}
}
-pixman_image_t *
+PIXMAN_EXPORT pixman_image_t *
pixman_image_create_bits (pixman_format_code_t format,
int width,
int height,
@@ -376,15 +378,34 @@ pixman_image_create_bits (pixman_format_code_t format,
*/
image->bits.indexed = NULL;
- pixman_region_fini (&image->common.full_region);
- pixman_region_init_rect (&image->common.full_region, 0, 0,
- image->bits.width, image->bits.height);
+ pixman_region32_fini (&image->common.full_region);
+ pixman_region32_init_rect (&image->common.full_region, 0, 0,
+ image->bits.width, image->bits.height);
reset_clip_region (image);
return image;
}
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
+pixman_image_set_clip_region32 (pixman_image_t *image,
+ pixman_region32_t *region)
+{
+ image_common_t *common = (image_common_t *)image;
+
+ if (region)
+ {
+ return pixman_region32_copy (&common->clip_region, region);
+ }
+ else
+ {
+ reset_clip_region (image);
+
+ return TRUE;
+ }
+}
+
+
+PIXMAN_EXPORT pixman_bool_t
pixman_image_set_clip_region (pixman_image_t *image,
pixman_region16_t *region)
{
@@ -392,7 +413,7 @@ pixman_image_set_clip_region (pixman_image_t *image,
if (region)
{
- return pixman_region_copy (&common->clip_region, region);
+ return pixman_region32_copy_from_region16 (&common->clip_region, region);
}
else
{
@@ -404,14 +425,14 @@ pixman_image_set_clip_region (pixman_image_t *image,
/* Sets whether the clip region includes a clip region set by the client
*/
-void
+PIXMAN_EXPORT void
pixman_image_set_has_client_clip (pixman_image_t *image,
pixman_bool_t client_clip)
{
image->common.has_client_clip = client_clip;
}
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
pixman_image_set_transform (pixman_image_t *image,
const pixman_transform_t *transform)
{
@@ -445,14 +466,14 @@ pixman_image_set_transform (pixman_image_t *image,
return TRUE;
}
-void
+PIXMAN_EXPORT void
pixman_image_set_repeat (pixman_image_t *image,
pixman_repeat_t repeat)
{
image->common.repeat = repeat;
}
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
pixman_image_set_filter (pixman_image_t *image,
pixman_filter_t filter,
const pixman_fixed_t *params,
@@ -485,7 +506,7 @@ pixman_image_set_filter (pixman_image_t *image,
return TRUE;
}
-void
+PIXMAN_EXPORT void
pixman_image_set_source_clipping (pixman_image_t *image,
pixman_bool_t source_clipping)
{
@@ -501,7 +522,7 @@ pixman_image_set_source_clipping (pixman_image_t *image,
* copy the content of indexed. Doing this copying is simply
* way, way too expensive.
*/
-void
+PIXMAN_EXPORT void
pixman_image_set_indexed (pixman_image_t *image,
const pixman_indexed_t *indexed)
{
@@ -510,7 +531,7 @@ pixman_image_set_indexed (pixman_image_t *image,
bits->indexed = indexed;
}
-void
+PIXMAN_EXPORT void
pixman_image_set_alpha_map (pixman_image_t *image,
pixman_image_t *alpha_map,
int16_t x,
@@ -535,7 +556,7 @@ pixman_image_set_alpha_map (pixman_image_t *image,
common->alpha_origin.y = y;
}
-void
+PIXMAN_EXPORT void
pixman_image_set_component_alpha (pixman_image_t *image,
pixman_bool_t component_alpha)
{
@@ -543,7 +564,7 @@ pixman_image_set_component_alpha (pixman_image_t *image,
}
-void
+PIXMAN_EXPORT void
pixman_image_set_accessors (pixman_image_t *image,
pixman_read_memory_func_t read_func,
pixman_write_memory_func_t write_func)
@@ -554,7 +575,7 @@ pixman_image_set_accessors (pixman_image_t *image,
image->common.write_func = write_func;
}
-uint32_t *
+PIXMAN_EXPORT uint32_t *
pixman_image_get_data (pixman_image_t *image)
{
if (image->type == BITS)
@@ -563,7 +584,7 @@ pixman_image_get_data (pixman_image_t *image)
return NULL;
}
-int
+PIXMAN_EXPORT int
pixman_image_get_width (pixman_image_t *image)
{
if (image->type == BITS)
@@ -572,7 +593,7 @@ pixman_image_get_width (pixman_image_t *image)
return 0;
}
-int
+PIXMAN_EXPORT int
pixman_image_get_height (pixman_image_t *image)
{
if (image->type == BITS)
@@ -581,7 +602,7 @@ pixman_image_get_height (pixman_image_t *image)
return 0;
}
-int
+PIXMAN_EXPORT int
pixman_image_get_stride (pixman_image_t *image)
{
if (image->type == BITS)
@@ -590,7 +611,7 @@ pixman_image_get_stride (pixman_image_t *image)
return 0;
}
-int
+PIXMAN_EXPORT int
pixman_image_get_depth (pixman_image_t *image)
{
if (image->type == BITS)
@@ -599,7 +620,7 @@ pixman_image_get_depth (pixman_image_t *image)
return 0;
}
-pixman_bool_t
+static pixman_bool_t
color_to_pixel (pixman_color_t *color,
uint32_t *pixel,
pixman_format_code_t format)
@@ -640,7 +661,7 @@ color_to_pixel (pixman_color_t *color,
return TRUE;
}
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
pixman_image_fill_rectangles (pixman_op_t op,
pixman_image_t *dest,
pixman_color_t *color,
@@ -677,23 +698,23 @@ pixman_image_fill_rectangles (pixman_op_t op,
{
for (i = 0; i < n_rects; ++i)
{
- pixman_region16_t fill_region;
+ pixman_region32_t fill_region;
int n_boxes, j;
- pixman_box16_t *boxes;
+ pixman_box32_t *boxes;
- pixman_region_init_rect (&fill_region, rects[i].x, rects[i].y, rects[i].width, rects[i].height);
- pixman_region_intersect (&fill_region, &fill_region, &dest->common.clip_region);
+ pixman_region32_init_rect (&fill_region, rects[i].x, rects[i].y, rects[i].width, rects[i].height);
+ pixman_region32_intersect (&fill_region, &fill_region, &dest->common.clip_region);
- boxes = pixman_region_rectangles (&fill_region, &n_boxes);
+ boxes = pixman_region32_rectangles (&fill_region, &n_boxes);
for (j = 0; j < n_boxes; ++j)
{
- const pixman_box16_t *box = &(boxes[j]);
+ const pixman_box32_t *box = &(boxes[j]);
pixman_fill (dest->bits.bits, dest->bits.rowstride, PIXMAN_FORMAT_BPP (dest->bits.format),
box->x1, box->y1, box->x2 - box->x1, box->y2 - box->y1,
pixel);
}
- pixman_region_fini (&fill_region);
+ pixman_region32_fini (&fill_region);
}
return TRUE;
}
@@ -717,3 +738,91 @@ pixman_image_fill_rectangles (pixman_op_t op,
return TRUE;
}
+
+pixman_bool_t
+pixman_image_can_get_solid (pixman_image_t *image)
+{
+ if (image->type == SOLID)
+ return TRUE;
+
+ if (image->type != BITS ||
+ image->bits.width != 1 ||
+ image->bits.height != 1)
+ {
+ return FALSE;
+ }
+
+ if (image->common.repeat != PIXMAN_REPEAT_NORMAL)
+ return FALSE;
+
+ switch (image->bits.format)
+ {
+ case PIXMAN_a8r8g8b8:
+ case PIXMAN_x8r8g8b8:
+ case PIXMAN_a8b8g8r8:
+ case PIXMAN_x8b8g8r8:
+ case PIXMAN_r8g8b8:
+ case PIXMAN_b8g8r8:
+ case PIXMAN_r5g6b5:
+ case PIXMAN_b5g6r5:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+}
+
+pixman_bool_t
+pixman_image_is_opaque(pixman_image_t *image)
+{
+ int i = 0;
+ int gradientNumberOfColors = 0;
+
+ if(image->common.alpha_map)
+ return FALSE;
+
+ switch(image->type)
+ {
+ case BITS:
+ if(PIXMAN_FORMAT_A(image->bits.format))
+ return FALSE;
+ break;
+
+ case LINEAR:
+ case CONICAL:
+ case RADIAL:
+ gradientNumberOfColors = image->gradient.n_stops;
+ i=0;
+ while(i<gradientNumberOfColors)
+ {
+ if(image->gradient.stops[i].color.alpha != 0xffff)
+ return FALSE;
+ i++;
+ }
+ break;
+
+ case SOLID:
+ if(Alpha(image->solid.color) != 0xff)
+ return FALSE;
+ break;
+ }
+
+ /* Convolution filters can introduce translucency if the sum of the weights
+ is lower than 1. */
+ if (image->common.filter == PIXMAN_FILTER_CONVOLUTION)
+ return FALSE;
+
+ if (image->common.repeat == PIXMAN_REPEAT_NONE)
+ {
+ if (image->common.filter != PIXMAN_FILTER_NEAREST)
+ return FALSE;
+
+ if (image->common.transform)
+ return FALSE;
+
+ /* Gradients do not necessarily cover the entire compositing area */
+ if (image->type == LINEAR || image->type == CONICAL || image->type == RADIAL)
+ return FALSE;
+ }
+
+ return TRUE;
+}
diff --git a/lib/pixman/pixman/pixman-mmx.c b/lib/pixman/pixman/pixman-mmx.c
index 8afbcb8eb..a856fe4ef 100644
--- a/lib/pixman/pixman/pixman-mmx.c
+++ b/lib/pixman/pixman/pixman-mmx.c
@@ -36,9 +36,6 @@
#ifdef USE_MMX
#include <mmintrin.h>
-#ifdef USE_SSE
-#include <xmmintrin.h> /* for _mm_shuffle_pi16 and _MM_SHUFFLE */
-#endif
#include "pixman-mmx.h"
@@ -142,28 +139,33 @@ static const MMXData c =
#endif
};
-#ifdef _MSC_VER
-#undef inline
-#define inline __forceinline
-#endif
-
#ifdef __GNUC__
-#define MC(x) ((__m64) c.mmx_##x)
+# ifdef __ICC
+# define MC(x) M64(c.mmx_##x)
+# else
+# define MC(x) ((__m64)c.mmx_##x)
+# endif
+# define inline __inline__ __attribute__ ((__always_inline__))
#endif
+
#ifdef _MSC_VER
-#define MC(x) c.mmx_##x
+# define MC(x) c.mmx_##x
+# undef inline
+# define inline __forceinline
#endif
static inline __m64
M64 (ullong x)
{
-#ifdef __GNUC__
+#ifdef __ICC
+ return _mm_cvtsi64_m64 (x);
+#elif defined (__GNUC__)
return (__m64)x;
#endif
#ifdef _MSC_VER
__m64 res;
-
+
res.m64_u64 = x;
return res;
#endif
@@ -172,7 +174,9 @@ M64 (ullong x)
static inline ullong
ULLONG (__m64 x)
{
-#ifdef __GNUC__
+#ifdef __ICC
+ return _mm_cvtm64_si64 (x);
+#elif defined (__GNUC__)
return (ullong)x;
#endif
@@ -220,28 +224,6 @@ pix_add (__m64 a, __m64 b)
return _mm_adds_pu8 (a, b);
}
-#ifdef USE_SSE
-
-static inline __m64
-expand_alpha (__m64 pixel)
-{
- return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(3, 3, 3, 3));
-}
-
-static inline __m64
-expand_alpha_rev (__m64 pixel)
-{
- return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(0, 0, 0, 0));
-}
-
-static inline __m64
-invert_colors (__m64 pixel)
-{
- return _mm_shuffle_pi16 (pixel, _MM_SHUFFLE(3, 0, 1, 2));
-}
-
-#else
-
static inline __m64
expand_alpha (__m64 pixel)
{
@@ -293,8 +275,6 @@ invert_colors (__m64 pixel)
return x;
}
-#endif
-
static inline __m64
over (__m64 src, __m64 srca, __m64 dest)
{
@@ -400,6 +380,12 @@ expand8888 (__m64 in, int pos)
}
static inline __m64
+expandx888 (__m64 in, int pos)
+{
+ return _mm_or_si64 (expand8888 (in, pos), MC(full_alpha));
+}
+
+static inline __m64
pack565 (__m64 pixel, __m64 target, int pos)
{
__m64 p = pixel;
@@ -1379,36 +1365,36 @@ fbCompositeSrc_x888xnx8888mmx (pixman_op_t op,
__m64 vs7 = *(__m64 *)(src + 14);
vd0 = pack8888 (
- in_over (expand8888 (vs0, 0), srca, vmask, expand8888 (vd0, 0)),
- in_over (expand8888 (vs0, 1), srca, vmask, expand8888 (vd0, 1)));
+ in_over (expandx888 (vs0, 0), srca, vmask, expand8888 (vd0, 0)),
+ in_over (expandx888 (vs0, 1), srca, vmask, expand8888 (vd0, 1)));
vd1 = pack8888 (
- in_over (expand8888 (vs1, 0), srca, vmask, expand8888 (vd1, 0)),
- in_over (expand8888 (vs1, 1), srca, vmask, expand8888 (vd1, 1)));
+ in_over (expandx888 (vs1, 0), srca, vmask, expand8888 (vd1, 0)),
+ in_over (expandx888 (vs1, 1), srca, vmask, expand8888 (vd1, 1)));
vd2 = pack8888 (
- in_over (expand8888 (vs2, 0), srca, vmask, expand8888 (vd2, 0)),
- in_over (expand8888 (vs2, 1), srca, vmask, expand8888 (vd2, 1)));
+ in_over (expandx888 (vs2, 0), srca, vmask, expand8888 (vd2, 0)),
+ in_over (expandx888 (vs2, 1), srca, vmask, expand8888 (vd2, 1)));
vd3 = pack8888 (
- in_over (expand8888 (vs3, 0), srca, vmask, expand8888 (vd3, 0)),
- in_over (expand8888 (vs3, 1), srca, vmask, expand8888 (vd3, 1)));
+ in_over (expandx888 (vs3, 0), srca, vmask, expand8888 (vd3, 0)),
+ in_over (expandx888 (vs3, 1), srca, vmask, expand8888 (vd3, 1)));
vd4 = pack8888 (
- in_over (expand8888 (vs4, 0), srca, vmask, expand8888 (vd4, 0)),
- in_over (expand8888 (vs4, 1), srca, vmask, expand8888 (vd4, 1)));
+ in_over (expandx888 (vs4, 0), srca, vmask, expand8888 (vd4, 0)),
+ in_over (expandx888 (vs4, 1), srca, vmask, expand8888 (vd4, 1)));
vd5 = pack8888 (
- in_over (expand8888 (vs5, 0), srca, vmask, expand8888 (vd5, 0)),
- in_over (expand8888 (vs5, 1), srca, vmask, expand8888 (vd5, 1)));
+ in_over (expandx888 (vs5, 0), srca, vmask, expand8888 (vd5, 0)),
+ in_over (expandx888 (vs5, 1), srca, vmask, expand8888 (vd5, 1)));
vd6 = pack8888 (
- in_over (expand8888 (vs6, 0), srca, vmask, expand8888 (vd6, 0)),
- in_over (expand8888 (vs6, 1), srca, vmask, expand8888 (vd6, 1)));
+ in_over (expandx888 (vs6, 0), srca, vmask, expand8888 (vd6, 0)),
+ in_over (expandx888 (vs6, 1), srca, vmask, expand8888 (vd6, 1)));
vd7 = pack8888 (
- in_over (expand8888 (vs7, 0), srca, vmask, expand8888 (vd7, 0)),
- in_over (expand8888 (vs7, 1), srca, vmask, expand8888 (vd7, 1)));
+ in_over (expandx888 (vs7, 0), srca, vmask, expand8888 (vd7, 0)),
+ in_over (expandx888 (vs7, 1), srca, vmask, expand8888 (vd7, 1)));
*(__m64 *)(dst + 0) = vd0;
*(__m64 *)(dst + 2) = vd1;
@@ -1726,13 +1712,27 @@ pixman_fill_mmx (uint32_t *bits,
__m64 v1, v2, v3, v4, v5, v6, v7;
#endif
- if (bpp == 16 && (xor >> 16 != (xor & 0xffff)))
+ if (bpp != 16 && bpp != 32 && bpp != 8)
return FALSE;
- if (bpp != 16 && bpp != 32)
+ if (bpp == 16 && (xor >> 16 != (xor & 0xffff)))
return FALSE;
- if (bpp == 16)
+ if (bpp == 8 &&
+ ((xor >> 16 != (xor & 0xffff)) ||
+ (xor >> 24 != (xor & 0x00ff) >> 16)))
+ {
+ return FALSE;
+ }
+
+ if (bpp == 8)
+ {
+ stride = stride * (int) sizeof (uint32_t) / 1;
+ byte_line = (uint8_t *)(((uint8_t *)bits) + stride * y + x);
+ byte_width = width;
+ stride *= 1;
+ }
+ else if (bpp == 16)
{
stride = stride * (int) sizeof (uint32_t) / 2;
byte_line = (uint8_t *)(((uint16_t *)bits) + stride * y + x);
@@ -1771,6 +1771,13 @@ pixman_fill_mmx (uint32_t *bits,
byte_line += stride;
w = byte_width;
+ while (w >= 1 && ((unsigned long)d & 1))
+ {
+ *(uint8_t *)d = (xor & 0xff);
+ w--;
+ d++;
+ }
+
while (w >= 2 && ((unsigned long)d & 3))
{
*(uint16_t *)d = xor;
@@ -1824,12 +1831,19 @@ pixman_fill_mmx (uint32_t *bits,
w -= 4;
d += 4;
}
- if (w >= 2)
+ while (w >= 2)
{
*(uint16_t *)d = xor;
w -= 2;
d += 2;
}
+ while (w >= 1)
+ {
+ *(uint8_t *)d = (xor & 0xff);
+ w--;
+ d++;
+ }
+
}
_mm_empty();
diff --git a/lib/pixman/pixman/pixman-pict.c b/lib/pixman/pixman/pixman-pict.c
index 8976ff209..193ea287c 100644
--- a/lib/pixman/pixman/pixman-pict.c
+++ b/lib/pixman/pixman/pixman-pict.c
@@ -30,10 +30,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
#include "pixman-private.h"
#include "pixman-mmx.h"
-#include "pixman-sse.h"
+#include "pixman-vmx.h"
+#include "pixman-sse2.h"
+#include "pixman-combine32.h"
+
+#ifdef __GNUC__
+# define inline __inline__ __attribute__ ((__always_inline__))
+#endif
#define FbFullMask(n) ((n) == 32 ? (uint32_t)-1 : ((((uint32_t) 1) << n) - 1))
@@ -47,21 +52,17 @@ typedef void (* CompositeFunc) (pixman_op_t,
int16_t, int16_t, int16_t, int16_t, int16_t, int16_t,
uint16_t, uint16_t);
-uint32_t
-fbOver (uint32_t x, uint32_t y)
+static inline uint32_t
+fbOver (uint32_t src, uint32_t dest)
{
- uint16_t a = ~x >> 24;
- uint16_t t;
- uint32_t m,n,o,p;
+ // dest = (dest * (255 - alpha)) / 255 + src
+ uint32_t a = ~src >> 24; // 255 - alpha == 255 + (~alpha + 1) == ~alpha
+ FbByteMulAdd(dest, a, src);
- m = FbOverU(x,y,0,a,t);
- n = FbOverU(x,y,8,a,t);
- o = FbOverU(x,y,16,a,t);
- p = FbOverU(x,y,24,a,t);
- return m|n|o|p;
+ return dest;
}
-uint32_t
+static uint32_t
fbOver24 (uint32_t x, uint32_t y)
{
uint16_t a = ~x >> 24;
@@ -74,7 +75,7 @@ fbOver24 (uint32_t x, uint32_t y)
return m|n|o;
}
-uint32_t
+static uint32_t
fbIn (uint32_t x, uint8_t y)
{
uint16_t a = y;
@@ -1107,7 +1108,7 @@ pixman_image_composite_rect (pixman_op_t op,
int16_t dest_y,
uint16_t width,
uint16_t height);
-void
+static void
fbCompositeSolidFill (pixman_op_t op,
pixman_image_t * pSrc,
pixman_image_t * pMask,
@@ -1187,22 +1188,22 @@ pixman_walk_composite_region (pixman_op_t op,
CompositeFunc compositeRect)
{
int n;
- const pixman_box16_t *pbox;
+ const pixman_box32_t *pbox;
int w, h, w_this, h_this;
int x_msk, y_msk, x_src, y_src, x_dst, y_dst;
- pixman_region16_t reg;
- pixman_region16_t *region;
+ pixman_region32_t reg;
+ pixman_region32_t *region;
- pixman_region_init (&reg);
- if (!pixman_compute_composite_region (&reg, pSrc, pMask, pDst,
- xSrc, ySrc, xMask, yMask, xDst, yDst, width, height))
+ pixman_region32_init (&reg);
+ if (!pixman_compute_composite_region32 (&reg, pSrc, pMask, pDst,
+ xSrc, ySrc, xMask, yMask, xDst, yDst, width, height))
{
return;
}
region = &reg;
- pbox = pixman_region_rectangles (region, &n);
+ pbox = pixman_region32_rectangles (region, &n);
while (n--)
{
h = pbox->y2 - pbox->y1;
@@ -1258,43 +1259,9 @@ pixman_walk_composite_region (pixman_op_t op,
}
pbox++;
}
- pixman_region_fini (&reg);
+ pixman_region32_fini (&reg);
}
-static pixman_bool_t
-can_get_solid (pixman_image_t *image)
-{
- if (image->type == SOLID)
- return TRUE;
-
- if (image->type != BITS ||
- image->bits.width != 1 ||
- image->bits.height != 1)
- {
- return FALSE;
- }
-
- if (image->common.repeat != PIXMAN_REPEAT_NORMAL)
- return FALSE;
-
- switch (image->bits.format)
- {
- case PIXMAN_a8r8g8b8:
- case PIXMAN_x8r8g8b8:
- case PIXMAN_a8b8g8r8:
- case PIXMAN_x8b8g8r8:
- case PIXMAN_r8g8b8:
- case PIXMAN_b8g8r8:
- case PIXMAN_r5g6b5:
- case PIXMAN_b5g6r5:
- return TRUE;
- default:
- return FALSE;
- }
-}
-
-#define SCANLINE_BUFFER_LENGTH 2048
-
static void
pixman_image_composite_rect (pixman_op_t op,
pixman_image_t *src,
@@ -1310,20 +1277,10 @@ pixman_image_composite_rect (pixman_op_t op,
uint16_t height)
{
FbComposeData compose_data;
- uint32_t _scanline_buffer[SCANLINE_BUFFER_LENGTH * 3];
- uint32_t *scanline_buffer = _scanline_buffer;
return_if_fail (src != NULL);
return_if_fail (dest != NULL);
- if (width > SCANLINE_BUFFER_LENGTH)
- {
- scanline_buffer = (uint32_t *)pixman_malloc_abc (width, 3, sizeof (uint32_t));
-
- if (!scanline_buffer)
- return;
- }
-
compose_data.op = op;
compose_data.src = src;
compose_data.mask = mask;
@@ -1337,10 +1294,7 @@ pixman_image_composite_rect (pixman_op_t op,
compose_data.width = width;
compose_data.height = height;
- pixman_composite_rect_general (&compose_data, scanline_buffer);
-
- if (scanline_buffer != _scanline_buffer)
- free (scanline_buffer);
+ pixman_composite_rect_general (&compose_data);
}
/* These "formats" both have depth 0, so they
@@ -1428,6 +1382,8 @@ static const FastPathInfo mmx_fast_paths[] =
{ PIXMAN_OP_SRC, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeCopyAreammx, 0 },
{ PIXMAN_OP_SRC, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeCopyAreammx, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeCopyAreammx, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeCopyAreammx, 0 },
{ PIXMAN_OP_SRC, PIXMAN_x8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeCopyAreammx, 0 },
{ PIXMAN_OP_SRC, PIXMAN_x8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeCopyAreammx, 0 },
{ PIXMAN_OP_SRC, PIXMAN_r5g6b5, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeCopyAreammx, 0 },
@@ -1439,12 +1395,91 @@ static const FastPathInfo mmx_fast_paths[] =
#endif
#ifdef USE_SSE2
-static const FastPathInfo sse_fast_paths[] =
+static const FastPathInfo sse2_fast_paths[] =
+{
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_r5g6b5, fbCompositeSolidMask_nx8x0565sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_b5g6r5, fbCompositeSolidMask_nx8x0565sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSolid_nx8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSolid_nx8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeSolid_nx0565sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSrc_8888x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeSrc_8888x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeSrc_8888x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeSrc_8888x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeSrc_8888x0565sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_b5g6r5, fbCompositeSrc_8888x0565sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeSolidMask_nx8x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeSolidMask_nx8x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8b8g8r8, fbCompositeSolidMask_nx8x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeSolidMask_nx8x8888sse2, 0 },
+#if 0
+ /* FIXME: This code are buggy in MMX version, now the bug was translated to SSE2 version */
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeOver_x888x8x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeOver_x888x8x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeOver_x888x8x8888sse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeOver_x888x8x8888sse2, 0 },
+#endif
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeSrc_x888xnx8888sse2, NEED_SOLID_MASK },
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeSrc_x888xnx8888sse2, NEED_SOLID_MASK },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8, PIXMAN_a8b8g8r8, fbCompositeSrc_x888xnx8888sse2, NEED_SOLID_MASK },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeSrc_x888xnx8888sse2, NEED_SOLID_MASK },
+ { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeSrc_8888x8x8888sse2, NEED_SOLID_MASK },
+ { PIXMAN_OP_OVER, PIXMAN_a8r8g8b8, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeSrc_8888x8x8888sse2, NEED_SOLID_MASK },
+ { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_a8, PIXMAN_a8b8g8r8, fbCompositeSrc_8888x8x8888sse2, NEED_SOLID_MASK },
+ { PIXMAN_OP_OVER, PIXMAN_a8b8g8r8, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeSrc_8888x8x8888sse2, NEED_SOLID_MASK },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8, PIXMAN_a8r8g8b8, fbCompositeSolidMask_nx8888x8888Csse2, NEED_COMPONENT_ALPHA },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8, PIXMAN_x8r8g8b8, fbCompositeSolidMask_nx8888x8888Csse2, NEED_COMPONENT_ALPHA },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8, PIXMAN_a8b8g8r8, fbCompositeSolidMask_nx8888x8888Csse2, NEED_COMPONENT_ALPHA },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8, PIXMAN_x8b8g8r8, fbCompositeSolidMask_nx8888x8888Csse2, NEED_COMPONENT_ALPHA },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8r8g8b8, PIXMAN_r5g6b5, fbCompositeSolidMask_nx8888x0565Csse2, NEED_COMPONENT_ALPHA },
+ { PIXMAN_OP_OVER, PIXMAN_solid, PIXMAN_a8b8g8r8, PIXMAN_b5g6r5, fbCompositeSolidMask_nx8888x0565Csse2, NEED_COMPONENT_ALPHA },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_a8r8g8b8, fbCompositeSrc_8888RevNPx8888sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_a8r8g8b8, fbCompositeSrc_8888RevNPx8888sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_x8r8g8b8, fbCompositeSrc_8888RevNPx8888sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_x8r8g8b8, fbCompositeSrc_8888RevNPx8888sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_a8b8g8r8, fbCompositeSrc_8888RevNPx8888sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_a8b8g8r8, fbCompositeSrc_8888RevNPx8888sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_x8b8g8r8, fbCompositeSrc_8888RevNPx8888sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_x8b8g8r8, fbCompositeSrc_8888RevNPx8888sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8r8g8b8, PIXMAN_r5g6b5, fbCompositeSrc_8888RevNPx0565sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_a8b8g8r8, PIXMAN_r5g6b5, fbCompositeSrc_8888RevNPx0565sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8r8g8b8, PIXMAN_b5g6r5, fbCompositeSrc_8888RevNPx0565sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_a8b8g8r8, PIXMAN_b5g6r5, fbCompositeSrc_8888RevNPx0565sse2, NEED_PIXBUF },
+ { PIXMAN_OP_OVER, PIXMAN_x8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeCopyAreasse2, 0 },
+ { PIXMAN_OP_OVER, PIXMAN_x8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeCopyAreasse2, 0 },
+
+ { PIXMAN_OP_ADD, PIXMAN_a8, PIXMAN_null, PIXMAN_a8, fbCompositeSrcAdd_8000x8000sse2, 0 },
+ { PIXMAN_OP_ADD, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeSrcAdd_8888x8888sse2, 0 },
+ { PIXMAN_OP_ADD, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeSrcAdd_8888x8888sse2, 0 },
+ { PIXMAN_OP_ADD, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8, fbCompositeSrcAdd_8888x8x8sse2, 0 },
+
+ { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8r8g8b8, fbCompositeSolidMaskSrc_nx8x8888sse2, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8r8g8b8, fbCompositeSolidMaskSrc_nx8x8888sse2, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8b8g8r8, fbCompositeSolidMaskSrc_nx8x8888sse2, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_solid, PIXMAN_a8, PIXMAN_x8b8g8r8, fbCompositeSolidMaskSrc_nx8x8888sse2, 0 },
+
+ { PIXMAN_OP_SRC, PIXMAN_a8r8g8b8, PIXMAN_null, PIXMAN_a8r8g8b8, fbCompositeCopyAreasse2, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_a8b8g8r8, PIXMAN_null, PIXMAN_a8b8g8r8, fbCompositeCopyAreasse2, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_x8r8g8b8, PIXMAN_null, PIXMAN_x8r8g8b8, fbCompositeCopyAreasse2, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_x8b8g8r8, PIXMAN_null, PIXMAN_x8b8g8r8, fbCompositeCopyAreasse2, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_r5g6b5, PIXMAN_null, PIXMAN_r5g6b5, fbCompositeCopyAreasse2, 0 },
+ { PIXMAN_OP_SRC, PIXMAN_b5g6r5, PIXMAN_null, PIXMAN_b5g6r5, fbCompositeCopyAreasse2, 0 },
+
+ { PIXMAN_OP_IN, PIXMAN_a8, PIXMAN_null, PIXMAN_a8, fbCompositeIn_8x8sse2, 0 },
+ { PIXMAN_OP_IN, PIXMAN_solid, PIXMAN_a8, PIXMAN_a8, fbCompositeIn_nx8x8sse2, 0 },
+
+ { 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 },
@@ -1552,7 +1587,7 @@ get_fast_path (const FastPathInfo *fast_paths,
if (info->op != op)
continue;
- if ((info->src_format == PIXMAN_solid && can_get_solid (pSrc)) ||
+ if ((info->src_format == PIXMAN_solid && pixman_image_can_get_solid (pSrc)) ||
(pSrc->type == BITS && info->src_format == pSrc->bits.format))
{
valid_src = TRUE;
@@ -1594,7 +1629,101 @@ get_fast_path (const FastPathInfo *fast_paths,
return NULL;
}
-void
+/*
+ * Operator optimizations based on source or destination opacity
+ */
+typedef struct
+{
+ pixman_op_t op;
+ pixman_op_t opSrcDstOpaque;
+ pixman_op_t opSrcOpaque;
+ pixman_op_t opDstOpaque;
+} OptimizedOperatorInfo;
+
+static const OptimizedOperatorInfo optimized_operators[] =
+{
+ /* Input Operator SRC&DST Opaque SRC Opaque DST Opaque */
+ { PIXMAN_OP_OVER, PIXMAN_OP_SRC, PIXMAN_OP_SRC, PIXMAN_OP_OVER },
+ { PIXMAN_OP_OVER_REVERSE, PIXMAN_OP_DST, PIXMAN_OP_OVER_REVERSE, PIXMAN_OP_DST },
+ { PIXMAN_OP_IN, PIXMAN_OP_SRC, PIXMAN_OP_IN, PIXMAN_OP_SRC },
+ { PIXMAN_OP_IN_REVERSE, PIXMAN_OP_DST, PIXMAN_OP_DST, PIXMAN_OP_IN_REVERSE },
+ { PIXMAN_OP_OUT, PIXMAN_OP_CLEAR, PIXMAN_OP_OUT, PIXMAN_OP_CLEAR },
+ { PIXMAN_OP_OUT_REVERSE, PIXMAN_OP_CLEAR, PIXMAN_OP_CLEAR, PIXMAN_OP_OUT_REVERSE },
+ { PIXMAN_OP_ATOP, PIXMAN_OP_SRC, PIXMAN_OP_IN, PIXMAN_OP_OVER },
+ { PIXMAN_OP_ATOP_REVERSE, PIXMAN_OP_DST, PIXMAN_OP_OVER_REVERSE, PIXMAN_OP_IN_REVERSE },
+ { PIXMAN_OP_XOR, PIXMAN_OP_CLEAR, PIXMAN_OP_OUT, PIXMAN_OP_OUT_REVERSE },
+ { PIXMAN_OP_SATURATE, PIXMAN_OP_DST, PIXMAN_OP_OVER_REVERSE, PIXMAN_OP_DST },
+ { PIXMAN_OP_NONE }
+};
+
+/*
+ * Check if the current operator could be optimized
+ */
+static const OptimizedOperatorInfo*
+pixman_operator_can_be_optimized(pixman_op_t op)
+{
+ const OptimizedOperatorInfo *info;
+
+ for (info = optimized_operators; info->op != PIXMAN_OP_NONE; info++)
+ {
+ if(info->op == op)
+ return info;
+ }
+ return NULL;
+}
+
+/*
+ * Optimize the current operator based on opacity of source or destination
+ * The output operator should be mathematically equivalent to the source.
+ */
+static pixman_op_t
+pixman_optimize_operator(pixman_op_t op, pixman_image_t *pSrc, pixman_image_t *pMask, pixman_image_t *pDst )
+{
+ pixman_bool_t is_source_opaque;
+ pixman_bool_t is_dest_opaque;
+ const OptimizedOperatorInfo *info = pixman_operator_can_be_optimized(op);
+
+ if(!info || pMask)
+ return op;
+
+ is_source_opaque = pixman_image_is_opaque(pSrc);
+ is_dest_opaque = pixman_image_is_opaque(pDst);
+
+ if(is_source_opaque == FALSE && is_dest_opaque == FALSE)
+ return op;
+
+ if(is_source_opaque && is_dest_opaque)
+ return info->opSrcDstOpaque;
+ else if(is_source_opaque)
+ return info->opSrcOpaque;
+ else if(is_dest_opaque)
+ return info->opDstOpaque;
+
+ return op;
+
+}
+
+#if defined(USE_SSE2) && defined(__GNUC__) && !defined(__x86_64__) && !defined(__amd64__)
+
+/*
+ * Work around GCC bug causing crashes in Mozilla with SSE2
+ *
+ * When using SSE2 intrinsics, gcc assumes that the stack is 16 byte
+ * aligned. Unfortunately some code, such as Mozilla and Mono contain
+ * code that aligns the stack to 4 bytes.
+ *
+ * The __force_align_arg_pointer__ makes gcc generate a prologue that
+ * realigns the stack pointer to 16 bytes.
+ *
+ * On x86-64 this is not necessary because the standard ABI already
+ * calls for a 16 byte aligned stack.
+ *
+ * See https://bugs.freedesktop.org/show_bug.cgi?id=15693
+ */
+
+__attribute__((__force_align_arg_pointer__))
+#endif
+PIXMAN_EXPORT void
pixman_image_composite (pixman_op_t op,
pixman_image_t * pSrc,
pixman_image_t * pMask,
@@ -1617,14 +1746,18 @@ pixman_image_composite (pixman_op_t op,
pixman_bool_t dstAlphaMap = pDst->common.alpha_map != NULL;
CompositeFunc func = NULL;
-#ifdef USE_SSE2
- fbComposeSetupSSE();
-#endif
-
#ifdef USE_MMX
fbComposeSetupMMX();
#endif
+#ifdef USE_VMX
+ fbComposeSetupVMX();
+#endif
+
+#ifdef USE_SSE2
+ fbComposeSetupSSE2();
+#endif
+
if (srcRepeat && srcTransform &&
pSrc->bits.width == 1 &&
pSrc->bits.height == 1)
@@ -1650,7 +1783,15 @@ pixman_image_composite (pixman_op_t op,
}
}
- if ((pSrc->type == BITS || can_get_solid (pSrc)) && (!pMask || pMask->type == BITS)
+ /*
+ * Check if we can replace our operator by a simpler one if the src or dest are opaque
+ * The output operator should be mathematically equivalent to the source.
+ */
+ op = pixman_optimize_operator(op, pSrc, pMask, pDst);
+ if(op == PIXMAN_OP_DST)
+ return;
+
+ if ((pSrc->type == BITS || pixman_image_can_get_solid (pSrc)) && (!pMask || pMask->type == BITS)
&& !srcTransform && !maskTransform
&& !maskAlphaMap && !srcAlphaMap && !dstAlphaMap
&& (pSrc->common.filter != PIXMAN_FILTER_CONVOLUTION)
@@ -1674,17 +1815,21 @@ pixman_image_composite (pixman_op_t op,
info = NULL;
#ifdef USE_SSE2
- if (pixman_have_sse ())
- info = get_fast_path (sse_fast_paths, op, pSrc, pMask, pDst, pixbuf);
- if (!info)
+ if (pixman_have_sse2 ())
+ info = get_fast_path (sse2_fast_paths, op, pSrc, pMask, pDst, pixbuf);
#endif
#ifdef USE_MMX
-
- if (pixman_have_mmx())
+ if (!info && pixman_have_mmx())
info = get_fast_path (mmx_fast_paths, op, pSrc, pMask, pDst, pixbuf);
- if (!info)
#endif
+
+#ifdef USE_VMX
+
+ if (!info && pixman_have_vmx())
+ info = get_fast_path (vmx_fast_paths, op, pSrc, pMask, pDst, pixbuf);
+#endif
+ if (!info)
info = get_fast_path (c_fast_paths, op, pSrc, pMask, pDst, pixbuf);
if (info)
@@ -1751,6 +1896,59 @@ pixman_image_composite (pixman_op_t op,
}
+#ifdef USE_VMX
+/* The CPU detection code needs to be in a file not compiled with
+ * "-maltivec -mabi=altivec", as gcc would try to save vector register
+ * across function calls causing SIGILL on cpus without Altivec/vmx.
+ */
+static pixman_bool_t initialized = FALSE;
+static volatile pixman_bool_t have_vmx = TRUE;
+
+#ifdef __APPLE__
+#include <sys/sysctl.h>
+
+pixman_bool_t pixman_have_vmx (void) {
+ if(!initialized) {
+ size_t length = sizeof(have_vmx);
+ int error =
+ sysctlbyname("hw.optional.altivec", &have_vmx, &length, NULL, 0);
+ if(error) have_vmx = FALSE;
+ initialized = TRUE;
+ }
+ return have_vmx;
+}
+
+#else
+#include <signal.h>
+#include <setjmp.h>
+
+static jmp_buf jump_env;
+
+static void vmx_test(int sig, siginfo_t *si, void *unused) {
+ longjmp (jump_env, 1);
+}
+
+pixman_bool_t pixman_have_vmx (void) {
+ struct sigaction sa, osa;
+ int jmp_result;
+ if (!initialized) {
+ sa.sa_flags = SA_SIGINFO;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_sigaction = vmx_test;
+ sigaction(SIGILL, &sa, &osa);
+ jmp_result = setjmp (jump_env);
+ if (jmp_result == 0) {
+ asm volatile ( "vor 0, 0, 0" );
+ }
+ sigaction(SIGILL, &osa, NULL);
+ have_vmx = (jmp_result == 0);
+ initialized = TRUE;
+ }
+ return have_vmx;
+}
+#endif /* __APPLE__ */
+#endif /* USE_VMX */
+
#ifdef USE_MMX
/* The CPU detection code needs to be in a file not compiled with
* "-mmmx -msse", as gcc would generate CMOV instructions otherwise
@@ -1951,19 +2149,19 @@ pixman_have_mmx (void)
#ifdef USE_SSE2
pixman_bool_t
-pixman_have_sse (void)
+pixman_have_sse2 (void)
{
static pixman_bool_t initialized = FALSE;
- static pixman_bool_t sse_present;
+ static pixman_bool_t sse2_present;
if (!initialized)
{
unsigned int features = detectCPUFeatures();
- sse_present = (features & (MMX|MMX_Extensions|SSE|SSE2)) == (MMX|MMX_Extensions|SSE|SSE2);
+ sse2_present = (features & (MMX|MMX_Extensions|SSE|SSE2)) == (MMX|MMX_Extensions|SSE|SSE2);
initialized = TRUE;
}
- return sse_present;
+ return sse2_present;
}
#endif
diff --git a/lib/pixman/pixman/pixman-private.h b/lib/pixman/pixman/pixman-private.h
index 5767c1084..e26a0c3de 100644
--- a/lib/pixman/pixman/pixman-private.h
+++ b/lib/pixman/pixman/pixman-private.h
@@ -143,15 +143,25 @@ typedef struct point point_t;
*/
#define FASTCALL
-typedef FASTCALL void (*CombineMaskU) (uint32_t *src, const uint32_t *mask, int width);
-typedef FASTCALL void (*CombineFuncU) (uint32_t *dest, const uint32_t *src, int width);
-typedef FASTCALL void (*CombineFuncC) (uint32_t *dest, uint32_t *src, uint32_t *mask, int width);
-typedef FASTCALL void (*fetchProc)(bits_image_t *pict, int x, int y, int width,
- uint32_t *buffer);
-typedef FASTCALL uint32_t (*fetchPixelProc)(bits_image_t *pict, int offset, int line);
-typedef FASTCALL void (*storeProc)(pixman_image_t *, uint32_t *bits,
- const uint32_t *values, int x, int width,
- const pixman_indexed_t *);
+typedef FASTCALL void (*CombineMaskU32) (uint32_t *src, const uint32_t *mask, int width);
+typedef FASTCALL void (*CombineFuncU32) (uint32_t *dest, const uint32_t *src, int width);
+typedef FASTCALL void (*CombineFuncC32) (uint32_t *dest, uint32_t *src, uint32_t *mask, int width);
+typedef FASTCALL void (*fetchProc32)(bits_image_t *pict, int x, int y, int width,
+ uint32_t *buffer);
+typedef FASTCALL uint32_t (*fetchPixelProc32)(bits_image_t *pict, int offset, int line);
+typedef FASTCALL void (*storeProc32)(pixman_image_t *, uint32_t *bits,
+ const uint32_t *values, int x, int width,
+ const pixman_indexed_t *);
+
+typedef FASTCALL void (*CombineMaskU64) (uint64_t *src, const uint64_t *mask, int width);
+typedef FASTCALL void (*CombineFuncU64) (uint64_t *dest, const uint64_t *src, int width);
+typedef FASTCALL void (*CombineFuncC64) (uint64_t *dest, uint64_t *src, uint64_t *mask, int width);
+typedef FASTCALL void (*fetchProc64)(bits_image_t *pict, int x, int y, int width,
+ uint64_t *buffer);
+typedef FASTCALL uint64_t (*fetchPixelProc64)(bits_image_t *pict, int offset, int line);
+typedef FASTCALL void (*storeProc64)(pixman_image_t *, uint32_t *bits,
+ const uint64_t *values, int x, int width,
+ const pixman_indexed_t *);
typedef struct _FbComposeData {
uint8_t op;
@@ -168,28 +178,49 @@ typedef struct _FbComposeData {
uint16_t height;
} FbComposeData;
-typedef struct _FbComposeFunctions {
- CombineFuncU *combineU;
- CombineFuncC *combineC;
- CombineMaskU combineMaskU;
-} FbComposeFunctions;
+typedef struct _FbComposeFunctions32 {
+ CombineFuncU32 *combineU;
+ CombineFuncC32 *combineC;
+ CombineMaskU32 combineMaskU;
+} FbComposeFunctions32;
-extern FbComposeFunctions pixman_composeFunctions;
+typedef struct _FbComposeFunctions64 {
+ CombineFuncU64 *combineU;
+ CombineFuncC64 *combineC;
+ CombineMaskU64 combineMaskU;
+} FbComposeFunctions64;
-void pixman_composite_rect_general_accessors (const FbComposeData *data,
- uint32_t *scanline_buffer);
-void pixman_composite_rect_general (const FbComposeData *data,
- uint32_t *scanline_buffer);
+extern FbComposeFunctions32 pixman_composeFunctions;
+extern FbComposeFunctions64 pixman_composeFunctions64;
-fetchProc pixman_fetchProcForPicture (bits_image_t *);
-fetchPixelProc pixman_fetchPixelProcForPicture (bits_image_t *);
-storeProc pixman_storeProcForPicture (bits_image_t *);
-fetchProc pixman_fetchProcForPicture_accessors (bits_image_t *);
-fetchPixelProc pixman_fetchPixelProcForPicture_accessors (bits_image_t *);
-storeProc pixman_storeProcForPicture_accessors (bits_image_t *);
+void pixman_composite_rect_general_accessors (const FbComposeData *data,
+ void *src_buffer,
+ void *mask_buffer,
+ void *dest_buffer,
+ const int wide);
+void pixman_composite_rect_general (const FbComposeData *data);
+
+fetchProc32 pixman_fetchProcForPicture32 (bits_image_t *);
+fetchPixelProc32 pixman_fetchPixelProcForPicture32 (bits_image_t *);
+storeProc32 pixman_storeProcForPicture32 (bits_image_t *);
+fetchProc32 pixman_fetchProcForPicture32_accessors (bits_image_t *);
+fetchPixelProc32 pixman_fetchPixelProcForPicture32_accessors (bits_image_t *);
+storeProc32 pixman_storeProcForPicture32_accessors (bits_image_t *);
+
+fetchProc64 pixman_fetchProcForPicture64 (bits_image_t *);
+fetchPixelProc64 pixman_fetchPixelProcForPicture64 (bits_image_t *);
+storeProc64 pixman_storeProcForPicture64 (bits_image_t *);
+fetchProc64 pixman_fetchProcForPicture64_accessors (bits_image_t *);
+fetchPixelProc64 pixman_fetchPixelProcForPicture64_accessors (bits_image_t *);
+storeProc64 pixman_storeProcForPicture64_accessors (bits_image_t *);
+
+void pixman_expand(uint64_t *dst, const uint32_t *src, pixman_format_code_t, int width);
+void pixman_contract(uint32_t *dst, const uint64_t *src, int width);
void pixmanFetchSourcePict(source_image_t *, int x, int y, int width,
uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
+void pixmanFetchSourcePict64(source_image_t *, int x, int y, int width,
+ uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
void fbFetchTransformed(bits_image_t *, int x, int y, int width,
uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
@@ -207,6 +238,22 @@ void fbFetchExternalAlpha_accessors(bits_image_t *, int x, int y, int width,
uint32_t *buffer, uint32_t *mask,
uint32_t maskBits);
+void fbFetchTransformed64(bits_image_t *, int x, int y, int width,
+ uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
+void fbStoreExternalAlpha64(bits_image_t *, int x, int y, int width,
+ uint64_t *buffer);
+void fbFetchExternalAlpha64(bits_image_t *, int x, int y, int width,
+ uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
+
+void fbFetchTransformed64_accessors(bits_image_t *, int x, int y, int width,
+ uint64_t *buffer, uint64_t *mask,
+ uint32_t maskBits);
+void fbStoreExternalAlpha64_accessors(bits_image_t *, int x, int y, int width,
+ uint64_t *buffer);
+void fbFetchExternalAlpha64_accessors(bits_image_t *, int x, int y, int width,
+ uint64_t *buffer, uint64_t *mask,
+ uint32_t maskBits);
+
/* end */
typedef enum
@@ -236,9 +283,9 @@ struct image_common
{
image_type_t type;
int32_t ref_count;
- pixman_region16_t full_region;
- pixman_region16_t clip_region;
- pixman_region16_t *src_clip;
+ pixman_region32_t full_region;
+ pixman_region32_t clip_region;
+ pixman_region32_t *src_clip;
pixman_bool_t has_client_clip;
pixman_transform_t *transform;
pixman_repeat_t repeat;
@@ -332,10 +379,6 @@ union pixman_image
};
-extern CombineFuncU pixman_fbCombineFuncU[];
-extern CombineFuncC pixman_fbCombineFuncC[];
-FASTCALL void pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int width);
-
#define LOG2_BITMAP_PAD 5
#define FB_STIP_SHIFT LOG2_BITMAP_PAD
#define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
@@ -397,11 +440,6 @@ FASTCALL void pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int wi
WRITE(img, (a)+2, (uint8_t) ((v) >> 16))))
#endif
-#define Alpha(x) ((x) >> 24)
-#define Red(x) (((x) >> 16) & 0xff)
-#define Green(x) (((x) >> 8) & 0xff)
-#define Blue(x) ((x) & 0xff)
-
#define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \
(((s) >> 8) & 0xff) * 301 + \
(((s) ) & 0xff) * 58) >> 2)
@@ -445,192 +483,11 @@ FASTCALL void pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int wi
#define FbInC(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i))
-#define FbGen(x,y,i,ax,ay,t,u,v) ((t) = (FbIntMult(FbGet8(y,i),ay,(u)) + \
- FbIntMult(FbGet8(x,i),ax,(v))), \
- (uint32_t) ((uint8_t) ((t) | \
- (0 - ((t) >> 8)))) << (i))
-
#define FbAdd(x,y,i,t) ((t) = FbGet8(x,i) + FbGet8(y,i), \
(uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
-
-/*
- The methods below use some tricks to be able to do two color
- components at the same time.
-*/
-
-/*
- x_c = (x_c * a) / 255
-*/
-#define FbByteMul(x, a) do { \
- uint32_t t = ((x & 0xff00ff) * a) + 0x800080; \
- t = (t + ((t >> 8) & 0xff00ff)) >> 8; \
- t &= 0xff00ff; \
- \
- x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \
- x = (x + ((x >> 8) & 0xff00ff)); \
- x &= 0xff00ff00; \
- x += t; \
- } while (0)
-
-/*
- x_c = (x_c * a) / 255 + y
-*/
-#define FbByteMulAdd(x, a, y) do { \
- uint32_t t = ((x & 0xff00ff) * a) + 0x800080; \
- t = (t + ((t >> 8) & 0xff00ff)) >> 8; \
- t &= 0xff00ff; \
- t += y & 0xff00ff; \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- t &= 0xff00ff; \
- \
- x = (((x >> 8) & 0xff00ff) * a) + 0x800080; \
- x = (x + ((x >> 8) & 0xff00ff)) >> 8; \
- x &= 0xff00ff; \
- x += (y >> 8) & 0xff00ff; \
- x |= 0x1000100 - ((x >> 8) & 0xff00ff); \
- x &= 0xff00ff; \
- x <<= 8; \
- x += t; \
- } while (0)
-
-/*
- x_c = (x_c * a + y_c * b) / 255
-*/
-#define FbByteAddMul(x, a, y, b) do { \
- uint32_t t; \
- uint32_t r = (x >> 24) * a + (y >> 24) * b + 0x80; \
- r += (r >> 8); \
- r >>= 8; \
- \
- t = (x & 0xff00) * a + (y & 0xff00) * b; \
- t += (t >> 8) + 0x8000; \
- t >>= 16; \
- \
- t |= r << 16; \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- t &= 0xff00ff; \
- t <<= 8; \
- \
- r = ((x >> 16) & 0xff) * a + ((y >> 16) & 0xff) * b + 0x80; \
- r += (r >> 8); \
- r >>= 8; \
- \
- x = (x & 0xff) * a + (y & 0xff) * b + 0x80; \
- x += (x >> 8); \
- x >>= 8; \
- x |= r << 16; \
- x |= 0x1000100 - ((x >> 8) & 0xff00ff); \
- x &= 0xff00ff; \
- x |= t; \
- } while (0)
-
-/*
- x_c = (x_c * a + y_c *b) / 256
-*/
-#define FbByteAddMul_256(x, a, y, b) do { \
- uint32_t t = (x & 0xff00ff) * a + (y & 0xff00ff) * b; \
- t >>= 8; \
- t &= 0xff00ff; \
- \
- x = ((x >> 8) & 0xff00ff) * a + ((y >> 8) & 0xff00ff) * b; \
- x &= 0xff00ff00; \
- x += t; \
- } while (0)
-
-/*
- x_c = (x_c * a_c) / 255
-*/
-#define FbByteMulC(x, a) do { \
- uint32_t t; \
- uint32_t r = (x & 0xff) * (a & 0xff); \
- r |= (x & 0xff0000) * ((a >> 16) & 0xff); \
- r += 0x800080; \
- r = (r + ((r >> 8) & 0xff00ff)) >> 8; \
- r &= 0xff00ff; \
- \
- x >>= 8; \
- t = (x & 0xff) * ((a >> 8) & 0xff); \
- t |= (x & 0xff0000) * (a >> 24); \
- t += 0x800080; \
- t = t + ((t >> 8) & 0xff00ff); \
- x = r | (t & 0xff00ff00); \
- \
- } while (0)
-
-/*
- x_c = (x_c * a) / 255 + y
-*/
-#define FbByteMulAddC(x, a, y) do { \
- uint32_t t; \
- uint32_t r = (x & 0xff) * (a & 0xff); \
- r |= (x & 0xff0000) * ((a >> 16) & 0xff); \
- r += 0x800080; \
- r = (r + ((r >> 8) & 0xff00ff)) >> 8; \
- r &= 0xff00ff; \
- r += y & 0xff00ff; \
- r |= 0x1000100 - ((r >> 8) & 0xff00ff); \
- r &= 0xff00ff; \
- \
- x >>= 8; \
- t = (x & 0xff) * ((a >> 8) & 0xff); \
- t |= (x & 0xff0000) * (a >> 24); \
- t += 0x800080; \
- t = (t + ((t >> 8) & 0xff00ff)) >> 8; \
- t &= 0xff00ff; \
- t += (y >> 8) & 0xff00ff; \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- t &= 0xff00ff; \
- x = r | (t << 8); \
- } while (0)
-
-/*
- x_c = (x_c * a_c + y_c * b) / 255
-*/
-#define FbByteAddMulC(x, a, y, b) do { \
- uint32_t t; \
- uint32_t r = (x >> 24) * (a >> 24) + (y >> 24) * b; \
- r += (r >> 8) + 0x80; \
- r >>= 8; \
- \
- t = (x & 0xff00) * ((a >> 8) & 0xff) + (y & 0xff00) * b; \
- t += (t >> 8) + 0x8000; \
- t >>= 16; \
- \
- t |= r << 16; \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- t &= 0xff00ff; \
- t <<= 8; \
- \
- r = ((x >> 16) & 0xff) * ((a >> 16) & 0xff) + ((y >> 16) & 0xff) * b + 0x80; \
- r += (r >> 8); \
- r >>= 8; \
- \
- x = (x & 0xff) * (a & 0xff) + (y & 0xff) * b + 0x80; \
- x += (x >> 8); \
- x >>= 8; \
- x |= r << 16; \
- x |= 0x1000100 - ((x >> 8) & 0xff00ff); \
- x &= 0xff00ff; \
- x |= t; \
- } while (0)
-
-/*
- x_c = min(x_c + y_c, 255)
-*/
-#define FbByteAdd(x, y) do { \
- uint32_t t; \
- uint32_t r = (x & 0xff00ff) + (y & 0xff00ff); \
- r |= 0x1000100 - ((r >> 8) & 0xff00ff); \
- r &= 0xff00ff; \
- \
- t = ((x >> 8) & 0xff00ff) + ((y >> 8) & 0xff00ff); \
- t |= 0x1000100 - ((t >> 8) & 0xff00ff); \
- r |= (t & 0xff00ff) << 8; \
- x = r; \
- } while (0)
-
#define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8)
+#define div_65535(x) (((x) + 0x8000 + (((x) + 0x8000) >> 16)) >> 16)
#define MOD(a,b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b))
@@ -685,6 +542,8 @@ FASTCALL void pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int wi
#ifdef PIXMAN_FB_ACCESSORS
+#define ACCESS(sym) sym##_accessors
+
#define READ(img, ptr) \
((img)->common.read_func ((ptr), sizeof(*(ptr))))
#define WRITE(img, ptr,val) \
@@ -710,6 +569,8 @@ FASTCALL void pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int wi
#else
+#define ACCESS(sym) sym
+
#define READ(img, ptr) (*(ptr))
#define WRITE(img, ptr, val) (*(ptr) = (val))
#define MEMCPY_WRAPPED(img, dst, src, size) \
@@ -786,6 +647,10 @@ FASTCALL void pixman_fbCombineMaskU (uint32_t *src, const uint32_t *mask, int wi
} while (0)
+#define PIXMAN_FORMAT_16BPC(f) (PIXMAN_FORMAT_A(f) > 8 || \
+ PIXMAN_FORMAT_R(f) > 8 || \
+ PIXMAN_FORMAT_G(f) > 8 || \
+ PIXMAN_FORMAT_B(f) > 8)
/*
* Edges
*/
@@ -841,6 +706,44 @@ pixman_rasterize_edges_accessors (pixman_image_t *image,
pixman_fixed_t t,
pixman_fixed_t b);
+pixman_bool_t
+pixman_image_is_opaque(pixman_image_t *image);
+
+pixman_bool_t
+pixman_image_can_get_solid (pixman_image_t *image);
+
+pixman_bool_t
+pixman_compute_composite_region32 (pixman_region32_t * pRegion,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+/* GCC visibility */
+#if defined(__GNUC__) && __GNUC__ >= 4
+#define PIXMAN_EXPORT __attribute__ ((visibility("default")))
+/* Sun Studio 8 visibility */
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define PIXMAN_EXPORT __global
+#else
+#define PIXMAN_EXPORT
+#endif
+
+/* Region Helpers */
+pixman_bool_t pixman_region32_copy_from_region16 (pixman_region32_t *dst,
+ pixman_region16_t *src);
+pixman_bool_t pixman_region16_copy_from_region32 (pixman_region16_t *dst,
+ pixman_region32_t *src);
+void pixman_region_internal_set_static_pointers (pixman_box16_t *empty_box,
+ pixman_region16_data_t *empty_data,
+ pixman_region16_data_t *broken_data);
#ifdef PIXMAN_TIMING
diff --git a/lib/pixman/pixman/pixman-region.c b/lib/pixman/pixman/pixman-region.c
index 496ce7728..559454a7e 100644
--- a/lib/pixman/pixman/pixman-region.c
+++ b/lib/pixman/pixman/pixman-region.c
@@ -45,29 +45,19 @@ SOFTWARE.
******************************************************************/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <stdio.h>
-#include "pixman-private.h"
-
-typedef struct pixman_region16_point {
- int x, y;
-} pixman_region16_point_t;
-
#define PIXREGION_NIL(reg) ((reg)->data && !(reg)->data->numRects)
/* not a region */
#define PIXREGION_NAR(reg) ((reg)->data == pixman_brokendata)
#define PIXREGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1)
#define PIXREGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0)
-#define PIXREGION_RECTS(reg) ((reg)->data ? (pixman_box16_t *)((reg)->data + 1) \
+#define PIXREGION_RECTS(reg) ((reg)->data ? (box_type_t *)((reg)->data + 1) \
: &(reg)->extents)
-#define PIXREGION_BOXPTR(reg) ((pixman_box16_t *)((reg)->data + 1))
+#define PIXREGION_BOXPTR(reg) ((box_type_t *)((reg)->data + 1))
#define PIXREGION_BOX(reg,i) (&PIXREGION_BOXPTR(reg)[i])
#define PIXREGION_TOP(reg) PIXREGION_BOX(reg, (reg)->data->numRects)
#define PIXREGION_END(reg) PIXREGION_BOX(reg, (reg)->data->numRects - 1)
@@ -82,20 +72,20 @@ typedef struct pixman_region16_point {
#define assert(expr)
#endif
-#define good(reg) assert(pixman_region_selfcheck(reg))
+#define good(reg) assert(PREFIX(_selfcheck) (reg))
#undef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
-static const pixman_box16_t _pixman_region_emptyBox = {0, 0, 0, 0};
-static const pixman_region16_data_t _pixman_region_emptyData = {0, 0};
-static const pixman_region16_data_t _pixman_brokendata = {0, 0};
+static const box_type_t PREFIX(_emptyBox_) = {0, 0, 0, 0};
+static const region_data_type_t PREFIX(_emptyData_) = {0, 0};
+static const region_data_type_t PREFIX(_brokendata_) = {0, 0};
-static pixman_box16_t *pixman_region_emptyBox = (pixman_box16_t *)&_pixman_region_emptyBox;
-static pixman_region16_data_t *pixman_region_emptyData = (pixman_region16_data_t *)&_pixman_region_emptyData;
-static pixman_region16_data_t *pixman_brokendata = (pixman_region16_data_t *)&_pixman_brokendata;
+static box_type_t *pixman_region_emptyBox = (box_type_t *)&PREFIX(_emptyBox_);
+static region_data_type_t *pixman_region_emptyData = (region_data_type_t *)&PREFIX(_emptyData_);
+static region_data_type_t *pixman_brokendata = (region_data_type_t *)&PREFIX(_brokendata_);
/* This function exists only to make it possible to preserve the X ABI - it should
* go away at first opportunity.
@@ -106,9 +96,9 @@ static pixman_region16_data_t *pixman_brokendata = (pixman_region16_data_t *)&_p
* work.
*/
void
-pixman_region_set_static_pointers (pixman_box16_t *empty_box,
- pixman_region16_data_t *empty_data,
- pixman_region16_data_t *broken_data)
+PREFIX(_internal_set_static_pointers) (box_type_t *empty_box,
+ region_data_type_t *empty_data,
+ region_data_type_t *broken_data)
{
pixman_region_emptyBox = empty_box;
pixman_region_emptyData = empty_data;
@@ -116,7 +106,7 @@ pixman_region_set_static_pointers (pixman_box16_t *empty_box,
}
static pixman_bool_t
-pixman_break (pixman_region16_t *pReg);
+pixman_break (region_type_t *pReg);
/*
* The functions in this file implement the Region abstraction used extensively
@@ -190,14 +180,14 @@ pixman_break (pixman_region16_t *pReg);
static size_t
PIXREGION_SZOF(size_t n)
{
- size_t size = n * sizeof(pixman_box16_t);
- if (n > UINT32_MAX / sizeof(pixman_box16_t))
+ size_t size = n * sizeof(box_type_t);
+ if (n > UINT32_MAX / sizeof(box_type_t))
return 0;
- if (sizeof(pixman_region16_data_t) > UINT32_MAX - size)
+ if (sizeof(region_data_type_t) > UINT32_MAX - size)
return 0;
- return size + sizeof(pixman_region16_data_t);
+ return size + sizeof(region_data_type_t);
}
static void *
@@ -245,12 +235,12 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
#define DOWNSIZE(reg,numRects) \
if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
{ \
- pixman_region16_data_t * NewData; \
+ region_data_type_t * NewData; \
size_t data_size = PIXREGION_SZOF(numRects); \
if (!data_size) \
NewData = NULL; \
else \
- NewData = (pixman_region16_data_t *)realloc((reg)->data, data_size); \
+ NewData = (region_data_type_t *)realloc((reg)->data, data_size); \
if (NewData) \
{ \
NewData->size = (numRects); \
@@ -258,14 +248,14 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
} \
}
-pixman_bool_t
-pixman_region_equal(reg1, reg2)
- pixman_region16_t * reg1;
- pixman_region16_t * reg2;
+PIXMAN_EXPORT pixman_bool_t
+PREFIX(_equal) (reg1, reg2)
+ region_type_t * reg1;
+ region_type_t * reg2;
{
int i;
- pixman_box16_t *rects1;
- pixman_box16_t *rects2;
+ box_type_t *rects1;
+ box_type_t *rects2;
if (reg1->extents.x1 != reg2->extents.x1) return FALSE;
if (reg1->extents.x2 != reg2->extents.x2) return FALSE;
@@ -285,12 +275,12 @@ pixman_region_equal(reg1, reg2)
}
int
-pixman_region16_print(rgn)
- pixman_region16_t * rgn;
+PREFIX(_print) (rgn)
+ region_type_t * rgn;
{
int num, size;
int i;
- pixman_box16_t * rects;
+ box_type_t * rects;
num = PIXREGION_NUM_RECTS(rgn);
size = PIXREGION_SIZE(rgn);
@@ -306,16 +296,16 @@ pixman_region16_print(rgn)
}
-void
-pixman_region_init (pixman_region16_t *region)
+PIXMAN_EXPORT void
+PREFIX(_init) (region_type_t *region)
{
region->extents = *pixman_region_emptyBox;
region->data = pixman_region_emptyData;
}
-void
-pixman_region_init_rect (pixman_region16_t *region,
- int x, int y, unsigned int width, unsigned int height)
+PIXMAN_EXPORT void
+PREFIX(_init_rect) (region_type_t *region,
+ int x, int y, unsigned int width, unsigned int height)
{
region->extents.x1 = x;
region->extents.y1 = y;
@@ -324,35 +314,29 @@ pixman_region_init_rect (pixman_region16_t *region,
region->data = NULL;
}
-void
-pixman_region_init_with_extents (pixman_region16_t *region, pixman_box16_t *extents)
+PIXMAN_EXPORT void
+PREFIX(_init_with_extents) (region_type_t *region, box_type_t *extents)
{
region->extents = *extents;
region->data = NULL;
}
-void
-pixman_region_fini (pixman_region16_t *region)
+PIXMAN_EXPORT void
+PREFIX(_fini) (region_type_t *region)
{
good (region);
freeData (region);
}
-int
-pixman_region_n_rects (pixman_region16_t *region)
+PIXMAN_EXPORT int
+PREFIX(_n_rects) (region_type_t *region)
{
return PIXREGION_NUM_RECTS (region);
}
-pixman_box16_t *
-pixman_region_rects (pixman_region16_t *region)
-{
- return PIXREGION_RECTS (region);
-}
-
-pixman_box16_t *
-pixman_region_rectangles (pixman_region16_t *region,
- int *n_rects)
+PIXMAN_EXPORT box_type_t *
+PREFIX(_rectangles) (region_type_t *region,
+ int *n_rects)
{
if (n_rects)
*n_rects = PIXREGION_NUM_RECTS (region);
@@ -361,7 +345,7 @@ pixman_region_rectangles (pixman_region16_t *region,
}
static pixman_bool_t
-pixman_break (pixman_region16_t *region)
+pixman_break (region_type_t *region)
{
freeData (region);
region->extents = *pixman_region_emptyBox;
@@ -370,9 +354,9 @@ pixman_break (pixman_region16_t *region)
}
static pixman_bool_t
-pixman_rect_alloc (pixman_region16_t * region, int n)
+pixman_rect_alloc (region_type_t * region, int n)
{
- pixman_region16_data_t *data;
+ region_data_type_t *data;
if (!region->data)
{
@@ -404,7 +388,7 @@ pixman_rect_alloc (pixman_region16_t * region, int n)
if (!data_size)
data = NULL;
else
- data = (pixman_region16_data_t *)realloc(region->data, PIXREGION_SZOF(n));
+ data = (region_data_type_t *)realloc(region->data, PIXREGION_SZOF(n));
if (!data)
return pixman_break (region);
region->data = data;
@@ -413,8 +397,8 @@ pixman_rect_alloc (pixman_region16_t * region, int n)
return TRUE;
}
-pixman_bool_t
-pixman_region_copy (pixman_region16_t *dst, pixman_region16_t *src)
+PIXMAN_EXPORT pixman_bool_t
+PREFIX(_copy) (region_type_t *dst, region_type_t *src)
{
good(dst);
good(src);
@@ -437,7 +421,7 @@ pixman_region_copy (pixman_region16_t *dst, pixman_region16_t *src)
}
dst->data->numRects = src->data->numRects;
memmove((char *)PIXREGION_BOXPTR(dst),(char *)PIXREGION_BOXPTR(src),
- dst->data->numRects * sizeof(pixman_box16_t));
+ dst->data->numRects * sizeof(box_type_t));
return TRUE;
}
@@ -465,12 +449,12 @@ pixman_region_copy (pixman_region16_t *dst, pixman_region16_t *src)
*/
static inline int
pixman_coalesce (
- pixman_region16_t * region, /* Region to coalesce */
+ region_type_t * region, /* Region to coalesce */
int prevStart, /* Index of start of previous band */
int curStart) /* Index of start of current band */
{
- pixman_box16_t * pPrevBox; /* Current box in previous band */
- pixman_box16_t * pCurBox; /* Current box in current band */
+ box_type_t * pPrevBox; /* Current box in previous band */
+ box_type_t * pCurBox; /* Current box in current band */
int numRects; /* Number rectangles in both bands */
int y2; /* Bottom of current band */
/*
@@ -548,13 +532,13 @@ pixman_coalesce (
static inline pixman_bool_t
pixman_region_appendNonO (
- pixman_region16_t * region,
- pixman_box16_t * r,
- pixman_box16_t * rEnd,
+ region_type_t * region,
+ box_type_t * r,
+ box_type_t * rEnd,
int y1,
int y2)
{
- pixman_box16_t * pNextRect;
+ box_type_t * pNextRect;
int newRects;
newRects = rEnd - r;
@@ -590,7 +574,7 @@ pixman_region_appendNonO (
if ((newRects = rEnd - r)) { \
RECTALLOC(newReg, newRects); \
memmove((char *)PIXREGION_TOP(newReg),(char *)r, \
- newRects * sizeof(pixman_box16_t)); \
+ newRects * sizeof(box_type_t)); \
newReg->data->numRects += newRects; \
} \
}
@@ -625,20 +609,20 @@ pixman_region_appendNonO (
*/
typedef pixman_bool_t (*OverlapProcPtr)(
- pixman_region16_t *region,
- pixman_box16_t *r1,
- pixman_box16_t *r1End,
- pixman_box16_t *r2,
- pixman_box16_t *r2End,
- short y1,
- short y2,
+ region_type_t *region,
+ box_type_t *r1,
+ box_type_t *r1End,
+ box_type_t *r2,
+ box_type_t *r2End,
+ int y1,
+ int y2,
int *pOverlap);
static pixman_bool_t
pixman_op(
- pixman_region16_t *newReg, /* Place to store result */
- pixman_region16_t * reg1, /* First region in operation */
- pixman_region16_t * reg2, /* 2d region in operation */
+ region_type_t *newReg, /* Place to store result */
+ region_type_t * reg1, /* First region in operation */
+ region_type_t * reg2, /* 2d region in operation */
OverlapProcPtr overlapFunc, /* Function to call for over-
* lapping bands */
int appendNon1, /* Append non-overlapping bands */
@@ -647,21 +631,21 @@ pixman_op(
/* in region 2 ? */
int *pOverlap)
{
- pixman_box16_t * r1; /* Pointer into first region */
- pixman_box16_t * r2; /* Pointer into 2d region */
- pixman_box16_t * r1End; /* End of 1st region */
- pixman_box16_t * r2End; /* End of 2d region */
- short ybot; /* Bottom of intersection */
- short ytop; /* Top of intersection */
- pixman_region16_data_t * oldData; /* Old data for newReg */
+ box_type_t * r1; /* Pointer into first region */
+ box_type_t * r2; /* Pointer into 2d region */
+ box_type_t * r1End; /* End of 1st region */
+ box_type_t * r2End; /* End of 2d region */
+ int ybot; /* Bottom of intersection */
+ int ytop; /* Top of intersection */
+ region_data_type_t * oldData; /* Old data for newReg */
int prevBand; /* Index of start of
* previous band in newReg */
int curBand; /* Index of start of current
* band in newReg */
- pixman_box16_t * r1BandEnd; /* End of current band in r1 */
- pixman_box16_t * r2BandEnd; /* End of current band in r2 */
- short top; /* Top of non-overlapping band */
- short bot; /* Bottom of non-overlapping band*/
+ box_type_t * r1BandEnd; /* End of current band in r1 */
+ box_type_t * r2BandEnd; /* End of current band in r2 */
+ int top; /* Top of non-overlapping band */
+ int bot; /* Bottom of non-overlapping band*/
int r1y1; /* Temps for r1->y1 and r2->y1 */
int r2y1;
int newSize;
@@ -690,7 +674,7 @@ pixman_op(
assert(r1 != r1End);
assert(r2 != r2End);
- oldData = (pixman_region16_data_t *)NULL;
+ oldData = (region_data_type_t *)NULL;
if (((newReg == reg1) && (newSize > 1)) ||
((newReg == reg2) && (numRects > 1)))
{
@@ -848,7 +832,7 @@ pixman_op(
{
newReg->extents = *PIXREGION_BOXPTR(newReg);
freeData(newReg);
- newReg->data = (pixman_region16_data_t *)NULL;
+ newReg->data = (region_data_type_t *)NULL;
}
else
{
@@ -874,9 +858,9 @@ pixman_op(
*-----------------------------------------------------------------------
*/
static void
-pixman_set_extents (pixman_region16_t *region)
+pixman_set_extents (region_type_t *region)
{
- pixman_box16_t *box, *boxEnd;
+ box_type_t *box, *boxEnd;
if (!region->data)
return;
@@ -932,18 +916,18 @@ pixman_set_extents (pixman_region16_t *region)
*/
/*ARGSUSED*/
static pixman_bool_t
-pixman_region_intersectO (pixman_region16_t *region,
- pixman_box16_t *r1,
- pixman_box16_t *r1End,
- pixman_box16_t *r2,
- pixman_box16_t *r2End,
- short y1,
- short y2,
+pixman_region_intersectO (region_type_t *region,
+ box_type_t *r1,
+ box_type_t *r1End,
+ box_type_t *r2,
+ box_type_t *r2End,
+ int y1,
+ int y2,
int *pOverlap)
{
int x1;
int x2;
- pixman_box16_t * pNextRect;
+ box_type_t * pNextRect;
pNextRect = PIXREGION_TOP(region);
@@ -977,10 +961,10 @@ pixman_region_intersectO (pixman_region16_t *region,
return TRUE;
}
-pixman_bool_t
-pixman_region_intersect (pixman_region16_t * newReg,
- pixman_region16_t * reg1,
- pixman_region16_t * reg2)
+PIXMAN_EXPORT pixman_bool_t
+PREFIX(_intersect) (region_type_t * newReg,
+ region_type_t * reg1,
+ region_type_t * reg2)
{
good(reg1);
good(reg2);
@@ -1009,19 +993,19 @@ pixman_region_intersect (pixman_region16_t * newReg,
newReg->extents.x2 = MIN(reg1->extents.x2, reg2->extents.x2);
newReg->extents.y2 = MIN(reg1->extents.y2, reg2->extents.y2);
freeData(newReg);
- newReg->data = (pixman_region16_data_t *)NULL;
+ newReg->data = (region_data_type_t *)NULL;
}
else if (!reg2->data && SUBSUMES(&reg2->extents, &reg1->extents))
{
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
}
else if (!reg1->data && SUBSUMES(&reg1->extents, &reg2->extents))
{
- return pixman_region_copy(newReg, reg2);
+ return PREFIX(_copy) (newReg, reg2);
}
else if (reg1 == reg2)
{
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
}
else
{
@@ -1073,16 +1057,16 @@ pixman_region_intersect (pixman_region16_t * newReg,
*/
static pixman_bool_t
pixman_region_unionO (
- pixman_region16_t *region,
- pixman_box16_t *r1,
- pixman_box16_t *r1End,
- pixman_box16_t *r2,
- pixman_box16_t *r2End,
- short y1,
- short y2,
+ region_type_t *region,
+ box_type_t *r1,
+ box_type_t *r1End,
+ box_type_t *r2,
+ box_type_t *r2End,
+ int y1,
+ int y2,
int *pOverlap)
{
- pixman_box16_t * pNextRect;
+ box_type_t * pNextRect;
int x1; /* left and right side of current union */
int x2;
@@ -1134,29 +1118,29 @@ pixman_region_unionO (
/* Convenience function for performing union of region with a
* single rectangle
*/
-pixman_bool_t
-pixman_region_union_rect (pixman_region16_t *dest,
- pixman_region16_t *source,
+PIXMAN_EXPORT pixman_bool_t
+PREFIX(_union_rect) (region_type_t *dest,
+ region_type_t *source,
int x, int y,
unsigned int width, unsigned int height)
{
- pixman_region16_t region;
+ region_type_t region;
if (!width || !height)
- return pixman_region_copy (dest, source);
+ return PREFIX(_copy) (dest, source);
region.data = NULL;
region.extents.x1 = x;
region.extents.y1 = y;
region.extents.x2 = x + width;
region.extents.y2 = y + height;
- return pixman_region_union (dest, source, &region);
+ return PREFIX(_union) (dest, source, &region);
}
-pixman_bool_t
-pixman_region_union (pixman_region16_t *newReg,
- pixman_region16_t *reg1,
- pixman_region16_t *reg2)
+PIXMAN_EXPORT pixman_bool_t
+PREFIX(_union) (region_type_t *newReg,
+ region_type_t *reg1,
+ region_type_t *reg2)
{
int overlap; /* result ignored */
@@ -1173,7 +1157,7 @@ pixman_region_union (pixman_region16_t *newReg,
*/
if (reg1 == reg2)
{
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
}
/*
@@ -1184,7 +1168,7 @@ pixman_region_union (pixman_region16_t *newReg,
if (PIXREGION_NAR(reg1))
return pixman_break (newReg);
if (newReg != reg2)
- return pixman_region_copy(newReg, reg2);
+ return PREFIX(_copy) (newReg, reg2);
return TRUE;
}
@@ -1196,7 +1180,7 @@ pixman_region_union (pixman_region16_t *newReg,
if (PIXREGION_NAR(reg2))
return pixman_break (newReg);
if (newReg != reg1)
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
return TRUE;
}
@@ -1206,7 +1190,7 @@ pixman_region_union (pixman_region16_t *newReg,
if (!reg1->data && SUBSUMES(&reg1->extents, &reg2->extents))
{
if (newReg != reg1)
- return pixman_region_copy(newReg, reg1);
+ return PREFIX(_copy) (newReg, reg1);
return TRUE;
}
@@ -1216,7 +1200,7 @@ pixman_region_union (pixman_region16_t *newReg,
if (!reg2->data && SUBSUMES(&reg2->extents, &reg1->extents))
{
if (newReg != reg2)
- return pixman_region_copy(newReg, reg2);
+ return PREFIX(_copy) (newReg, reg2);
return TRUE;
}
@@ -1235,112 +1219,9 @@ pixman_region_union (pixman_region16_t *newReg,
* Batch Rectangle Union
*====================================================================*/
-/*-
- *-----------------------------------------------------------------------
- * pixman_region_append --
- *
- * "Append" the rgn rectangles onto the end of dstrgn, maintaining
- * knowledge of YX-banding when it's easy. Otherwise, dstrgn just
- * becomes a non-y-x-banded random collection of rectangles, and not
- * yet a true region. After a sequence of appends, the caller must
- * call pixman_region_validate to ensure that a valid region is
- * constructed.
- *
- * Results:
- * TRUE if successful.
- *
- * Side Effects:
- * dstrgn is modified if rgn has rectangles.
- *
- */
-pixman_bool_t
-pixman_region_append (pixman_region16_t * dstrgn,
- pixman_region16_t * rgn)
-{
- int numRects, dnumRects, size;
- pixman_box16_t *new, *old;
- int prepend;
-
- if (PIXREGION_NAR(rgn))
- return pixman_break (dstrgn);
-
- if (!rgn->data && (dstrgn->data == pixman_region_emptyData))
- {
- dstrgn->extents = rgn->extents;
- dstrgn->data = (pixman_region16_data_t *)NULL;
- return TRUE;
- }
-
- numRects = PIXREGION_NUM_RECTS(rgn);
- if (!numRects)
- return TRUE;
- prepend = FALSE;
- size = numRects;
- dnumRects = PIXREGION_NUM_RECTS(dstrgn);
- if (!dnumRects && (size < 200))
- size = 200; /* XXX pick numbers out of a hat */
- RECTALLOC(dstrgn, size);
- old = PIXREGION_RECTS(rgn);
- if (!dnumRects)
- dstrgn->extents = rgn->extents;
- else if (dstrgn->extents.x2 > dstrgn->extents.x1)
- {
- pixman_box16_t *first, *last;
-
- first = old;
- last = PIXREGION_BOXPTR(dstrgn) + (dnumRects - 1);
- if ((first->y1 > last->y2) ||
- ((first->y1 == last->y1) && (first->y2 == last->y2) &&
- (first->x1 > last->x2)))
- {
- if (rgn->extents.x1 < dstrgn->extents.x1)
- dstrgn->extents.x1 = rgn->extents.x1;
- if (rgn->extents.x2 > dstrgn->extents.x2)
- dstrgn->extents.x2 = rgn->extents.x2;
- dstrgn->extents.y2 = rgn->extents.y2;
- }
- else
- {
- first = PIXREGION_BOXPTR(dstrgn);
- last = old + (numRects - 1);
- if ((first->y1 > last->y2) ||
- ((first->y1 == last->y1) && (first->y2 == last->y2) &&
- (first->x1 > last->x2)))
- {
- prepend = TRUE;
- if (rgn->extents.x1 < dstrgn->extents.x1)
- dstrgn->extents.x1 = rgn->extents.x1;
- if (rgn->extents.x2 > dstrgn->extents.x2)
- dstrgn->extents.x2 = rgn->extents.x2;
- dstrgn->extents.y1 = rgn->extents.y1;
- }
- else
- dstrgn->extents.x2 = dstrgn->extents.x1;
- }
- }
- if (prepend)
- {
- new = PIXREGION_BOX(dstrgn, numRects);
- if (dnumRects == 1)
- *new = *PIXREGION_BOXPTR(dstrgn);
- else
- memmove((char *)new,(char *)PIXREGION_BOXPTR(dstrgn),
- dnumRects * sizeof(pixman_box16_t));
- new = PIXREGION_BOXPTR(dstrgn);
- }
- else
- new = PIXREGION_BOXPTR(dstrgn) + dnumRects;
- if (numRects == 1)
- *new = *old;
- else
- memmove((char *)new, (char *)old, numRects * sizeof(pixman_box16_t));
- dstrgn->data->numRects += numRects;
- return TRUE;
-}
-
#define ExchangeRects(a, b) \
{ \
- pixman_box16_t t; \
+ box_type_t t; \
t = rects[a]; \
rects[a] = rects[b]; \
rects[b] = t; \
@@ -1348,13 +1229,13 @@ pixman_region_append (pixman_region16_t * dstrgn,
static void
QuickSortRects(
- pixman_box16_t rects[],
+ box_type_t rects[],
int numRects)
{
int y1;
int x1;
int i, j;
- pixman_box16_t *r;
+ box_type_t *r;
/* Always called with numRects > 1 */
@@ -1438,13 +1319,13 @@ QuickSortRects(
*-----------------------------------------------------------------------
*/
-pixman_bool_t
-pixman_region_validate(pixman_region16_t * badreg,
- int *pOverlap)
+static pixman_bool_t
+validate (region_type_t * badreg,
+ int *pOverlap)
{
/* Descriptor for regions under construction in Step 2. */
typedef struct {
- pixman_region16_t reg;
+ region_type_t reg;
int prevBand;
int curBand;
} RegionInfo;
@@ -1456,10 +1337,10 @@ pixman_region_validate(pixman_region16_t * badreg,
int i; /* Index into rects */
int j; /* Index into ri */
RegionInfo *rit; /* &ri[j] */
- pixman_region16_t * reg; /* ri[j].reg */
- pixman_box16_t * box; /* Current box in rects */
- pixman_box16_t * riBox; /* Last box in ri[j].reg */
- pixman_region16_t * hreg; /* ri[j_half].reg */
+ region_type_t * reg; /* ri[j].reg */
+ box_type_t * box; /* Current box in rects */
+ box_type_t * riBox; /* Last box in ri[j].reg */
+ region_type_t * hreg; /* ri[j_half].reg */
pixman_bool_t ret = TRUE;
*pOverlap = FALSE;
@@ -1481,7 +1362,7 @@ pixman_region_validate(pixman_region16_t * badreg,
if ((numRects) == 1)
{
freeData(badreg);
- badreg->data = (pixman_region16_data_t *) NULL;
+ badreg->data = (region_data_type_t *) NULL;
}
else
{
@@ -1580,7 +1461,7 @@ pixman_region_validate(pixman_region16_t * badreg,
rit->prevBand = 0;
rit->curBand = 0;
rit->reg.extents = *box;
- rit->reg.data = (pixman_region16_data_t *)NULL;
+ rit->reg.data = (region_data_type_t *)NULL;
if (!pixman_rect_alloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */
goto bail;
NextRect: ;
@@ -1599,7 +1480,7 @@ NextRect: ;
if (reg->data->numRects == 1) /* keep unions happy below */
{
freeData(reg);
- reg->data = (pixman_region16_data_t *)NULL;
+ reg->data = (region_data_type_t *)NULL;
}
}
@@ -1660,16 +1541,16 @@ bail:
/*ARGSUSED*/
static pixman_bool_t
pixman_region_subtractO (
- pixman_region16_t * region,
- pixman_box16_t * r1,
- pixman_box16_t * r1End,
- pixman_box16_t * r2,
- pixman_box16_t * r2End,
- short y1,
- short y2,
+ region_type_t * region,
+ box_type_t * r1,
+ box_type_t * r1End,
+ box_type_t * r2,
+ box_type_t * r2End,
+ int y1,
+ int y2,
int *pOverlap)
{
- pixman_box16_t * pNextRect;
+ box_type_t * pNextRect;
int x1;
x1 = r1->x1;
@@ -1781,10 +1662,10 @@ pixman_region_subtractO (
*
*-----------------------------------------------------------------------
*/
-pixman_bool_t
-pixman_region_subtract(pixman_region16_t * regD,
- pixman_region16_t * regM,
- pixman_region16_t * regS)
+PIXMAN_EXPORT pixman_bool_t
+PREFIX(_subtract) (region_type_t * regD,
+ region_type_t * regM,
+ region_type_t * regS)
{
int overlap; /* result ignored */
@@ -1797,7 +1678,7 @@ pixman_region_subtract(pixman_region16_t * regD,
{
if (PIXREGION_NAR (regS))
return pixman_break (regD);
- return pixman_region_copy(regD, regM);
+ return PREFIX(_copy) (regD, regM);
}
else if (regM == regS)
{
@@ -1846,11 +1727,11 @@ pixman_region_subtract(pixman_region16_t * regD,
*-----------------------------------------------------------------------
*/
pixman_bool_t
-pixman_region_inverse(pixman_region16_t * newReg, /* Destination region */
- pixman_region16_t * reg1, /* Region to invert */
- pixman_box16_t * invRect) /* Bounding box for inversion */
+PIXMAN_EXPORT PREFIX(_inverse) (region_type_t * newReg, /* Destination region */
+ region_type_t * reg1, /* Region to invert */
+ box_type_t * invRect) /* Bounding box for inversion */
{
- pixman_region16_t invReg; /* Quick and dirty region made from the
+ region_type_t invReg; /* Quick and dirty region made from the
* bounding box */
int overlap; /* result ignored */
@@ -1863,7 +1744,7 @@ pixman_region_inverse(pixman_region16_t * newReg, /* Destination region
return pixman_break (newReg);
newReg->extents = *invRect;
freeData(newReg);
- newReg->data = (pixman_region16_data_t *)NULL;
+ newReg->data = (region_data_type_t *)NULL;
return TRUE;
}
@@ -1871,7 +1752,7 @@ pixman_region_inverse(pixman_region16_t * newReg, /* Destination region
do yucky substraction for overlaps, and
just throw away rectangles in region 2 that aren't in region 1 */
invReg.extents = *invRect;
- invReg.data = (pixman_region16_data_t *)NULL;
+ invReg.data = (region_data_type_t *)NULL;
if (!pixman_op(newReg, &invReg, reg1, pixman_region_subtractO, TRUE, FALSE, &overlap))
return FALSE;
@@ -1905,13 +1786,13 @@ pixman_region_inverse(pixman_region16_t * newReg, /* Destination region
*/
pixman_region_overlap_t
-pixman_region_contains_rectangle(pixman_region16_t * region,
- pixman_box16_t * prect)
+PIXMAN_EXPORT PREFIX(_contains_rectangle) (region_type_t * region,
+ box_type_t * prect)
{
int x;
int y;
- pixman_box16_t * pbox;
- pixman_box16_t * pboxEnd;
+ box_type_t * pbox;
+ box_type_t * pboxEnd;
int partIn, partOut;
int numRects;
@@ -2005,16 +1886,16 @@ pixman_region_contains_rectangle(pixman_region16_t * region,
}
}
-/* pixman_region_translate (region, x, y)
+/* PREFIX(_translate) (region, x, y)
translates in place
*/
-void
-pixman_region_translate (pixman_region16_t * region, int x, int y)
+PIXMAN_EXPORT void
+PREFIX(_translate) (region_type_t * region, int x, int y)
{
int x1, x2, y1, y2;
int nbox;
- pixman_box16_t * pbox;
+ box_type_t * pbox;
good(region);
region->extents.x1 = x1 = region->extents.x1 + x;
@@ -2053,7 +1934,7 @@ pixman_region_translate (pixman_region16_t * region, int x, int y)
region->extents.y2 = SHRT_MAX;
if (region->data && (nbox = region->data->numRects))
{
- pixman_box16_t * pboxout;
+ box_type_t * pboxout;
for (pboxout = pbox = PIXREGION_BOXPTR(region); nbox--; pbox++)
{
@@ -2083,7 +1964,7 @@ pixman_region_translate (pixman_region16_t * region, int x, int y)
{
region->extents = *PIXREGION_BOXPTR(region);
freeData(region);
- region->data = (pixman_region16_data_t *)NULL;
+ region->data = (region_data_type_t *)NULL;
}
else
pixman_set_extents(region);
@@ -2091,53 +1972,24 @@ pixman_region_translate (pixman_region16_t * region, int x, int y)
}
}
-/* XXX: Do we need this?
-static pixman_bool_t
-pixman_region16_data_copy(pixman_region16_t * dst, pixman_region16_t * src)
-{
- good(dst);
- good(src);
- if (dst->data)
- return TRUE;
- if (dst == src)
- return TRUE;
- if (!src->data || !src->data->size)
- {
- freeData(dst);
- dst->data = (pixman_region16_data_t *)NULL;
- return TRUE;
- }
- if (!dst->data || (dst->data->size < src->data->numRects))
- {
- freeData(dst);
- dst->data = allocData(src->data->numRects);
- if (!dst->data)
- return pixman_break (dst);
- }
- dst->data->size = src->data->size;
- dst->data->numRects = src->data->numRects;
- return TRUE;
-}
-*/
-
-void
-pixman_region_reset(pixman_region16_t *region, pixman_box16_t *box)
+PIXMAN_EXPORT void
+PREFIX(_reset) (region_type_t *region, box_type_t *box)
{
good(region);
assert(box->x1<=box->x2);
assert(box->y1<=box->y2);
region->extents = *box;
freeData(region);
- region->data = (pixman_region16_data_t *)NULL;
+ region->data = (region_data_type_t *)NULL;
}
/* box is "return" value */
-int
-pixman_region_contains_point(pixman_region16_t * region,
+PIXMAN_EXPORT int
+PREFIX(_contains_point) (region_type_t * region,
int x, int y,
- pixman_box16_t * box)
+ box_type_t * box)
{
- pixman_box16_t *pbox, *pboxEnd;
+ box_type_t *pbox, *pboxEnd;
int numRects;
good(region);
@@ -2165,150 +2017,20 @@ pixman_region_contains_point(pixman_region16_t * region,
return(FALSE);
}
-int
-pixman_region_not_empty(pixman_region16_t * region)
+PIXMAN_EXPORT int
+PREFIX(_not_empty) (region_type_t * region)
{
good(region);
return(!PIXREGION_NIL(region));
}
-/* XXX: Do we need this?
-static int
-pixman_region16_broken(pixman_region16_t * region)
-{
- good(region);
- return (PIXREGION_NAR(region));
-}
-*/
-
-void
-pixman_region_empty(pixman_region16_t * region)
-{
- good(region);
- freeData(region);
- region->extents.x2 = region->extents.x1;
- region->extents.y2 = region->extents.y1;
- region->data = pixman_region_emptyData;
-}
-
-pixman_box16_t *
-pixman_region_extents(pixman_region16_t * region)
+PIXMAN_EXPORT box_type_t *
+PREFIX(_extents) (region_type_t * region)
{
good(region);
return(&region->extents);
}
-#define ExchangeSpans(a, b) \
-{ \
- pixman_region16_point_t tpt; \
- int tw; \
- \
- tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt; \
- tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \
-}
-
-/* ||| I should apply the merge sort code to rectangle sorting above, and see
- if mapping time can be improved. But right now I've been at work 12 hours,
- so forget it.
-*/
-
-static void QuickSortSpans(
- pixman_region16_point_t spans[],
- int widths[],
- int numSpans)
-{
- int y;
- int i, j, m;
- pixman_region16_point_t *r;
-
- /* Always called with numSpans > 1 */
- /* Sorts only by y, doesn't bother to sort by x */
-
- do
- {
- if (numSpans < 9)
- {
- /* Do insertion sort */
- int yprev;
-
- yprev = spans[0].y;
- i = 1;
- do
- { /* while i != numSpans */
- y = spans[i].y;
- if (yprev > y)
- {
- /* spans[i] is out of order. Move into proper location. */
- pixman_region16_point_t tpt;
- int tw, k;
-
- for (j = 0; y >= spans[j].y; j++) {}
- tpt = spans[i];
- tw = widths[i];
- for (k = i; k != j; k--)
- {
- spans[k] = spans[k-1];
- widths[k] = widths[k-1];
- }
- spans[j] = tpt;
- widths[j] = tw;
- y = spans[i].y;
- } /* if out of order */
- yprev = y;
- i++;
- } while (i != numSpans);
- return;
- }
-
- /* Choose partition element, stick in location 0 */
- m = numSpans / 2;
- if (spans[m].y > spans[0].y) ExchangeSpans(m, 0);
- if (spans[m].y > spans[numSpans-1].y) ExchangeSpans(m, numSpans-1);
- if (spans[m].y > spans[0].y) ExchangeSpans(m, 0);
- y = spans[0].y;
-
- /* Partition array */
- i = 0;
- j = numSpans;
- do
- {
- r = &(spans[i]);
- do
- {
- r++;
- i++;
- } while (i != numSpans && r->y < y);
- r = &(spans[j]);
- do
- {
- r--;
- j--;
- } while (y < r->y);
- if (i < j)
- ExchangeSpans(i, j);
- } while (i < j);
-
- /* Move partition element back to middle */
- ExchangeSpans(0, j);
-
- /* Recurse */
- if (numSpans-j-1 > 1)
- QuickSortSpans(&spans[j+1], &widths[j+1], numSpans-j-1);
- numSpans = j;
- } while (numSpans > 1);
-}
-
-#define NextBand() \
-{ \
- clipy1 = pboxBandStart->y1; \
- clipy2 = pboxBandStart->y2; \
- pboxBandEnd = pboxBandStart + 1; \
- while (pboxBandEnd != pboxLast && pboxBandEnd->y1 == clipy1) { \
- pboxBandEnd++; \
- } \
- for (; ppt != pptLast && ppt->y < clipy1; ppt++, pwidth++) {} \
-}
-
/*
Clip a list of scanlines to a region. The caller has allocated the
space. FSorted is non-zero if the scanline origins are in ascending
@@ -2316,158 +2038,9 @@ static void QuickSortSpans(
returns the number of new, clipped scanlines.
*/
-#ifdef XXX_DO_WE_NEED_THIS
-static int
-pixman_region16_clip_spans(
- pixman_region16_t *prgnDst,
- pixman_region16_point_t *ppt,
- int *pwidth,
- int nspans,
- pixman_region16_point_t *pptNew,
- int *pwidthNew,
- int fSorted)
-{
- pixman_region16_point_t *pptLast;
- int *pwidthNewStart; /* the vengeance of Xerox! */
- int y, x1, x2;
- int numRects;
-
- good(prgnDst);
- pptLast = ppt + nspans;
- pwidthNewStart = pwidthNew;
-
- if (!prgnDst->data)
- {
- /* Do special fast code with clip boundaries in registers(?) */
- /* It doesn't pay much to make use of fSorted in this case,
- so we lump everything together. */
-
- int clipx1, clipx2, clipy1, clipy2;
-
- clipx1 = prgnDst->extents.x1;
- clipy1 = prgnDst->extents.y1;
- clipx2 = prgnDst->extents.x2;
- clipy2 = prgnDst->extents.y2;
-
- for (; ppt != pptLast; ppt++, pwidth++)
- {
- y = ppt->y;
- x1 = ppt->x;
- if (clipy1 <= y && y < clipy2)
- {
- x2 = x1 + *pwidth;
- if (x1 < clipx1) x1 = clipx1;
- if (x2 > clipx2) x2 = clipx2;
- if (x1 < x2)
- {
- /* part of span in clip rectangle */
- pptNew->x = x1;
- pptNew->y = y;
- *pwidthNew = x2 - x1;
- pptNew++;
- pwidthNew++;
- }
- }
- } /* end for */
-
- }
- else if ((numRects = prgnDst->data->numRects))
- {
- /* Have to clip against many boxes */
- pixman_box16_t *pboxBandStart, *pboxBandEnd;
- pixman_box16_t *pbox;
- pixman_box16_t *pboxLast;
- int clipy1, clipy2;
-
- /* In this case, taking advantage of sorted spans gains more than
- the sorting costs. */
- if ((! fSorted) && (nspans > 1))
- QuickSortSpans(ppt, pwidth, nspans);
-
- pboxBandStart = PIXREGION_BOXPTR(prgnDst);
- pboxLast = pboxBandStart + numRects;
-
- NextBand();
-
- for (; ppt != pptLast; )
- {
- y = ppt->y;
- if (y < clipy2)
- {
- /* span is in the current band */
- pbox = pboxBandStart;
- x1 = ppt->x;
- x2 = x1 + *pwidth;
- do
- { /* For each box in band */
- int newx1, newx2;
-
- newx1 = x1;
- newx2 = x2;
- if (newx1 < pbox->x1) newx1 = pbox->x1;
- if (newx2 > pbox->x2) newx2 = pbox->x2;
- if (newx1 < newx2)
- {
- /* Part of span in clip rectangle */
- pptNew->x = newx1;
- pptNew->y = y;
- *pwidthNew = newx2 - newx1;
- pptNew++;
- pwidthNew++;
- }
- pbox++;
- } while (pbox != pboxBandEnd);
- ppt++;
- pwidth++;
- }
- else
- {
- /* Move to next band, adjust ppt as needed */
- pboxBandStart = pboxBandEnd;
- if (pboxBandStart == pboxLast)
- break; /* We're completely done */
- NextBand();
- }
- }
- }
- return (pwidthNew - pwidthNewStart);
-}
-
-/* find the band in a region with the most rectangles */
-static int
-pixman_region16_find_max_band(pixman_region16_t * prgn)
-{
- int nbox;
- pixman_box16_t * pbox;
- int nThisBand;
- int nMaxBand = 0;
- short yThisBand;
-
- good(prgn);
- nbox = PIXREGION_NUM_RECTS(prgn);
- pbox = PIXREGION_RECTS(prgn);
-
- while(nbox > 0)
- {
- yThisBand = pbox->y1;
- nThisBand = 0;
- while((nbox > 0) && (pbox->y1 == yThisBand))
- {
- nbox--;
- pbox++;
- nThisBand++;
- }
- if (nThisBand > nMaxBand)
- nMaxBand = nThisBand;
- }
- return (nMaxBand);
-}
-#endif /* XXX_DO_WE_NEED_THIS */
-
-
-pixman_bool_t
-pixman_region_selfcheck (reg)
- pixman_region16_t * reg;
+PIXMAN_EXPORT pixman_bool_t
+PREFIX(_selfcheck) (reg)
+ region_type_t * reg;
{
int i, numRects;
@@ -2483,8 +2056,8 @@ pixman_region_selfcheck (reg)
return (!reg->data);
else
{
- pixman_box16_t * pboxP, * pboxN;
- pixman_box16_t box;
+ box_type_t * pboxP, * pboxN;
+ box_type_t box;
pboxP = PIXREGION_RECTS(reg);
box = *pboxP;
@@ -2511,16 +2084,16 @@ pixman_region_selfcheck (reg)
}
}
-pixman_bool_t
-pixman_region_init_rects (pixman_region16_t *region,
- pixman_box16_t *boxes, int count)
+PIXMAN_EXPORT pixman_bool_t
+PREFIX(_init_rects) (region_type_t *region,
+ box_type_t *boxes, int count)
{
int overlap;
/* if it's 1, then we just want to set the extents, so call
* the existing method. */
if (count == 1) {
- pixman_region_init_rect(region,
+ PREFIX(_init_rect) (region,
boxes[0].x1,
boxes[0].y1,
boxes[0].x2 - boxes[0].x1,
@@ -2528,7 +2101,7 @@ pixman_region_init_rects (pixman_region16_t *region,
return TRUE;
}
- pixman_region_init(region);
+ PREFIX(_init) (region);
/* if it's 0, don't call pixman_rect_alloc -- 0 rectangles is
* a special case, and causing pixman_rect_alloc would cause
@@ -2542,10 +2115,10 @@ pixman_region_init_rects (pixman_region16_t *region,
return FALSE;
/* Copy in the rects */
- memcpy (PIXREGION_RECTS(region), boxes, sizeof(pixman_box16_t) * count);
+ memcpy (PIXREGION_RECTS(region), boxes, sizeof(box_type_t) * count);
region->data->numRects = count;
/* Validate */
region->extents.x1 = region->extents.x2 = 0;
- return pixman_region_validate (region, &overlap);
+ return validate (region, &overlap);
}
diff --git a/lib/pixman/pixman/pixman-region16.c b/lib/pixman/pixman/pixman-region16.c
new file mode 100644
index 000000000..acee0946b
--- /dev/null
+++ b/lib/pixman/pixman/pixman-region16.c
@@ -0,0 +1,83 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Red Hat, Inc. not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Red Hat, Inc. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Soren Sandmann <sandmann@redhat.com>
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#undef PIXMAN_DISABLE_DEPRECATED
+
+#include "pixman-private.h"
+
+#include <stdlib.h>
+
+typedef pixman_box16_t box_type_t;
+typedef pixman_region16_data_t region_data_type_t;
+typedef pixman_region16_t region_type_t;
+
+typedef struct {
+ int x, y;
+} point_type_t;
+
+#define PREFIX(x) pixman_region##x
+
+PIXMAN_EXPORT void
+pixman_region_set_static_pointers (pixman_box16_t *empty_box,
+ pixman_region16_data_t *empty_data,
+ pixman_region16_data_t *broken_data)
+{
+ pixman_region_internal_set_static_pointers (empty_box, empty_data, broken_data);
+}
+
+pixman_bool_t
+pixman_region16_copy_from_region32 (pixman_region16_t *dst,
+ pixman_region32_t *src)
+{
+ int n_boxes, i;
+ pixman_box32_t *boxes32;
+ pixman_box16_t *boxes16;
+ pixman_bool_t retval;
+
+ boxes32 = pixman_region32_rectangles (src, &n_boxes);
+
+ boxes16 = pixman_malloc_ab (n_boxes, sizeof (pixman_box16_t));
+
+ if (!boxes16)
+ return FALSE;
+
+ for (i = 0; i < n_boxes; ++i)
+ {
+ boxes16[i].x1 = boxes32[i].x1;
+ boxes16[i].y1 = boxes32[i].y1;
+ boxes16[i].x2 = boxes32[i].x2;
+ boxes16[i].y2 = boxes32[i].y2;
+ }
+
+ pixman_region_fini (dst);
+ retval = pixman_region_init_rects (dst, boxes16, n_boxes);
+ free (boxes16);
+ return retval;
+}
+
+#include "pixman-region.c"
diff --git a/lib/pixman/pixman/pixman-region32.c b/lib/pixman/pixman/pixman-region32.c
new file mode 100644
index 000000000..8a30d1dc7
--- /dev/null
+++ b/lib/pixman/pixman/pixman-region32.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright © 2008 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of
+ * Red Hat, Inc. not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior
+ * permission. Red Hat, Inc. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
+ * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+ * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: Soren Sandmann <sandmann@redhat.com>
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "pixman-private.h"
+
+#include <stdlib.h>
+
+typedef pixman_box32_t box_type_t;
+typedef pixman_region32_data_t region_data_type_t;
+typedef pixman_region32_t region_type_t;
+
+typedef struct {
+ int x, y;
+} point_type_t;
+
+#define PREFIX(x) pixman_region32##x
+
+pixman_bool_t
+pixman_region32_copy_from_region16 (pixman_region32_t *dst,
+ pixman_region16_t *src)
+{
+ int n_boxes, i;
+ pixman_box16_t *boxes16;
+ pixman_box32_t *boxes32;
+ pixman_bool_t retval;
+
+ boxes16 = pixman_region_rectangles (src, &n_boxes);
+
+ boxes32 = pixman_malloc_ab (n_boxes, sizeof (pixman_box32_t));
+
+ if (!boxes32)
+ return FALSE;
+
+ for (i = 0; i < n_boxes; ++i)
+ {
+ boxes32[i].x1 = boxes16[i].x1;
+ boxes32[i].y1 = boxes16[i].y1;
+ boxes32[i].x2 = boxes16[i].x2;
+ boxes32[i].y2 = boxes16[i].y2;
+ }
+
+ pixman_region32_fini (dst);
+ retval = pixman_region32_init_rects (dst, boxes32, n_boxes);
+ free (boxes32);
+ return retval;
+}
+
+#include "pixman-region.c"
diff --git a/lib/pixman/pixman/pixman-source.c b/lib/pixman/pixman/pixman-source.c
index a5a423587..6a640fa67 100644
--- a/lib/pixman/pixman/pixman-source.c
+++ b/lib/pixman/pixman/pixman-source.c
@@ -27,6 +27,7 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <math.h>
#include "pixman-private.h"
@@ -679,3 +680,30 @@ void pixmanFetchSourcePict(source_image_t * pict, int x, int y, int width,
}
}
}
+
+/*
+ * For now, just evaluate the source picture at 32bpp and expand. We could
+ * produce smoother gradients by evaluating them at higher color depth, but
+ * that's a project for the future.
+ */
+void pixmanFetchSourcePict64(source_image_t * pict, int x, int y, int width,
+ uint64_t *buffer, uint64_t *mask, uint32_t maskBits)
+{
+ uint32_t *mask8 = NULL;
+
+ // Contract the mask image, if one exists, so that the 32-bit fetch function
+ // can use it.
+ if (mask) {
+ mask8 = pixman_malloc_ab(width, sizeof(uint32_t));
+ pixman_contract(mask8, mask, width);
+ }
+
+ // Fetch the source image into the first half of buffer.
+ pixmanFetchSourcePict(pict, x, y, width, (uint32_t*)buffer, mask8,
+ maskBits);
+
+ // Expand from 32bpp to 64bpp in place.
+ pixman_expand(buffer, (uint32_t*)buffer, PIXMAN_a8r8g8b8, width);
+
+ free(mask8);
+}
diff --git a/lib/pixman/pixman/pixman-sse.c b/lib/pixman/pixman/pixman-sse.c
deleted file mode 100644
index eb1d3d5b4..000000000
--- a/lib/pixman/pixman/pixman-sse.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright © 2008 Rodrigo Kumpera
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Author: Rodrigo Kumpera (kumpera@gmail.com)
- *
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "pixman-sse.h"
-
-#ifdef USE_SSE2
-
-void
-fbComposeSetupSSE(void)
-{
- static pixman_bool_t initialized = FALSE;
-
- if (initialized)
- return;
-
- /* check if we have SSE2 support and initialize accordingly */
- if (pixman_have_sse())
- {
- }
-
- initialized = TRUE;
-}
-
-
-#endif /* USE_SSE2 */
diff --git a/lib/pixman/pixman/pixman-sse.h b/lib/pixman/pixman/pixman-sse.h
deleted file mode 100644
index 65cf21d5b..000000000
--- a/lib/pixman/pixman/pixman-sse.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright © 2008 Rodrigo Kumpera
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
- * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Author: Rodrigo Kumpera (kumpera@gmail.com)
- *
- */
-#ifndef _PIXMAN_SSE_H_
-#define _PIXMAN_SSE_H_
-
-#ifdef HAVE_DIX_CONFIG_H
-#include <dix-config.h>
-#endif
-
-#include "pixman-private.h"
-
-#ifdef USE_SSE2
-
-#if !defined(__amd64__) && !defined(__x86_64__)
-pixman_bool_t pixman_have_sse(void);
-#else
-#define pixman_have_sse() TRUE
-#endif
-
-#else
-#define pixman_have_sse() FALSE
-#endif
-
-#ifdef USE_SSE2
-
-void fbComposeSetupSSE(void);
-
-#endif /* USE_SSE2 */
-
-#endif /* _PIXMAN_SSE_H_ */
diff --git a/lib/pixman/pixman/pixman-sse2.c b/lib/pixman/pixman/pixman-sse2.c
new file mode 100644
index 000000000..0f36436b6
--- /dev/null
+++ b/lib/pixman/pixman/pixman-sse2.c
@@ -0,0 +1,4726 @@
+/*
+ * Copyright © 2008 Rodrigo Kumpera
+ * Copyright © 2008 André Tupinambá
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Red Hat makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * Author: Rodrigo Kumpera (kumpera@gmail.com)
+ * André Tupinambá (andrelrt@gmail.com)
+ *
+ * Based on work by Owen Taylor and Søren Sandmann
+ */
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <mmintrin.h>
+#include <xmmintrin.h> /* for _mm_shuffle_pi16 and _MM_SHUFFLE */
+#include <emmintrin.h> /* for SSE2 intrinsics */
+
+#include "pixman-sse2.h"
+
+#ifdef USE_SSE2
+
+#ifdef _MSC_VER
+#undef inline
+#define inline __forceinline
+#endif
+
+#ifdef __GNUC__
+# define inline __inline__ __attribute__ ((__always_inline__))
+#endif
+
+/* -------------------------------------------------------------------------------------------------
+ * Locals
+ */
+
+static __m64 xMask0080;
+static __m64 xMask00ff;
+static __m64 xMask0101;
+static __m64 xMaskAlpha;
+
+static __m64 xMask565rgb;
+static __m64 xMask565Unpack;
+
+static __m128i Mask0080;
+static __m128i Mask00ff;
+static __m128i Mask0101;
+static __m128i Maskffff;
+static __m128i Maskff000000;
+static __m128i MaskAlpha;
+
+static __m128i Mask565r;
+static __m128i Mask565g1, Mask565g2;
+static __m128i Mask565b;
+static __m128i MaskRed;
+static __m128i MaskGreen;
+static __m128i MaskBlue;
+
+static __m128i Mask565FixRB;
+static __m128i Mask565FixG;
+
+/* -------------------------------------------------------------------------------------------------
+ * SSE2 Inlines
+ */
+static inline __m128i
+unpack_32_1x128 (uint32_t data)
+{
+ return _mm_unpacklo_epi8 (_mm_cvtsi32_si128 (data), _mm_setzero_si128());
+}
+
+static inline void
+unpack_128_2x128 (__m128i data, __m128i* dataLo, __m128i* dataHi)
+{
+ *dataLo = _mm_unpacklo_epi8 (data, _mm_setzero_si128 ());
+ *dataHi = _mm_unpackhi_epi8 (data, _mm_setzero_si128 ());
+}
+
+static inline __m128i
+unpack565to8888 (__m128i lo)
+{
+ __m128i r, g, b, rb, t;
+
+ r = _mm_and_si128 (_mm_slli_epi32 (lo, 8), MaskRed);
+ g = _mm_and_si128 (_mm_slli_epi32 (lo, 5), MaskGreen);
+ b = _mm_and_si128 (_mm_slli_epi32 (lo, 3), MaskBlue);
+
+ rb = _mm_or_si128 (r, b);
+ t = _mm_and_si128 (rb, Mask565FixRB);
+ t = _mm_srli_epi32 (t, 5);
+ rb = _mm_or_si128 (rb, t);
+
+ t = _mm_and_si128 (g, Mask565FixG);
+ t = _mm_srli_epi32 (t, 6);
+ g = _mm_or_si128 (g, t);
+
+ return _mm_or_si128 (rb, g);
+}
+
+static inline void
+unpack565_128_4x128 (__m128i data, __m128i* data0, __m128i* data1, __m128i* data2, __m128i* data3)
+{
+ __m128i lo, hi;
+
+ lo = _mm_unpacklo_epi16 (data, _mm_setzero_si128 ());
+ hi = _mm_unpackhi_epi16 (data, _mm_setzero_si128 ());
+
+ lo = unpack565to8888 (lo);
+ hi = unpack565to8888 (hi);
+
+ unpack_128_2x128 (lo, data0, data1);
+ unpack_128_2x128 (hi, data2, data3);
+}
+
+static inline uint16_t
+pack565_32_16 (uint32_t pixel)
+{
+ return (uint16_t) (((pixel>>8) & 0xf800) | ((pixel>>5) & 0x07e0) | ((pixel>>3) & 0x001f));
+}
+
+static inline __m128i
+pack_2x128_128 (__m128i lo, __m128i hi)
+{
+ return _mm_packus_epi16 (lo, hi);
+}
+
+static inline __m128i
+pack565_2x128_128 (__m128i lo, __m128i hi)
+{
+ __m128i data;
+ __m128i r, g1, g2, b;
+
+ data = pack_2x128_128 ( lo, hi );
+
+ r = _mm_and_si128 (data , Mask565r);
+ g1 = _mm_and_si128 (_mm_slli_epi32 (data , 3), Mask565g1);
+ g2 = _mm_and_si128 (_mm_srli_epi32 (data , 5), Mask565g2);
+ b = _mm_and_si128 (_mm_srli_epi32 (data , 3), Mask565b);
+
+ return _mm_or_si128 (_mm_or_si128 (_mm_or_si128 (r, g1), g2), b);
+}
+
+static inline __m128i
+pack565_4x128_128 (__m128i* xmm0, __m128i* xmm1, __m128i* xmm2, __m128i* xmm3)
+{
+ return _mm_packus_epi16 (pack565_2x128_128 (*xmm0, *xmm1), pack565_2x128_128 (*xmm2, *xmm3));
+}
+
+static inline uint32_t
+packAlpha (__m128i x)
+{
+ return _mm_cvtsi128_si32 (_mm_packus_epi16 (_mm_packus_epi16 (_mm_srli_epi32 (x, 24),
+ _mm_setzero_si128 ()),
+ _mm_setzero_si128 ()));
+}
+
+static inline __m128i
+expandPixel_32_1x128 (uint32_t data)
+{
+ return _mm_shuffle_epi32 (unpack_32_1x128 (data), _MM_SHUFFLE(1, 0, 1, 0));
+}
+
+static inline __m128i
+expandAlpha_1x128 (__m128i data)
+{
+ return _mm_shufflehi_epi16 (_mm_shufflelo_epi16 (data, _MM_SHUFFLE(3, 3, 3, 3)), _MM_SHUFFLE(3, 3, 3, 3));
+}
+
+static inline void
+expandAlpha_2x128 (__m128i dataLo, __m128i dataHi, __m128i* alphaLo, __m128i* alphaHi)
+{
+ __m128i lo, hi;
+
+ lo = _mm_shufflelo_epi16 (dataLo, _MM_SHUFFLE(3, 3, 3, 3));
+ hi = _mm_shufflelo_epi16 (dataHi, _MM_SHUFFLE(3, 3, 3, 3));
+ *alphaLo = _mm_shufflehi_epi16 (lo, _MM_SHUFFLE(3, 3, 3, 3));
+ *alphaHi = _mm_shufflehi_epi16 (hi, _MM_SHUFFLE(3, 3, 3, 3));
+}
+
+static inline void
+expandAlphaRev_2x128 (__m128i dataLo, __m128i dataHi, __m128i* alphaLo, __m128i* alphaHi)
+{
+ __m128i lo, hi;
+
+ lo = _mm_shufflelo_epi16 (dataLo, _MM_SHUFFLE(0, 0, 0, 0));
+ hi = _mm_shufflelo_epi16 (dataHi, _MM_SHUFFLE(0, 0, 0, 0));
+ *alphaLo = _mm_shufflehi_epi16 (lo, _MM_SHUFFLE(0, 0, 0, 0));
+ *alphaHi = _mm_shufflehi_epi16 (hi, _MM_SHUFFLE(0, 0, 0, 0));
+}
+
+static inline void
+pixMultiply_2x128 (__m128i* dataLo, __m128i* dataHi, __m128i* alphaLo, __m128i* alphaHi, __m128i* retLo, __m128i* retHi)
+{
+ __m128i lo, hi;
+
+ lo = _mm_mullo_epi16 (*dataLo, *alphaLo);
+ hi = _mm_mullo_epi16 (*dataHi, *alphaHi);
+ lo = _mm_adds_epu16 (lo, Mask0080);
+ hi = _mm_adds_epu16 (hi, Mask0080);
+ *retLo = _mm_mulhi_epu16 (lo, Mask0101);
+ *retHi = _mm_mulhi_epu16 (hi, Mask0101);
+}
+
+static inline void
+pixAddMultiply_2x128 (__m128i* srcLo, __m128i* srcHi, __m128i* alphaDstLo, __m128i* alphaDstHi,
+ __m128i* dstLo, __m128i* dstHi, __m128i* alphaSrcLo, __m128i* alphaSrcHi,
+ __m128i* retLo, __m128i* retHi)
+{
+ __m128i lo, hi;
+ __m128i mulLo, mulHi;
+
+ lo = _mm_mullo_epi16 (*srcLo, *alphaDstLo);
+ hi = _mm_mullo_epi16 (*srcHi, *alphaDstHi);
+ mulLo = _mm_mullo_epi16 (*dstLo, *alphaSrcLo);
+ mulHi = _mm_mullo_epi16 (*dstHi, *alphaSrcHi);
+ lo = _mm_adds_epu16 (lo, Mask0080);
+ hi = _mm_adds_epu16 (hi, Mask0080);
+ lo = _mm_adds_epu16 (lo, mulLo);
+ hi = _mm_adds_epu16 (hi, mulHi);
+ *retLo = _mm_mulhi_epu16 (lo, Mask0101);
+ *retHi = _mm_mulhi_epu16 (hi, Mask0101);
+}
+
+static inline void
+negate_2x128 (__m128i dataLo, __m128i dataHi, __m128i* negLo, __m128i* negHi)
+{
+ *negLo = _mm_xor_si128 (dataLo, Mask00ff);
+ *negHi = _mm_xor_si128 (dataHi, Mask00ff);
+}
+
+static inline void
+invertColors_2x128 (__m128i dataLo, __m128i dataHi, __m128i* invLo, __m128i* invHi)
+{
+ __m128i lo, hi;
+
+ lo = _mm_shufflelo_epi16 (dataLo, _MM_SHUFFLE(3, 0, 1, 2));
+ hi = _mm_shufflelo_epi16 (dataHi, _MM_SHUFFLE(3, 0, 1, 2));
+ *invLo = _mm_shufflehi_epi16 (lo, _MM_SHUFFLE(3, 0, 1, 2));
+ *invHi = _mm_shufflehi_epi16 (hi, _MM_SHUFFLE(3, 0, 1, 2));
+}
+
+static inline void
+over_2x128 (__m128i* srcLo, __m128i* srcHi, __m128i* alphaLo, __m128i* alphaHi, __m128i* dstLo, __m128i* dstHi)
+{
+ __m128i t1, t2;
+
+ negate_2x128 (*alphaLo, *alphaHi, &t1, &t2);
+
+ pixMultiply_2x128 (dstLo, dstHi, &t1, &t2, dstLo, dstHi);
+
+ *dstLo = _mm_adds_epu8 (*srcLo, *dstLo);
+ *dstHi = _mm_adds_epu8 (*srcHi, *dstHi);
+}
+
+static inline void
+overRevNonPre_2x128 (__m128i srcLo, __m128i srcHi, __m128i* dstLo, __m128i* dstHi)
+{
+ __m128i lo, hi;
+ __m128i alphaLo, alphaHi;
+
+ expandAlpha_2x128 (srcLo, srcHi, &alphaLo, &alphaHi);
+
+ lo = _mm_or_si128 (alphaLo, MaskAlpha);
+ hi = _mm_or_si128 (alphaHi, MaskAlpha);
+
+ invertColors_2x128 (srcLo, srcHi, &srcLo, &srcHi);
+
+ pixMultiply_2x128 (&srcLo, &srcHi, &lo, &hi, &lo, &hi);
+
+ over_2x128 (&lo, &hi, &alphaLo, &alphaHi, dstLo, dstHi);
+}
+
+static inline void
+inOver_2x128 (__m128i* srcLo, __m128i* srcHi, __m128i* alphaLo, __m128i* alphaHi,
+ __m128i* maskLo, __m128i* maskHi, __m128i* dstLo, __m128i* dstHi)
+{
+ __m128i sLo, sHi;
+ __m128i aLo, aHi;
+
+ pixMultiply_2x128 ( srcLo, srcHi, maskLo, maskHi, &sLo, &sHi);
+ pixMultiply_2x128 (alphaLo, alphaHi, maskLo, maskHi, &aLo, &aHi);
+
+ over_2x128 (&sLo, &sHi, &aLo, &aHi, dstLo, dstHi);
+}
+
+static inline void
+cachePrefetch (__m128i* addr)
+{
+ _mm_prefetch (addr, _MM_HINT_T0);
+}
+
+static inline void
+cachePrefetchNext (__m128i* addr)
+{
+ _mm_prefetch (addr + 4, _MM_HINT_T0); // 64 bytes ahead
+}
+
+/* load 4 pixels from a 16-byte boundary aligned address */
+static inline __m128i
+load128Aligned (__m128i* src)
+{
+ return _mm_load_si128 (src);
+}
+
+/* load 4 pixels from a unaligned address */
+static inline __m128i
+load128Unaligned (__m128i* src)
+{
+ return _mm_loadu_si128 (src);
+}
+
+/* save 4 pixels using Write Combining memory on a 16-byte boundary aligned address */
+static inline void
+save128WriteCombining (__m128i* dst, __m128i data)
+{
+ _mm_stream_si128 (dst, data);
+}
+
+/* save 4 pixels on a 16-byte boundary aligned address */
+static inline void
+save128Aligned (__m128i* dst, __m128i data)
+{
+ _mm_store_si128 (dst, data);
+}
+
+/* save 4 pixels on a unaligned address */
+static inline void
+save128Unaligned (__m128i* dst, __m128i data)
+{
+ _mm_storeu_si128 (dst, data);
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * MMX inlines
+ */
+
+static inline __m64
+unpack_32_1x64 (uint32_t data)
+{
+ return _mm_unpacklo_pi8 (_mm_cvtsi32_si64 (data), _mm_setzero_si64());
+}
+
+static inline __m64
+expandAlpha_1x64 (__m64 data)
+{
+ return _mm_shuffle_pi16 (data, _MM_SHUFFLE(3, 3, 3, 3));
+}
+
+static inline __m64
+expandAlphaRev_1x64 (__m64 data)
+{
+ return _mm_shuffle_pi16 (data, _MM_SHUFFLE(0, 0, 0, 0));
+}
+
+static inline __m64
+expandPixel_8_1x64 (uint8_t data)
+{
+ return _mm_shuffle_pi16 (unpack_32_1x64 ((uint32_t)data), _MM_SHUFFLE(0, 0, 0, 0));
+}
+
+static inline __m64
+pixMultiply_1x64 (__m64 data, __m64 alpha)
+{
+ return _mm_mulhi_pu16 (_mm_adds_pu16 (_mm_mullo_pi16 (data, alpha),
+ xMask0080),
+ xMask0101);
+}
+
+static inline __m64
+pixAddMultiply_1x64 (__m64* src, __m64* alphaDst, __m64* dst, __m64* alphaSrc)
+{
+ return _mm_mulhi_pu16 (_mm_adds_pu16 (_mm_adds_pu16 (_mm_mullo_pi16 (*src, *alphaDst),
+ xMask0080),
+ _mm_mullo_pi16 (*dst, *alphaSrc)),
+ xMask0101);
+}
+
+static inline __m64
+negate_1x64 (__m64 data)
+{
+ return _mm_xor_si64 (data, xMask00ff);
+}
+
+static inline __m64
+invertColors_1x64 (__m64 data)
+{
+ return _mm_shuffle_pi16 (data, _MM_SHUFFLE(3, 0, 1, 2));
+}
+
+static inline __m64
+over_1x64 (__m64 src, __m64 alpha, __m64 dst)
+{
+ return _mm_adds_pu8 (src, pixMultiply_1x64 (dst, negate_1x64 (alpha)));
+}
+
+static inline __m64
+inOver_1x64 (__m64* src, __m64* alpha, __m64* mask, __m64* dst)
+{
+ return over_1x64 (pixMultiply_1x64 (*src, *mask),
+ pixMultiply_1x64 (*alpha, *mask),
+ *dst);
+}
+
+static inline __m64
+overRevNonPre_1x64 (__m64 src, __m64 dst)
+{
+ __m64 alpha = expandAlpha_1x64 (src);
+
+ return over_1x64 (pixMultiply_1x64 (invertColors_1x64 (src),
+ _mm_or_si64 (alpha, xMaskAlpha)),
+ alpha,
+ dst);
+}
+
+static inline uint32_t
+pack_1x64_32( __m64 data )
+{
+ return _mm_cvtsi64_si32 (_mm_packs_pu16 (data, _mm_setzero_si64()));
+}
+
+/* Expand 16 bits positioned at @pos (0-3) of a mmx register into
+ *
+ * 00RR00GG00BB
+ *
+ * --- Expanding 565 in the low word ---
+ *
+ * m = (m << (32 - 3)) | (m << (16 - 5)) | m;
+ * m = m & (01f0003f001f);
+ * m = m * (008404100840);
+ * m = m >> 8;
+ *
+ * Note the trick here - the top word is shifted by another nibble to
+ * avoid it bumping into the middle word
+ */
+static inline __m64
+expand565_16_1x64 (uint16_t pixel)
+{
+ __m64 p;
+ __m64 t1, t2;
+
+ p = _mm_cvtsi32_si64 ((uint32_t) pixel);
+
+ t1 = _mm_slli_si64 (p, 36 - 11);
+ t2 = _mm_slli_si64 (p, 16 - 5);
+
+ p = _mm_or_si64 (t1, p);
+ p = _mm_or_si64 (t2, p);
+ p = _mm_and_si64 (p, xMask565rgb);
+ p = _mm_mullo_pi16 (p, xMask565Unpack);
+
+ return _mm_srli_pi16 (p, 8);
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * Compose Core transformations
+ */
+static inline uint32_t
+coreCombineOverUPixelsse2 (uint32_t src, uint32_t dst)
+{
+ uint8_t a;
+ __m64 ms;
+
+ a = src >> 24;
+
+ if (a == 0xff)
+ {
+ return src;
+ }
+ else if (a)
+ {
+ ms = unpack_32_1x64 (src);
+ return pack_1x64_32 (over_1x64 (ms, expandAlpha_1x64 (ms), unpack_32_1x64 (dst)));
+ }
+
+ return dst;
+}
+
+static inline void
+coreCombineOverUsse2 (uint32_t* pd, const uint32_t* ps, int w)
+{
+ uint32_t pa;
+ uint32_t s, d;
+
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmAlphaLo, xmmAlphaHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ /* Align dst on a 16-byte boundary */
+ while (w &&
+ ((unsigned long)pd & 15))
+ {
+ d = *pd;
+ s = *ps++;
+
+ *pd++ = coreCombineOverUPixelsse2 (s, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ /* I'm loading unaligned because I'm not sure about the address alignment. */
+ xmmSrcHi = load128Unaligned ((__m128i*) ps);
+
+ /* Check the alpha channel */
+ pa = packAlpha (xmmSrcHi);
+
+ if (pa == 0xffffffff)
+ {
+ save128Aligned ((__m128i*)pd, xmmSrcHi);
+ }
+ else if (pa)
+ {
+ xmmDstHi = load128Aligned ((__m128i*) pd);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi);
+
+ over_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi, &xmmDstLo, &xmmDstHi);
+
+ /* rebuid the 4 pixel data and save*/
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+ }
+
+ w -= 4;
+ ps += 4;
+ pd += 4;
+ }
+
+ while (w)
+ {
+ d = *pd;
+ s = *ps++;
+
+ *pd++ = coreCombineOverUPixelsse2 (s, d);
+ w--;
+ }
+}
+
+static inline void
+coreCombineOverReverseUsse2 (uint32_t* pd, const uint32_t* ps, int w)
+{
+ uint32_t s, d;
+
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmAlphaLo, xmmAlphaHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ /* Align dst on a 16-byte boundary */
+ while (w &&
+ ((unsigned long)pd & 15))
+ {
+ d = *pd;
+ s = *ps++;
+
+ *pd++ = coreCombineOverUPixelsse2 (d, s);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ /* I'm loading unaligned because I'm not sure about the address alignment. */
+ xmmSrcHi = load128Unaligned ((__m128i*) ps);
+ xmmDstHi = load128Aligned ((__m128i*) pd);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaLo, &xmmAlphaHi);
+
+ over_2x128 (&xmmDstLo, &xmmDstHi, &xmmAlphaLo, &xmmAlphaHi, &xmmSrcLo, &xmmSrcHi);
+
+ /* rebuid the 4 pixel data and save*/
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmSrcLo, xmmSrcHi));
+
+ w -= 4;
+ ps += 4;
+ pd += 4;
+ }
+
+ while (w)
+ {
+ d = *pd;
+ s = *ps++;
+
+ *pd++ = coreCombineOverUPixelsse2 (d, s);
+ w--;
+ }
+}
+
+static inline uint32_t
+coreCombineInUPixelsse2 (uint32_t src, uint32_t dst)
+{
+ uint32_t maska = src >> 24;
+
+ if (maska == 0)
+ {
+ return 0;
+ }
+ else if (maska != 0xff)
+ {
+ return pack_1x64_32(pixMultiply_1x64 (unpack_32_1x64 (dst), expandAlpha_1x64 (unpack_32_1x64 (src))));
+ }
+
+ return dst;
+}
+
+static inline void
+coreCombineInUsse2 (uint32_t* pd, const uint32_t* ps, int w)
+{
+ uint32_t s, d;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w && ((unsigned long) pd & 15))
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineInUPixelsse2 (d, s);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ xmmDstHi = load128Aligned ((__m128i*) pd);
+ xmmSrcHi = load128Unaligned ((__m128i*) ps);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmDstLo, &xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineInUPixelsse2 (d, s);
+ w--;
+ }
+}
+
+static inline void
+coreCombineReverseInUsse2 (uint32_t* pd, const uint32_t* ps, int w)
+{
+ uint32_t s, d;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w && ((unsigned long) pd & 15))
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineInUPixelsse2 (s, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ xmmDstHi = load128Aligned ((__m128i*) pd);
+ xmmSrcHi = load128Unaligned ((__m128i*) ps);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ pixMultiply_2x128 (&xmmDstLo, &xmmDstHi, &xmmSrcLo, &xmmSrcHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineInUPixelsse2 (s, d);
+ w--;
+ }
+}
+
+static inline void
+coreCombineReverseOutUsse2 (uint32_t* pd, const uint32_t* ps, int w)
+{
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w && ((unsigned long) pd & 15))
+ {
+ uint32_t s = *ps++;
+ uint32_t d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (d), negate_1x64 (expandAlpha_1x64 (unpack_32_1x64 (s)))));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ xmmSrcHi = load128Unaligned ((__m128i*) ps);
+ xmmDstHi = load128Aligned ((__m128i*) pd);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ negate_2x128 (xmmSrcLo, xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+
+ pixMultiply_2x128 (&xmmDstLo, &xmmDstHi, &xmmSrcLo, &xmmSrcHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ uint32_t s = *ps++;
+ uint32_t d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (d), negate_1x64 (expandAlpha_1x64 (unpack_32_1x64 (s)))));
+ w--;
+ }
+}
+
+static inline void
+coreCombineOutUsse2 (uint32_t* pd, const uint32_t* ps, int w)
+{
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w && ((unsigned long) pd & 15))
+ {
+ uint32_t s = *ps++;
+ uint32_t d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (s), negate_1x64 (expandAlpha_1x64 (unpack_32_1x64 (d)))));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ xmmSrcHi = load128Unaligned ((__m128i*) ps);
+ xmmDstHi = load128Aligned ((__m128i*) pd);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmDstLo, &xmmDstHi);
+ negate_2x128 (xmmDstLo, xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmDstLo, &xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ uint32_t s = *ps++;
+ uint32_t d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (s), negate_1x64 (expandAlpha_1x64 (unpack_32_1x64 (d)))));
+ w--;
+ }
+}
+
+static inline uint32_t
+coreCombineAtopUPixelsse2 (uint32_t src, uint32_t dst)
+{
+ __m64 s = unpack_32_1x64 (src);
+ __m64 d = unpack_32_1x64 (dst);
+
+ __m64 sa = negate_1x64 (expandAlpha_1x64 (s));
+ __m64 da = expandAlpha_1x64 (d);
+
+ return pack_1x64_32 (pixAddMultiply_1x64 (&s, &da, &d, &sa));
+}
+
+static inline void
+coreCombineAtopUsse2 (uint32_t* pd, const uint32_t* ps, int w)
+{
+ uint32_t s, d;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmAlphaSrcLo, xmmAlphaSrcHi;
+ __m128i xmmAlphaDstLo, xmmAlphaDstHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w && ((unsigned long) pd & 15))
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineAtopUPixelsse2 (s, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ xmmSrcHi = load128Unaligned ((__m128i*) ps);
+ xmmDstHi = load128Aligned ((__m128i*) pd);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi);
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+
+ negate_2x128 (xmmAlphaSrcLo, xmmAlphaSrcHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi);
+
+ pixAddMultiply_2x128 ( &xmmSrcLo, &xmmSrcHi, &xmmAlphaDstLo, &xmmAlphaDstHi,
+ &xmmDstLo, &xmmDstHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi,
+ &xmmDstLo, &xmmDstHi );
+
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineAtopUPixelsse2 (s, d);
+ w--;
+ }
+}
+
+static inline uint32_t
+coreCombineReverseAtopUPixelsse2 (uint32_t src, uint32_t dst)
+{
+ __m64 s = unpack_32_1x64 (src);
+ __m64 d = unpack_32_1x64 (dst);
+
+ __m64 sa = expandAlpha_1x64 (s);
+ __m64 da = negate_1x64 (expandAlpha_1x64 (d));
+
+ return pack_1x64_32 (pixAddMultiply_1x64 (&s, &da, &d, &sa));
+}
+
+static inline void
+coreCombineReverseAtopUsse2 (uint32_t* pd, const uint32_t* ps, int w)
+{
+ uint32_t s, d;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmAlphaSrcLo, xmmAlphaSrcHi;
+ __m128i xmmAlphaDstLo, xmmAlphaDstHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w && ((unsigned long) pd & 15))
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineReverseAtopUPixelsse2 (s, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ xmmSrcHi = load128Unaligned ((__m128i*) ps);
+ xmmDstHi = load128Aligned ((__m128i*) pd);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi);
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+
+ negate_2x128 (xmmAlphaDstLo, xmmAlphaDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+
+ pixAddMultiply_2x128 ( &xmmSrcLo, &xmmSrcHi, &xmmAlphaDstLo, &xmmAlphaDstHi,
+ &xmmDstLo, &xmmDstHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi,
+ &xmmDstLo, &xmmDstHi );
+
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineReverseAtopUPixelsse2 (s, d);
+ w--;
+ }
+}
+
+static inline uint32_t
+coreCombineXorUPixelsse2 (uint32_t src, uint32_t dst)
+{
+ __m64 s = unpack_32_1x64 (src);
+ __m64 d = unpack_32_1x64 (dst);
+
+ __m64 negD = negate_1x64 (expandAlpha_1x64 (d));
+ __m64 negS = negate_1x64 (expandAlpha_1x64 (s));
+
+ return pack_1x64_32 (pixAddMultiply_1x64 (&s, &negD, &d, &negS));
+}
+
+static inline void
+coreCombineXorUsse2 (uint32_t* dst, const uint32_t* src, int width)
+{
+ int w = width;
+ uint32_t s, d;
+ uint32_t* pd = dst;
+ const uint32_t* ps = src;
+
+ __m128i xmmSrc, xmmSrcLo, xmmSrcHi;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+ __m128i xmmAlphaSrcLo, xmmAlphaSrcHi;
+ __m128i xmmAlphaDstLo, xmmAlphaDstHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w && ((unsigned long) pd & 15))
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineXorUPixelsse2 (s, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ xmmSrc = load128Unaligned ((__m128i*) ps);
+ xmmDst = load128Aligned ((__m128i*) pd);
+
+ unpack_128_2x128 (xmmSrc, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi);
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+
+ negate_2x128 (xmmAlphaSrcLo, xmmAlphaSrcHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi);
+ negate_2x128 (xmmAlphaDstLo, xmmAlphaDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+
+ pixAddMultiply_2x128 ( &xmmSrcLo, &xmmSrcHi, &xmmAlphaDstLo, &xmmAlphaDstHi,
+ &xmmDstLo, &xmmDstHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi,
+ &xmmDstLo, &xmmDstHi );
+
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ d = *pd;
+
+ *pd++ = coreCombineXorUPixelsse2 (s, d);
+ w--;
+ }
+}
+
+static inline void
+coreCombineAddUsse2 (uint32_t* dst, const uint32_t* src, int width)
+{
+ int w = width;
+ uint32_t s,d;
+ uint32_t* pd = dst;
+ const uint32_t* ps = src;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ d = *pd;
+ *pd++ = _mm_cvtsi64_si32 (_mm_adds_pu8 (_mm_cvtsi32_si64 (s), _mm_cvtsi32_si64 (d)));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ save128Aligned( (__m128i*)pd,
+ _mm_adds_epu8( load128Unaligned((__m128i*)ps),
+ load128Aligned ((__m128i*)pd)) );
+ pd += 4;
+ ps += 4;
+ w -= 4;
+ }
+
+ while (w--)
+ {
+ s = *ps++;
+ d = *pd;
+ *pd++ = _mm_cvtsi64_si32 (_mm_adds_pu8 (_mm_cvtsi32_si64 (s), _mm_cvtsi32_si64 (d)));
+ }
+}
+
+static inline uint32_t
+coreCombineSaturateUPixelsse2 (uint32_t src, uint32_t dst)
+{
+ __m64 ms = unpack_32_1x64 (src);
+ __m64 md = unpack_32_1x64 (dst);
+ uint32_t sa = src >> 24;
+ uint32_t da = ~dst >> 24;
+
+ if (sa > da)
+ {
+ ms = pixMultiply_1x64 (ms, expandAlpha_1x64 (unpack_32_1x64 (FbIntDiv(da, sa) << 24)));
+ }
+
+ return pack_1x64_32 (_mm_adds_pu16 (md, ms));
+}
+
+static inline void
+coreCombineSaturateUsse2 (uint32_t *pd, const uint32_t *ps, int w)
+{
+ uint32_t s,d;
+
+ uint32_t packCmp;
+ __m128i xmmSrc, xmmDst;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ d = *pd;
+ *pd++ = coreCombineSaturateUPixelsse2 (s, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+
+ xmmDst = load128Aligned ((__m128i*)pd);
+ xmmSrc = load128Unaligned((__m128i*)ps);
+
+ packCmp = _mm_movemask_epi8 (_mm_cmpgt_epi32 (_mm_srli_epi32 (xmmSrc, 24),
+ _mm_srli_epi32 (_mm_xor_si128 (xmmDst, Maskff000000), 24)));
+
+ /* if some alpha src is grater than respective ~alpha dst */
+ if (packCmp)
+ {
+ s = *ps++;
+ d = *pd;
+ *pd++ = coreCombineSaturateUPixelsse2 (s, d);
+
+ s = *ps++;
+ d = *pd;
+ *pd++ = coreCombineSaturateUPixelsse2 (s, d);
+
+ s = *ps++;
+ d = *pd;
+ *pd++ = coreCombineSaturateUPixelsse2 (s, d);
+
+ s = *ps++;
+ d = *pd;
+ *pd++ = coreCombineSaturateUPixelsse2 (s, d);
+ }
+ else
+ {
+ save128Aligned ((__m128i*)pd, _mm_adds_epu8 (xmmDst, xmmSrc));
+
+ pd += 4;
+ ps += 4;
+ }
+
+ w -= 4;
+ }
+
+ while (w--)
+ {
+ s = *ps++;
+ d = *pd;
+ *pd++ = coreCombineSaturateUPixelsse2 (s, d);
+ }
+}
+
+static inline void
+coreCombineSrcCsse2 (uint32_t* pd, const uint32_t* ps, const uint32_t *pm, int w)
+{
+ uint32_t s, m;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+ __m128i xmmDstLo, xmmDstHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (s), unpack_32_1x64 (m)));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmMaskLo, &xmmMaskHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (s), unpack_32_1x64 (m)));
+ w--;
+ }
+}
+
+static inline uint32_t
+coreCombineOverCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
+{
+ __m64 s = unpack_32_1x64 (src);
+ __m64 expAlpha = expandAlpha_1x64 (s);
+ __m64 unpkMask = unpack_32_1x64 (mask);
+ __m64 unpkDst = unpack_32_1x64 (dst);
+
+ return pack_1x64_32 (inOver_1x64 (&s, &expAlpha, &unpkMask, &unpkDst));
+}
+
+static inline void
+coreCombineOverCsse2 (uint32_t* pd, const uint32_t* ps, const uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmAlphaLo, xmmAlphaHi;
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineOverCPixelsse2 (s, m, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi);
+
+ inOver_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi, &xmmMaskLo, &xmmMaskHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineOverCPixelsse2 (s, m, d);
+ w--;
+ }
+}
+
+static inline uint32_t
+coreCombineOverReverseCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
+{
+ __m64 d = unpack_32_1x64 (dst);
+
+ return pack_1x64_32(over_1x64 (d, expandAlpha_1x64 (d), pixMultiply_1x64 (unpack_32_1x64 (src), unpack_32_1x64 (mask))));
+}
+
+static inline void
+coreCombineOverReverseCsse2 (uint32_t* pd, const uint32_t* ps, const uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmAlphaLo, xmmAlphaHi;
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineOverReverseCPixelsse2 (s, m, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaLo, &xmmAlphaHi);
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmMaskLo, &xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ over_2x128 (&xmmDstLo, &xmmDstHi, &xmmAlphaLo, &xmmAlphaHi, &xmmMaskLo, &xmmMaskHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmMaskLo, xmmMaskHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineOverReverseCPixelsse2 (s, m, d);
+ w--;
+ }
+}
+
+static inline void
+coreCombineInCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmAlphaLo, xmmAlphaHi;
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (pixMultiply_1x64 (unpack_32_1x64 (s), unpack_32_1x64 (m)),
+ expandAlpha_1x64 (unpack_32_1x64 (d))));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaLo, &xmmAlphaHi);
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmMaskLo, &xmmMaskHi, &xmmDstLo, &xmmDstHi);
+
+ pixMultiply_2x128 (&xmmDstLo, &xmmDstHi, &xmmAlphaLo, &xmmAlphaHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (pixMultiply_1x64 (unpack_32_1x64 (s), unpack_32_1x64 (m)),
+ expandAlpha_1x64 (unpack_32_1x64 (d))));
+ w--;
+ }
+}
+
+static inline void
+coreCombineInReverseCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmAlphaLo, xmmAlphaHi;
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (d),
+ pixMultiply_1x64 (unpack_32_1x64 (m),
+ expandAlpha_1x64 (unpack_32_1x64 (s)))));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi);
+ pixMultiply_2x128 (&xmmMaskLo, &xmmMaskHi, &xmmAlphaLo, &xmmAlphaHi, &xmmAlphaLo, &xmmAlphaHi);
+
+ pixMultiply_2x128 (&xmmDstLo, &xmmDstHi, &xmmAlphaLo, &xmmAlphaHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (d),
+ pixMultiply_1x64 (unpack_32_1x64 (m),
+ expandAlpha_1x64 (unpack_32_1x64 (s)))));
+ w--;
+ }
+}
+
+static inline void
+coreCombineOutCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmAlphaLo, xmmAlphaHi;
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (pixMultiply_1x64 (unpack_32_1x64 (s), unpack_32_1x64 (m)),
+ negate_1x64 (expandAlpha_1x64 (unpack_32_1x64 (d)))));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaLo, &xmmAlphaHi);
+ negate_2x128 (xmmAlphaLo, xmmAlphaHi, &xmmAlphaLo, &xmmAlphaHi);
+
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmMaskLo, &xmmMaskHi, &xmmDstLo, &xmmDstHi);
+ pixMultiply_2x128 (&xmmDstLo, &xmmDstHi, &xmmAlphaLo, &xmmAlphaHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (pixMultiply_1x64 (unpack_32_1x64 (s), unpack_32_1x64 (m)),
+ negate_1x64 (expandAlpha_1x64 (unpack_32_1x64 (d)))));
+ w--;
+ }
+}
+
+static inline void
+coreCombineOutReverseCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmAlphaLo, xmmAlphaHi;
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (d),
+ negate_1x64 (pixMultiply_1x64 (unpack_32_1x64 (m),
+ expandAlpha_1x64 (unpack_32_1x64 (s))))));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi);
+
+ pixMultiply_2x128 (&xmmMaskLo, &xmmMaskHi, &xmmAlphaLo, &xmmAlphaHi, &xmmMaskLo, &xmmMaskHi);
+
+ negate_2x128 (xmmMaskLo, xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ pixMultiply_2x128 (&xmmDstLo, &xmmDstHi, &xmmMaskLo, &xmmMaskHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (d),
+ negate_1x64 (pixMultiply_1x64 (unpack_32_1x64 (m),
+ expandAlpha_1x64 (unpack_32_1x64 (s))))));
+ w--;
+ }
+}
+
+static inline uint32_t
+coreCombineAtopCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
+{
+ __m64 m = unpack_32_1x64 (mask);
+ __m64 s = unpack_32_1x64 (src);
+ __m64 d = unpack_32_1x64 (dst);
+ __m64 sa = expandAlpha_1x64 (s);
+ __m64 da = expandAlpha_1x64 (d);
+
+ s = pixMultiply_1x64 (s, m);
+ m = negate_1x64 (pixMultiply_1x64 (m, sa));
+
+ return pack_1x64_32 (pixAddMultiply_1x64 (&d, &m, &s, &da));
+}
+
+static inline void
+coreCombineAtopCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmAlphaSrcLo, xmmAlphaSrcHi;
+ __m128i xmmAlphaDstLo, xmmAlphaDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineAtopCPixelsse2 (s, m, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi);
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmMaskLo, &xmmMaskHi, &xmmSrcLo, &xmmSrcHi);
+ pixMultiply_2x128 (&xmmMaskLo, &xmmMaskHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi, &xmmMaskLo, &xmmMaskHi);
+
+ negate_2x128 (xmmMaskLo, xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ pixAddMultiply_2x128 (&xmmDstLo, &xmmDstHi, &xmmMaskLo, &xmmMaskHi,
+ &xmmSrcLo, &xmmSrcHi, &xmmAlphaDstLo, &xmmAlphaDstHi,
+ &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineAtopCPixelsse2 (s, m, d);
+ w--;
+ }
+}
+
+static inline uint32_t
+coreCombineReverseAtopCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
+{
+ __m64 m = unpack_32_1x64 (mask);
+ __m64 s = unpack_32_1x64 (src);
+ __m64 d = unpack_32_1x64 (dst);
+
+ __m64 da = negate_1x64 (expandAlpha_1x64 (d));
+ __m64 sa = expandAlpha_1x64 (s);
+
+ s = pixMultiply_1x64 (s, m);
+ m = pixMultiply_1x64 (m, sa);
+
+ return pack_1x64_32 (pixAddMultiply_1x64 (&d, &m, &s, &da));
+}
+
+static inline void
+coreCombineReverseAtopCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmAlphaSrcLo, xmmAlphaSrcHi;
+ __m128i xmmAlphaDstLo, xmmAlphaDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineReverseAtopCPixelsse2 (s, m, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi);
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmMaskLo, &xmmMaskHi, &xmmSrcLo, &xmmSrcHi);
+ pixMultiply_2x128 (&xmmMaskLo, &xmmMaskHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi, &xmmMaskLo, &xmmMaskHi);
+
+ negate_2x128 (xmmAlphaDstLo, xmmAlphaDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+
+ pixAddMultiply_2x128 (&xmmDstLo, &xmmDstHi, &xmmMaskLo, &xmmMaskHi,
+ &xmmSrcLo, &xmmSrcHi, &xmmAlphaDstLo, &xmmAlphaDstHi,
+ &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineReverseAtopCPixelsse2 (s, m, d);
+ w--;
+ }
+}
+
+static inline uint32_t
+coreCombineXorCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
+{
+ __m64 a = unpack_32_1x64 (mask);
+ __m64 s = unpack_32_1x64 (src);
+ __m64 d = unpack_32_1x64 (dst);
+
+ __m64 alphaDst = negate_1x64 (pixMultiply_1x64 (a, expandAlpha_1x64 (s)));
+ __m64 dest = pixMultiply_1x64 (s, a);
+ __m64 alphaSrc = negate_1x64 (expandAlpha_1x64 (d));
+
+ return pack_1x64_32 (pixAddMultiply_1x64 (&d,
+ &alphaDst,
+ &dest,
+ &alphaSrc));
+}
+
+static inline void
+coreCombineXorCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmAlphaSrcLo, xmmAlphaSrcHi;
+ __m128i xmmAlphaDstLo, xmmAlphaDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineXorCPixelsse2 (s, m, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi);
+ expandAlpha_2x128 (xmmDstLo, xmmDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmMaskLo, &xmmMaskHi, &xmmSrcLo, &xmmSrcHi);
+ pixMultiply_2x128 (&xmmMaskLo, &xmmMaskHi, &xmmAlphaSrcLo, &xmmAlphaSrcHi, &xmmMaskLo, &xmmMaskHi);
+
+ negate_2x128 (xmmAlphaDstLo, xmmAlphaDstHi, &xmmAlphaDstLo, &xmmAlphaDstHi);
+ negate_2x128 (xmmMaskLo, xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ pixAddMultiply_2x128 (&xmmDstLo, &xmmDstHi, &xmmMaskLo, &xmmMaskHi,
+ &xmmSrcLo, &xmmSrcHi, &xmmAlphaDstLo, &xmmAlphaDstHi,
+ &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = coreCombineXorCPixelsse2 (s, m, d);
+ w--;
+ }
+}
+
+static inline void
+coreCombineAddCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
+{
+ uint32_t s, m, d;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+ __m128i xmmMaskLo, xmmMaskHi;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (_mm_adds_pu8 (pixMultiply_1x64 (unpack_32_1x64 (s),
+ unpack_32_1x64 (m)),
+ unpack_32_1x64 (d)));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)ps);
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)ps);
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmSrcHi = load128Unaligned ((__m128i*)ps);
+ xmmMaskHi = load128Unaligned ((__m128i*)pm);
+ xmmDstHi = load128Aligned ((__m128i*)pd);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmMaskLo, &xmmMaskHi, &xmmSrcLo, &xmmSrcHi);
+
+ save128Aligned( (__m128i*)pd, pack_2x128_128 (_mm_adds_epu8 (xmmSrcLo, xmmDstLo),
+ _mm_adds_epu8 (xmmSrcHi, xmmDstHi)));
+
+ ps += 4;
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ s = *ps++;
+ m = *pm++;
+ d = *pd;
+
+ *pd++ = pack_1x64_32 (_mm_adds_pu8 (pixMultiply_1x64 (unpack_32_1x64 (s),
+ unpack_32_1x64 (m)),
+ unpack_32_1x64 (d)));
+ w--;
+ }
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbComposeSetupSSE2
+ */
+static inline __m64
+createMask_16_64 (uint16_t mask)
+{
+ return _mm_set1_pi16 (mask);
+}
+
+static inline __m128i
+createMask_16_128 (uint16_t mask)
+{
+ return _mm_set1_epi16 (mask);
+}
+
+static inline __m64
+createMask_2x32_64 (uint32_t mask0, uint32_t mask1)
+{
+ return _mm_set_pi32 (mask0, mask1);
+}
+
+static inline __m128i
+createMask_2x32_128 (uint32_t mask0, uint32_t mask1)
+{
+ return _mm_set_epi32 (mask0, mask1, mask0, mask1);
+}
+
+/* SSE2 code patch for fbcompose.c */
+
+static FASTCALL void
+sse2CombineMaskU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineReverseInUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineOverU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineOverUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineOverReverseU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineOverReverseUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineInU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineInUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineInReverseU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineReverseInUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineOutU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineOutUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineOutReverseU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineReverseOutUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineAtopU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineAtopUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineAtopReverseU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineReverseAtopUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineXorU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineXorUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineAddU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineAddUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineSaturateU (uint32_t *dst, const uint32_t *src, int width)
+{
+ coreCombineSaturateUsse2 (dst, src, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineSrcC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineSrcCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineOverC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineOverCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineOverReverseC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineOverReverseCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineInC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineInCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineInReverseC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineInReverseCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineOutC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineOutCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineOutReverseC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineOutReverseCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineAtopC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineAtopCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineAtopReverseC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineReverseAtopCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineXorC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineXorCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+static FASTCALL void
+sse2CombineAddC (uint32_t *dst, uint32_t *src, uint32_t *mask, int width)
+{
+ coreCombineAddCsse2 (dst, src, mask, width);
+ _mm_empty();
+}
+
+void
+fbComposeSetupSSE2(void)
+{
+ static pixman_bool_t initialized = FALSE;
+
+ if (initialized)
+ return;
+
+ /* check if we have SSE2 support and initialize accordingly */
+ if (pixman_have_sse2())
+ {
+ /* SSE2 constants */
+ Mask565r = createMask_2x32_128 (0x00f80000, 0x00f80000);
+ Mask565g1 = createMask_2x32_128 (0x00070000, 0x00070000);
+ Mask565g2 = createMask_2x32_128 (0x000000e0, 0x000000e0);
+ Mask565b = createMask_2x32_128 (0x0000001f, 0x0000001f);
+ MaskRed = createMask_2x32_128 (0x00f80000, 0x00f80000);
+ MaskGreen = createMask_2x32_128 (0x0000fc00, 0x0000fc00);
+ MaskBlue = createMask_2x32_128 (0x000000f8, 0x000000f8);
+ Mask565FixRB = createMask_2x32_128 (0x00e000e0, 0x00e000e0);
+ Mask565FixG = createMask_2x32_128 (0x0000c000, 0x0000c000);
+ Mask0080 = createMask_16_128 (0x0080);
+ Mask00ff = createMask_16_128 (0x00ff);
+ Mask0101 = createMask_16_128 (0x0101);
+ Maskffff = createMask_16_128 (0xffff);
+ Maskff000000 = createMask_2x32_128 (0xff000000, 0xff000000);
+ MaskAlpha = createMask_2x32_128 (0x00ff0000, 0x00000000);
+
+ /* MMX constants */
+ xMask565rgb = createMask_2x32_64 (0x000001f0, 0x003f001f);
+ xMask565Unpack = createMask_2x32_64 (0x00000084, 0x04100840);
+
+ xMask0080 = createMask_16_64 (0x0080);
+ xMask00ff = createMask_16_64 (0x00ff);
+ xMask0101 = createMask_16_64 (0x0101);
+ xMaskAlpha = createMask_2x32_64 (0x00ff0000, 0x00000000);
+
+ /* SSE code patch for fbcompose.c */
+ pixman_composeFunctions.combineU[PIXMAN_OP_OVER] = sse2CombineOverU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_OVER_REVERSE] = sse2CombineOverReverseU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_IN] = sse2CombineInU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_IN_REVERSE] = sse2CombineInReverseU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_OUT] = sse2CombineOutU;
+
+ pixman_composeFunctions.combineU[PIXMAN_OP_OUT_REVERSE] = sse2CombineOutReverseU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_ATOP] = sse2CombineAtopU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_ATOP_REVERSE] = sse2CombineAtopReverseU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_XOR] = sse2CombineXorU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_ADD] = sse2CombineAddU;
+
+ pixman_composeFunctions.combineU[PIXMAN_OP_SATURATE] = sse2CombineSaturateU;
+
+ pixman_composeFunctions.combineC[PIXMAN_OP_SRC] = sse2CombineSrcC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_OVER] = sse2CombineOverC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_OVER_REVERSE] = sse2CombineOverReverseC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_IN] = sse2CombineInC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_IN_REVERSE] = sse2CombineInReverseC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_OUT] = sse2CombineOutC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_OUT_REVERSE] = sse2CombineOutReverseC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_ATOP] = sse2CombineAtopC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_ATOP_REVERSE] = sse2CombineAtopReverseC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_XOR] = sse2CombineXorC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_ADD] = sse2CombineAddC;
+
+ pixman_composeFunctions.combineMaskU = sse2CombineMaskU;
+ }
+
+ initialized = TRUE;
+
+ _mm_empty();
+}
+
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSolid_nx8888
+ */
+
+void
+fbCompositeSolid_nx8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t src;
+ uint32_t *dstLine, *dst, d;
+ uint16_t w;
+ int dstStride;
+ __m128i xmmSrc, xmmAlpha;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+
+ fbComposeGetSolid(pSrc, src, pDst->bits.format);
+
+ if (src >> 24 == 0)
+ return;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+
+ xmmSrc = expandPixel_32_1x128 (src);
+ xmmAlpha = expandAlpha_1x128 (xmmSrc);
+
+ while (height--)
+ {
+ dst = dstLine;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)dst);
+
+ dstLine += dstStride;
+ w = width;
+
+ while (w && (unsigned long)dst & 15)
+ {
+ d = *dst;
+ *dst++ = pack_1x64_32 (over_1x64 (_mm_movepi64_pi64 (xmmSrc),
+ _mm_movepi64_pi64 (xmmAlpha),
+ unpack_32_1x64 (d)));
+ w--;
+ }
+
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)dst);
+
+ xmmDst = load128Aligned ((__m128i*)dst);
+
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+
+ over_2x128 (&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmDstLo, &xmmDstHi);
+
+ /* rebuid the 4 pixel data and save*/
+ save128Aligned ((__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ w -= 4;
+ dst += 4;
+ }
+
+ while (w)
+ {
+ d = *dst;
+ *dst++ = pack_1x64_32 (over_1x64 (_mm_movepi64_pi64 (xmmSrc),
+ _mm_movepi64_pi64 (xmmAlpha),
+ unpack_32_1x64 (d)));
+ w--;
+ }
+
+ }
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSolid_nx0565
+ */
+void
+fbCompositeSolid_nx0565sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t src;
+ uint16_t *dstLine, *dst, d;
+ uint16_t w;
+ int dstStride;
+ __m128i xmmSrc, xmmAlpha;
+ __m128i xmmDst, xmmDst0, xmmDst1, xmmDst2, xmmDst3;
+
+ fbComposeGetSolid(pSrc, src, pDst->bits.format);
+
+ if (src >> 24 == 0)
+ return;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
+
+ xmmSrc = expandPixel_32_1x128 (src);
+ xmmAlpha = expandAlpha_1x128 (xmmSrc);
+
+ while (height--)
+ {
+ dst = dstLine;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)dst);
+
+ dstLine += dstStride;
+ w = width;
+
+ while (w && (unsigned long)dst & 15)
+ {
+ d = *dst;
+
+ *dst++ = pack565_32_16 (pack_1x64_32 (over_1x64 (_mm_movepi64_pi64 (xmmSrc),
+ _mm_movepi64_pi64 (xmmAlpha),
+ expand565_16_1x64 (d))));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 8)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)dst);
+
+ xmmDst = load128Aligned ((__m128i*)dst);
+
+ unpack565_128_4x128 (xmmDst, &xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3);
+
+ over_2x128 (&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmDst0, &xmmDst1);
+ over_2x128 (&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmDst2, &xmmDst3);
+
+ xmmDst = pack565_4x128_128 (&xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3);
+ save128Aligned ((__m128i*)dst, xmmDst);
+
+ dst += 8;
+ w -= 8;
+ }
+
+ while (w--)
+ {
+ d = *dst;
+ *dst++ = pack565_32_16 (pack_1x64_32 (over_1x64 (_mm_movepi64_pi64 (xmmSrc),
+ _mm_movepi64_pi64 (xmmAlpha),
+ expand565_16_1x64 (d))));
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSolidMask_nx8888x8888C
+ */
+
+void
+fbCompositeSolidMask_nx8888x8888Csse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t src, srca;
+ uint32_t *dstLine, d;
+ uint32_t *maskLine, m;
+ uint32_t packCmp;
+ int dstStride, maskStride;
+
+ __m128i xmmSrc, xmmAlpha;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+ __m128i xmmMask, xmmMaskLo, xmmMaskHi;
+
+ __m64 mmxSrc, mmxAlpha, mmxMask, mmxDst;
+
+ fbComposeGetSolid(pSrc, src, pDst->bits.format);
+
+ srca = src >> 24;
+ if (srca == 0)
+ return;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pMask, xMask, yMask, uint32_t, maskStride, maskLine, 1);
+
+ xmmSrc = _mm_unpacklo_epi8 (createMask_2x32_128 (src, src), _mm_setzero_si128 ());
+ xmmAlpha = expandAlpha_1x128 (xmmSrc);
+ mmxSrc = _mm_movepi64_pi64 (xmmSrc);
+ mmxAlpha = _mm_movepi64_pi64 (xmmAlpha);
+
+ while (height--)
+ {
+ int w = width;
+ uint32_t *pm = (uint32_t *)maskLine;
+ uint32_t *pd = (uint32_t *)dstLine;
+
+ dstLine += dstStride;
+ maskLine += maskStride;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w && (unsigned long)pd & 15)
+ {
+ m = *pm++;
+
+ if (m)
+ {
+ d = *pd;
+ mmxMask = unpack_32_1x64 (m);
+ mmxDst = unpack_32_1x64 (d);
+
+ *pd = pack_1x64_32 (inOver_1x64 (&mmxSrc,
+ &mmxAlpha,
+ &mmxMask,
+ &mmxDst));
+ }
+
+ pd++;
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)pd);
+ cachePrefetch ((__m128i*)pm);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)pd);
+ cachePrefetchNext ((__m128i*)pm);
+
+ xmmMask = load128Unaligned ((__m128i*)pm);
+
+ packCmp = _mm_movemask_epi8 (_mm_cmpeq_epi32 (xmmMask, _mm_setzero_si128()));
+
+ /* if all bits in mask are zero, packCmp are equal to 0xffff */
+ if (packCmp != 0xffff)
+ {
+ xmmDst = load128Aligned ((__m128i*)pd);
+
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+
+ inOver_2x128 (&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmMaskLo, &xmmMaskHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)pd, pack_2x128_128 (xmmDstLo, xmmDstHi));
+ }
+
+ pd += 4;
+ pm += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ m = *pm++;
+
+ if (m)
+ {
+ d = *pd;
+ mmxMask = unpack_32_1x64 (m);
+ mmxDst = unpack_32_1x64 (d);
+
+ *pd = pack_1x64_32 (inOver_1x64 (&mmxSrc,
+ &mmxAlpha,
+ &mmxMask,
+ &mmxDst));
+ }
+
+ pd++;
+ w--;
+ }
+ }
+
+ _mm_empty();
+}
+
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSrc_8888x8x8888
+ */
+
+void
+fbCompositeSrc_8888x8x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t *dstLine, *dst;
+ uint32_t *srcLine, *src;
+ uint32_t mask;
+ uint16_t w;
+ int dstStride, srcStride;
+
+ __m128i xmmMask;
+ __m128i xmmSrc, xmmSrcLo, xmmSrcHi;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+ __m128i xmmAlphaLo, xmmAlphaHi;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
+ fbComposeGetSolid (pMask, mask, pDst->bits.format);
+
+ xmmMask = createMask_16_128 (mask >> 24);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ src = srcLine;
+ srcLine += srcStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)dst);
+ cachePrefetch ((__m128i*)src);
+
+ while (w && (unsigned long)dst & 15)
+ {
+ uint32_t s = *src++;
+ uint32_t d = *dst;
+
+ __m64 ms = unpack_32_1x64 (s);
+ __m64 alpha = expandAlpha_1x64 (ms);
+ __m64 dest = _mm_movepi64_pi64 (xmmMask);
+ __m64 alphaDst = unpack_32_1x64 (d);
+
+ *dst++ = pack_1x64_32 (inOver_1x64 (&ms,
+ &alpha,
+ &dest,
+ &alphaDst));
+
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)dst);
+ cachePrefetch ((__m128i*)src);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)dst);
+ cachePrefetchNext ((__m128i*)src);
+
+ xmmSrc = load128Unaligned ((__m128i*)src);
+ xmmDst = load128Aligned ((__m128i*)dst);
+
+ unpack_128_2x128 (xmmSrc, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi);
+
+ inOver_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi, &xmmMask, &xmmMask, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ dst += 4;
+ src += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ uint32_t s = *src++;
+ uint32_t d = *dst;
+
+ __m64 ms = unpack_32_1x64 (s);
+ __m64 alpha = expandAlpha_1x64 (ms);
+ __m64 mask = _mm_movepi64_pi64 (xmmMask);
+ __m64 dest = unpack_32_1x64 (d);
+
+ *dst++ = pack_1x64_32 (inOver_1x64 (&ms,
+ &alpha,
+ &mask,
+ &dest));
+
+ w--;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSrc_x888xnx8888
+ */
+void
+fbCompositeSrc_x888xnx8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t *dstLine, *dst;
+ uint32_t *srcLine, *src;
+ uint32_t mask;
+ int dstStride, srcStride;
+ uint16_t w;
+
+ __m128i xmmMask, xmmAlpha;
+ __m128i xmmSrc, xmmSrcLo, xmmSrcHi;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
+ fbComposeGetSolid (pMask, mask, pDst->bits.format);
+
+ xmmMask = createMask_16_128 (mask >> 24);
+ xmmAlpha = Mask00ff;
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ src = srcLine;
+ srcLine += srcStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)dst);
+ cachePrefetch ((__m128i*)src);
+
+ while (w && (unsigned long)dst & 15)
+ {
+ uint32_t s = (*src++) | 0xff000000;
+ uint32_t d = *dst;
+
+ __m64 src = unpack_32_1x64 (s);
+ __m64 alpha = _mm_movepi64_pi64 (xmmAlpha);
+ __m64 mask = _mm_movepi64_pi64 (xmmMask);
+ __m64 dest = unpack_32_1x64 (d);
+
+ *dst++ = pack_1x64_32 (inOver_1x64 (&src,
+ &alpha,
+ &mask,
+ &dest));
+
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)dst);
+ cachePrefetch ((__m128i*)src);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)dst);
+ cachePrefetchNext ((__m128i*)src);
+
+ xmmSrc = _mm_or_si128 (load128Unaligned ((__m128i*)src), Maskff000000);
+ xmmDst = load128Aligned ((__m128i*)dst);
+
+ unpack_128_2x128 (xmmSrc, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+
+ inOver_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmAlpha, &xmmAlpha, &xmmMask, &xmmMask, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ dst += 4;
+ src += 4;
+ w -= 4;
+
+ }
+
+ while (w)
+ {
+ uint32_t s = (*src++) | 0xff000000;
+ uint32_t d = *dst;
+
+ __m64 src = unpack_32_1x64 (s);
+ __m64 alpha = _mm_movepi64_pi64 (xmmAlpha);
+ __m64 mask = _mm_movepi64_pi64 (xmmMask);
+ __m64 dest = unpack_32_1x64 (d);
+
+ *dst++ = pack_1x64_32 (inOver_1x64 (&src,
+ &alpha,
+ &mask,
+ &dest));
+
+ w--;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSrc_8888x8888
+ */
+void
+fbCompositeSrc_8888x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ int dstStride, srcStride;
+ uint32_t *dstLine, *dst;
+ uint32_t *srcLine, *src;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
+
+ dst = dstLine;
+ src = srcLine;
+
+ while (height--)
+ {
+ coreCombineOverUsse2 (dst, src, width);
+
+ dst += dstStride;
+ src += srcStride;
+ }
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSrc_8888x0565
+ */
+static inline uint16_t
+fbCompositeSrc_8888x0565pixel (uint32_t src, uint16_t dst)
+{
+ __m64 ms;
+
+ ms = unpack_32_1x64 (src);
+ return pack565_32_16( pack_1x64_32 (over_1x64 (ms,
+ expandAlpha_1x64 (ms),
+ expand565_16_1x64 (dst))));
+}
+
+void
+fbCompositeSrc_8888x0565sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint16_t *dstLine, *dst, d;
+ uint32_t *srcLine, *src, s;
+ int dstStride, srcStride;
+ uint16_t w;
+
+ __m128i xmmAlphaLo, xmmAlphaHi;
+ __m128i xmmSrc, xmmSrcLo, xmmSrcHi;
+ __m128i xmmDst, xmmDst0, xmmDst1, xmmDst2, xmmDst3;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
+
+#if 0
+ /* FIXME
+ *
+ * I copy the code from MMX one and keep the fixme.
+ * If it's a problem there, probably is a problem here.
+ */
+ assert (pSrc->pDrawable == pMask->pDrawable);
+#endif
+
+ while (height--)
+ {
+ dst = dstLine;
+ src = srcLine;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+
+ dstLine += dstStride;
+ srcLine += srcStride;
+ w = width;
+
+ /* Align dst on a 16-byte boundary */
+ while (w &&
+ ((unsigned long)dst & 15))
+ {
+ s = *src++;
+ d = *dst;
+
+ *dst++ = fbCompositeSrc_8888x0565pixel (s, d);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+
+ /* It's a 8 pixel loop */
+ while (w >= 8)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)src);
+ cachePrefetchNext ((__m128i*)dst);
+
+ /* I'm loading unaligned because I'm not sure about the address alignment. */
+ xmmSrc = load128Unaligned ((__m128i*) src);
+ xmmDst = load128Aligned ((__m128i*) dst);
+
+ /* Unpacking */
+ unpack_128_2x128 (xmmSrc, &xmmSrcLo, &xmmSrcHi);
+ unpack565_128_4x128 (xmmDst, &xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3);
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi);
+
+ /* I'm loading next 4 pixels from memory before to optimze the memory read. */
+ xmmSrc = load128Unaligned ((__m128i*) (src+4));
+
+ over_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi, &xmmDst0, &xmmDst1);
+
+ /* Unpacking */
+ unpack_128_2x128 (xmmSrc, &xmmSrcLo, &xmmSrcHi);
+ expandAlpha_2x128 (xmmSrcLo, xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi);
+
+ over_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmAlphaLo, &xmmAlphaHi, &xmmDst2, &xmmDst3);
+
+ save128Aligned ((__m128i*)dst, pack565_4x128_128 (&xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3));
+
+ w -= 8;
+ dst += 8;
+ src += 8;
+ }
+
+ while (w--)
+ {
+ s = *src++;
+ d = *dst;
+
+ *dst++ = fbCompositeSrc_8888x0565pixel (s, d);
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSolidMask_nx8x8888
+ */
+
+void
+fbCompositeSolidMask_nx8x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t src, srca;
+ uint32_t *dstLine, *dst;
+ uint8_t *maskLine, *mask;
+ int dstStride, maskStride;
+ uint16_t w;
+ uint32_t m, d;
+
+ __m128i xmmSrc, xmmAlpha, xmmDef;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+ __m128i xmmMask, xmmMaskLo, xmmMaskHi;
+
+ __m64 mmxSrc, mmxAlpha, mmxMask, mmxDest;
+
+ fbComposeGetSolid(pSrc, src, pDst->bits.format);
+
+ srca = src >> 24;
+ if (srca == 0)
+ return;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
+
+ xmmDef = createMask_2x32_128 (src, src);
+ xmmSrc = expandPixel_32_1x128 (src);
+ xmmAlpha = expandAlpha_1x128 (xmmSrc);
+ mmxSrc = _mm_movepi64_pi64 (xmmSrc);
+ mmxAlpha = _mm_movepi64_pi64 (xmmAlpha);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ mask = maskLine;
+ maskLine += maskStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w && (unsigned long)dst & 15)
+ {
+ uint8_t m = *mask++;
+
+ if (m)
+ {
+ d = *dst;
+ mmxMask = expandPixel_8_1x64 (m);
+ mmxDest = unpack_32_1x64 (d);
+
+ *dst = pack_1x64_32 (inOver_1x64 (&mmxSrc,
+ &mmxAlpha,
+ &mmxMask,
+ &mmxDest));
+ }
+
+ w--;
+ dst++;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)mask);
+ cachePrefetchNext ((__m128i*)dst);
+
+ m = *((uint32_t*)mask);
+
+ if (srca == 0xff && m == 0xffffffff)
+ {
+ save128Aligned ((__m128i*)dst, xmmDef);
+ }
+ else if (m)
+ {
+ xmmDst = load128Aligned ((__m128i*) dst);
+ xmmMask = unpack_32_1x128 (m);
+ xmmMask = _mm_unpacklo_epi8 (xmmMask, _mm_setzero_si128());
+
+ /* Unpacking */
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlphaRev_2x128 (xmmMaskLo, xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ inOver_2x128 (&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmMaskLo, &xmmMaskHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+ }
+
+ w -= 4;
+ dst += 4;
+ mask += 4;
+ }
+
+ while (w)
+ {
+ uint8_t m = *mask++;
+
+ if (m)
+ {
+ d = *dst;
+ mmxMask = expandPixel_8_1x64 (m);
+ mmxDest = unpack_32_1x64 (d);
+
+ *dst = pack_1x64_32 (inOver_1x64 (&mmxSrc,
+ &mmxAlpha,
+ &mmxMask,
+ &mmxDest));
+ }
+
+ w--;
+ dst++;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSolidMask_nx8x8888
+ */
+
+pixman_bool_t
+pixmanFillsse2 (uint32_t *bits,
+ int stride,
+ int bpp,
+ int x,
+ int y,
+ int width,
+ int height,
+ uint32_t data)
+{
+ uint32_t byte_width;
+ uint8_t *byte_line;
+
+ __m128i xmmDef;
+
+ if (bpp == 16 && (data >> 16 != (data & 0xffff)))
+ return FALSE;
+
+ if (bpp != 16 && bpp != 32)
+ return FALSE;
+
+ if (bpp == 16)
+ {
+ stride = stride * (int) sizeof (uint32_t) / 2;
+ byte_line = (uint8_t *)(((uint16_t *)bits) + stride * y + x);
+ byte_width = 2 * width;
+ stride *= 2;
+ }
+ else
+ {
+ stride = stride * (int) sizeof (uint32_t) / 4;
+ byte_line = (uint8_t *)(((uint32_t *)bits) + stride * y + x);
+ byte_width = 4 * width;
+ stride *= 4;
+ }
+
+ cachePrefetch ((__m128i*)byte_line);
+ xmmDef = createMask_2x32_128 (data, data);
+
+ while (height--)
+ {
+ int w;
+ uint8_t *d = byte_line;
+ byte_line += stride;
+ w = byte_width;
+
+
+ cachePrefetchNext ((__m128i*)d);
+
+ while (w >= 2 && ((unsigned long)d & 3))
+ {
+ *(uint16_t *)d = data;
+ w -= 2;
+ d += 2;
+ }
+
+ while (w >= 4 && ((unsigned long)d & 15))
+ {
+ *(uint32_t *)d = data;
+
+ w -= 4;
+ d += 4;
+ }
+
+ cachePrefetchNext ((__m128i*)d);
+
+ while (w >= 128)
+ {
+ cachePrefetch (((__m128i*)d) + 12);
+
+ save128Aligned ((__m128i*)(d), xmmDef);
+ save128Aligned ((__m128i*)(d+16), xmmDef);
+ save128Aligned ((__m128i*)(d+32), xmmDef);
+ save128Aligned ((__m128i*)(d+48), xmmDef);
+ save128Aligned ((__m128i*)(d+64), xmmDef);
+ save128Aligned ((__m128i*)(d+80), xmmDef);
+ save128Aligned ((__m128i*)(d+96), xmmDef);
+ save128Aligned ((__m128i*)(d+112), xmmDef);
+
+ d += 128;
+ w -= 128;
+ }
+
+ if (w >= 64)
+ {
+ cachePrefetch (((__m128i*)d) + 8);
+
+ save128Aligned ((__m128i*)(d), xmmDef);
+ save128Aligned ((__m128i*)(d+16), xmmDef);
+ save128Aligned ((__m128i*)(d+32), xmmDef);
+ save128Aligned ((__m128i*)(d+48), xmmDef);
+
+ d += 64;
+ w -= 64;
+ }
+
+ cachePrefetchNext ((__m128i*)d);
+
+ if (w >= 32)
+ {
+ save128Aligned ((__m128i*)(d), xmmDef);
+ save128Aligned ((__m128i*)(d+16), xmmDef);
+
+ d += 32;
+ w -= 32;
+ }
+
+ if (w >= 16)
+ {
+ save128Aligned ((__m128i*)(d), xmmDef);
+
+ d += 16;
+ w -= 16;
+ }
+
+ cachePrefetchNext ((__m128i*)d);
+
+ while (w >= 4)
+ {
+ *(uint32_t *)d = data;
+
+ w -= 4;
+ d += 4;
+ }
+
+ if (w >= 2)
+ {
+ *(uint16_t *)d = data;
+ w -= 2;
+ d += 2;
+ }
+ }
+
+ _mm_empty();
+ return TRUE;
+}
+
+void
+fbCompositeSolidMaskSrc_nx8x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t src, srca;
+ uint32_t *dstLine, *dst;
+ uint8_t *maskLine, *mask;
+ int dstStride, maskStride;
+ uint16_t w;
+ uint32_t m;
+
+ __m128i xmmSrc, xmmDef;
+ __m128i xmmMask, xmmMaskLo, xmmMaskHi;
+
+ fbComposeGetSolid(pSrc, src, pDst->bits.format);
+
+ srca = src >> 24;
+ if (srca == 0)
+ {
+ pixmanFillsse2 (pDst->bits.bits, pDst->bits.rowstride,
+ PIXMAN_FORMAT_BPP (pDst->bits.format),
+ xDst, yDst, width, height, 0);
+ return;
+ }
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
+
+ xmmDef = createMask_2x32_128 (src, src);
+ xmmSrc = expandPixel_32_1x128 (src);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ mask = maskLine;
+ maskLine += maskStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w && (unsigned long)dst & 15)
+ {
+ uint8_t m = *mask++;
+
+ if (m)
+ {
+ *dst = pack_1x64_32 (pixMultiply_1x64 (_mm_movepi64_pi64 (xmmSrc), expandPixel_8_1x64 (m)));
+ }
+ else
+ {
+ *dst = 0;
+ }
+
+ w--;
+ dst++;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)mask);
+ cachePrefetchNext ((__m128i*)dst);
+
+ m = *((uint32_t*)mask);
+
+ if (srca == 0xff && m == 0xffffffff)
+ {
+ save128Aligned ((__m128i*)dst, xmmDef);
+ }
+ else if (m)
+ {
+ xmmMask = unpack_32_1x128 (m);
+ xmmMask = _mm_unpacklo_epi8 (xmmMask, _mm_setzero_si128());
+
+ /* Unpacking */
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlphaRev_2x128 (xmmMaskLo, xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ pixMultiply_2x128 (&xmmSrc, &xmmSrc, &xmmMaskLo, &xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ save128Aligned ((__m128i*)dst, pack_2x128_128 (xmmMaskLo, xmmMaskHi));
+ }
+ else
+ {
+ save128Aligned ((__m128i*)dst, _mm_setzero_si128());
+ }
+
+ w -= 4;
+ dst += 4;
+ mask += 4;
+ }
+
+ while (w)
+ {
+ uint8_t m = *mask++;
+
+ if (m)
+ {
+ *dst = pack_1x64_32 (pixMultiply_1x64 (_mm_movepi64_pi64 (xmmSrc), expandPixel_8_1x64 (m)));
+ }
+ else
+ {
+ *dst = 0;
+ }
+
+ w--;
+ dst++;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSolidMask_nx8x0565
+ */
+
+void
+fbCompositeSolidMask_nx8x0565sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t src, srca;
+ uint16_t *dstLine, *dst, d;
+ uint8_t *maskLine, *mask;
+ int dstStride, maskStride;
+ uint16_t w;
+ uint32_t m;
+ __m64 mmxSrc, mmxAlpha, mmxMask, mmxDest;
+
+ __m128i xmmSrc, xmmAlpha;
+ __m128i xmmMask, xmmMaskLo, xmmMaskHi;
+ __m128i xmmDst, xmmDst0, xmmDst1, xmmDst2, xmmDst3;
+
+ fbComposeGetSolid(pSrc, src, pDst->bits.format);
+
+ srca = src >> 24;
+ if (srca == 0)
+ return;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
+
+ xmmSrc = expandPixel_32_1x128 (src);
+ xmmAlpha = expandAlpha_1x128 (xmmSrc);
+ mmxSrc = _mm_movepi64_pi64 (xmmSrc);
+ mmxAlpha = _mm_movepi64_pi64 (xmmAlpha);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ mask = maskLine;
+ maskLine += maskStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w && (unsigned long)dst & 15)
+ {
+ m = *mask++;
+
+ if (m)
+ {
+ d = *dst;
+ mmxMask = expandAlphaRev_1x64 (unpack_32_1x64 (m));
+ mmxDest = expand565_16_1x64 (d);
+
+ *dst = pack565_32_16 (pack_1x64_32 (inOver_1x64 (&mmxSrc,
+ &mmxAlpha,
+ &mmxMask,
+ &mmxDest)));
+ }
+
+ w--;
+ dst++;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 8)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)mask);
+ cachePrefetchNext ((__m128i*)dst);
+
+ xmmDst = load128Aligned ((__m128i*) dst);
+ unpack565_128_4x128 (xmmDst, &xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3);
+
+ m = *((uint32_t*)mask);
+ mask += 4;
+
+ if (m)
+ {
+ xmmMask = unpack_32_1x128 (m);
+ xmmMask = _mm_unpacklo_epi8 (xmmMask, _mm_setzero_si128());
+
+ /* Unpacking */
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlphaRev_2x128 (xmmMaskLo, xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+ inOver_2x128 (&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmMaskLo, &xmmMaskHi, &xmmDst0, &xmmDst1);
+ }
+
+ m = *((uint32_t*)mask);
+ mask += 4;
+
+ if (m)
+ {
+ xmmMask = unpack_32_1x128 (m);
+ xmmMask = _mm_unpacklo_epi8 (xmmMask, _mm_setzero_si128());
+
+ /* Unpacking */
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+
+ expandAlphaRev_2x128 (xmmMaskLo, xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+ inOver_2x128 (&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmMaskLo, &xmmMaskHi, &xmmDst2, &xmmDst3);
+ }
+
+ save128Aligned ((__m128i*)dst, pack565_4x128_128 (&xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3));
+
+ w -= 8;
+ dst += 8;
+ }
+
+ while (w)
+ {
+ m = *mask++;
+
+ if (m)
+ {
+ d = *dst;
+ mmxMask = expandAlphaRev_1x64 (unpack_32_1x64 (m));
+ mmxDest = expand565_16_1x64 (d);
+
+ *dst = pack565_32_16 (pack_1x64_32 (inOver_1x64 (&mmxSrc,
+ &mmxAlpha,
+ &mmxMask,
+ &mmxDest)));
+ }
+
+ w--;
+ dst++;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSrc_8888RevNPx0565
+ */
+
+void
+fbCompositeSrc_8888RevNPx0565sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint16_t *dstLine, *dst, d;
+ uint32_t *srcLine, *src, s;
+ int dstStride, srcStride;
+ uint16_t w;
+ uint32_t packCmp;
+
+ __m64 ms;
+ __m128i xmmSrc, xmmSrcLo, xmmSrcHi;
+ __m128i xmmDst, xmmDst0, xmmDst1, xmmDst2, xmmDst3;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
+
+#if 0
+ /* FIXME
+ *
+ * I copy the code from MMX one and keep the fixme.
+ * If it's a problem there, probably is a problem here.
+ */
+ assert (pSrc->pDrawable == pMask->pDrawable);
+#endif
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ src = srcLine;
+ srcLine += srcStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w && (unsigned long)dst & 15)
+ {
+ s = *src++;
+ d = *dst;
+
+ ms = unpack_32_1x64 (s);
+
+ *dst++ = pack565_32_16 (pack_1x64_32 (overRevNonPre_1x64(ms, expand565_16_1x64 (d))));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 8)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)src);
+ cachePrefetchNext ((__m128i*)dst);
+
+ /* First round */
+ xmmSrc = load128Unaligned((__m128i*)src);
+ xmmDst = load128Aligned ((__m128i*)dst);
+
+ packCmp = packAlpha (xmmSrc);
+
+ unpack565_128_4x128 (xmmDst, &xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3);
+ unpack_128_2x128 (xmmSrc, &xmmSrcLo, &xmmSrcHi);
+
+ /* preload next round*/
+ xmmSrc = load128Unaligned((__m128i*)(src+4));
+ /* preload next round*/
+
+ if (packCmp == 0xffffffff)
+ {
+ invertColors_2x128 (xmmSrcLo, xmmSrcHi, &xmmDst0, &xmmDst1);
+ }
+ else if (packCmp)
+ {
+ overRevNonPre_2x128 (xmmSrcLo, xmmSrcHi, &xmmDst0, &xmmDst1);
+ }
+
+ /* Second round */
+ packCmp = packAlpha (xmmSrc);
+
+ unpack_128_2x128 (xmmSrc, &xmmSrcLo, &xmmSrcHi);
+
+ if (packCmp == 0xffffffff)
+ {
+ invertColors_2x128 (xmmSrcLo, xmmSrcHi, &xmmDst2, &xmmDst3);
+ }
+ else if (packCmp)
+ {
+ overRevNonPre_2x128 (xmmSrcLo, xmmSrcHi, &xmmDst2, &xmmDst3);
+ }
+
+ save128Aligned ((__m128i*)dst, pack565_4x128_128 (&xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3));
+
+ w -= 8;
+ src += 8;
+ dst += 8;
+ }
+
+ while (w)
+ {
+ s = *src++;
+ d = *dst;
+
+ ms = unpack_32_1x64 (s);
+
+ *dst++ = pack565_32_16 (pack_1x64_32 (overRevNonPre_1x64(ms, expand565_16_1x64 (d))));
+ w--;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* "8888RevNP" is GdkPixbuf's format: ABGR, non premultiplied */
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSrc_8888RevNPx8888
+ */
+
+void
+fbCompositeSrc_8888RevNPx8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t *dstLine, *dst, d;
+ uint32_t *srcLine, *src, s;
+ int dstStride, srcStride;
+ uint16_t w;
+ uint32_t packCmp;
+
+ __m128i xmmSrcLo, xmmSrcHi;
+ __m128i xmmDstLo, xmmDstHi;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
+
+#if 0
+ /* FIXME
+ *
+ * I copy the code from MMX one and keep the fixme.
+ * If it's a problem there, probably is a problem here.
+ */
+ assert (pSrc->pDrawable == pMask->pDrawable);
+#endif
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ src = srcLine;
+ srcLine += srcStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w && (unsigned long)dst & 15)
+ {
+ s = *src++;
+ d = *dst;
+
+ *dst++ = pack_1x64_32 (overRevNonPre_1x64 (unpack_32_1x64 (s), unpack_32_1x64 (d)));
+
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)src);
+ cachePrefetchNext ((__m128i*)dst);
+
+ xmmSrcHi = load128Unaligned((__m128i*)src);
+
+ packCmp = packAlpha (xmmSrcHi);
+
+ unpack_128_2x128 (xmmSrcHi, &xmmSrcLo, &xmmSrcHi);
+
+ if (packCmp == 0xffffffff)
+ {
+ invertColors_2x128( xmmSrcLo, xmmSrcHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+ }
+ else if (packCmp)
+ {
+ xmmDstHi = load128Aligned ((__m128i*)dst);
+
+ unpack_128_2x128 (xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ overRevNonPre_2x128 (xmmSrcLo, xmmSrcHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+ }
+
+ w -= 4;
+ dst += 4;
+ src += 4;
+ }
+
+ while (w)
+ {
+ s = *src++;
+ d = *dst;
+
+ *dst++ = pack_1x64_32 (overRevNonPre_1x64 (unpack_32_1x64 (s), unpack_32_1x64 (d)));
+
+ w--;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSolidMask_nx8888x0565C
+ */
+
+void
+fbCompositeSolidMask_nx8888x0565Csse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t src, srca;
+ uint16_t *dstLine, *dst, d;
+ uint32_t *maskLine, *mask, m;
+ int dstStride, maskStride;
+ int w;
+ uint32_t packCmp;
+
+ __m128i xmmSrc, xmmAlpha;
+ __m128i xmmMask, xmmMaskLo, xmmMaskHi;
+ __m128i xmmDst, xmmDst0, xmmDst1, xmmDst2, xmmDst3;
+
+ __m64 mmxSrc, mmxAlpha, mmxMask, mmxDest;
+
+ fbComposeGetSolid(pSrc, src, pDst->bits.format);
+
+ srca = src >> 24;
+ if (srca == 0)
+ return;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pMask, xMask, yMask, uint32_t, maskStride, maskLine, 1);
+
+ xmmSrc = expandPixel_32_1x128 (src);
+ xmmAlpha = expandAlpha_1x128 (xmmSrc);
+ mmxSrc = _mm_movepi64_pi64 (xmmSrc);
+ mmxAlpha = _mm_movepi64_pi64 (xmmAlpha);
+
+ while (height--)
+ {
+ w = width;
+ mask = maskLine;
+ dst = dstLine;
+ maskLine += maskStride;
+ dstLine += dstStride;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w && ((unsigned long)dst & 15))
+ {
+ m = *(uint32_t *) mask;
+
+ if (m)
+ {
+ d = *dst;
+ mmxMask = unpack_32_1x64 (m);
+ mmxDest = expand565_16_1x64 (d);
+
+ *dst = pack565_32_16 (pack_1x64_32 (inOver_1x64 (&mmxSrc,
+ &mmxAlpha,
+ &mmxMask,
+ &mmxDest)));
+ }
+
+ w--;
+ dst++;
+ mask++;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 8)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)mask);
+ cachePrefetchNext ((__m128i*)dst);
+
+ /* First round */
+ xmmMask = load128Unaligned((__m128i*)mask);
+ xmmDst = load128Aligned((__m128i*)dst);
+
+ packCmp = _mm_movemask_epi8 (_mm_cmpeq_epi32 (xmmMask, _mm_setzero_si128()));
+
+ unpack565_128_4x128 (xmmDst, &xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3);
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+
+ /* preload next round*/
+ xmmMask = load128Unaligned((__m128i*)(mask+4));
+ /* preload next round*/
+
+ if (packCmp != 0xffff)
+ {
+ inOver_2x128(&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmMaskLo, &xmmMaskHi, &xmmDst0, &xmmDst1);
+ }
+
+ /* Second round */
+ packCmp = _mm_movemask_epi8 (_mm_cmpeq_epi32 (xmmMask, _mm_setzero_si128()));
+
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+
+ if (packCmp != 0xffff)
+ {
+ inOver_2x128(&xmmSrc, &xmmSrc, &xmmAlpha, &xmmAlpha, &xmmMaskLo, &xmmMaskHi, &xmmDst2, &xmmDst3);
+ }
+
+ save128Aligned ((__m128i*)dst, pack565_4x128_128 (&xmmDst0, &xmmDst1, &xmmDst2, &xmmDst3));
+
+ w -= 8;
+ dst += 8;
+ mask += 8;
+ }
+
+ while (w)
+ {
+ m = *(uint32_t *) mask;
+
+ if (m)
+ {
+ d = *dst;
+ mmxMask = unpack_32_1x64 (m);
+ mmxDest = expand565_16_1x64 (d);
+
+ *dst = pack565_32_16 (pack_1x64_32 (inOver_1x64 (&mmxSrc,
+ &mmxAlpha,
+ &mmxMask,
+ &mmxDest)));
+ }
+
+ w--;
+ dst++;
+ mask++;
+ }
+ }
+
+ _mm_empty ();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeIn_nx8x8
+ */
+
+void
+fbCompositeIn_nx8x8sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint8_t *dstLine, *dst;
+ uint8_t *maskLine, *mask;
+ int dstStride, maskStride;
+ uint16_t w, d, m;
+ uint32_t src;
+ uint8_t sa;
+
+ __m128i xmmAlpha;
+ __m128i xmmMask, xmmMaskLo, xmmMaskHi;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
+
+ fbComposeGetSolid(pSrc, src, pDst->bits.format);
+
+ sa = src >> 24;
+ if (sa == 0)
+ return;
+
+ xmmAlpha = expandAlpha_1x128 (expandPixel_32_1x128 (src));
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ mask = maskLine;
+ maskLine += maskStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w && ((unsigned long)dst & 15))
+ {
+ m = (uint32_t) *mask++;
+ d = (uint32_t) *dst;
+
+ *dst++ = (uint8_t) pack_1x64_32 (pixMultiply_1x64 (pixMultiply_1x64 (_mm_movepi64_pi64 (xmmAlpha), unpack_32_1x64 (m)),
+ unpack_32_1x64 (d)));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 16)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)mask);
+ cachePrefetchNext ((__m128i*)dst);
+
+ xmmMask = load128Unaligned((__m128i*)mask);
+ xmmDst = load128Aligned((__m128i*)dst);
+
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+
+ pixMultiply_2x128 (&xmmAlpha, &xmmAlpha, &xmmMaskLo, &xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+ pixMultiply_2x128 (&xmmMaskLo, &xmmMaskHi, &xmmDstLo, &xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ mask += 16;
+ dst += 16;
+ w -= 16;
+ }
+
+ while (w)
+ {
+ m = (uint32_t) *mask++;
+ d = (uint32_t) *dst;
+
+ *dst++ = (uint8_t) pack_1x64_32 (pixMultiply_1x64 (pixMultiply_1x64 (_mm_movepi64_pi64 (xmmAlpha), unpack_32_1x64 (m)),
+ unpack_32_1x64 (d)));
+ w--;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeIn_8x8
+ */
+
+void
+fbCompositeIn_8x8sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint8_t *dstLine, *dst;
+ uint8_t *srcLine, *src;
+ int srcStride, dstStride;
+ uint16_t w;
+ uint32_t s, d;
+
+ __m128i xmmSrc, xmmSrcLo, xmmSrcHi;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint8_t, srcStride, srcLine, 1);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ src = srcLine;
+ srcLine += srcStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w && ((unsigned long)dst & 15))
+ {
+ s = (uint32_t) *src++;
+ d = (uint32_t) *dst;
+
+ *dst++ = (uint8_t) pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (s),unpack_32_1x64 (d)));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 16)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)src);
+ cachePrefetchNext ((__m128i*)dst);
+
+ xmmSrc = load128Unaligned((__m128i*)src);
+ xmmDst = load128Aligned((__m128i*)dst);
+
+ unpack_128_2x128 (xmmSrc, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+
+ pixMultiply_2x128 (&xmmSrcLo, &xmmSrcHi, &xmmDstLo, &xmmDstHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned ((__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ src += 16;
+ dst += 16;
+ w -= 16;
+ }
+
+ while (w)
+ {
+ s = (uint32_t) *src++;
+ d = (uint32_t) *dst;
+
+ *dst++ = (uint8_t) pack_1x64_32 (pixMultiply_1x64 (unpack_32_1x64 (s),unpack_32_1x64 (d)));
+ w--;
+ }
+ }
+
+ _mm_empty ();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSrcAdd_8888x8x8
+ */
+
+void
+fbCompositeSrcAdd_8888x8x8sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint8_t *dstLine, *dst;
+ uint8_t *maskLine, *mask;
+ int dstStride, maskStride;
+ uint16_t w;
+ uint32_t src;
+ uint8_t sa;
+ uint32_t m, d;
+
+ __m128i xmmAlpha;
+ __m128i xmmMask, xmmMaskLo, xmmMaskHi;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
+
+ fbComposeGetSolid(pSrc, src, pDst->bits.format);
+
+ sa = src >> 24;
+ if (sa == 0)
+ return;
+
+ xmmAlpha = expandAlpha_1x128 (expandPixel_32_1x128 (src));
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ mask = maskLine;
+ maskLine += maskStride;
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w && ((unsigned long)dst & 15))
+ {
+ m = (uint32_t) *mask++;
+ d = (uint32_t) *dst;
+
+ *dst++ = (uint8_t) pack_1x64_32 (_mm_adds_pu16 (pixMultiply_1x64 (_mm_movepi64_pi64 (xmmAlpha), unpack_32_1x64 (m)),
+ unpack_32_1x64 (d)));
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)mask);
+ cachePrefetch ((__m128i*)dst);
+
+ while (w >= 16)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)mask);
+ cachePrefetchNext ((__m128i*)dst);
+
+ xmmMask = load128Unaligned((__m128i*)mask);
+ xmmDst = load128Aligned((__m128i*)dst);
+
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+
+ pixMultiply_2x128 (&xmmAlpha, &xmmAlpha, &xmmMaskLo, &xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ xmmDstLo = _mm_adds_epu16 (xmmMaskLo, xmmDstLo);
+ xmmDstHi = _mm_adds_epu16 (xmmMaskHi, xmmDstHi);
+
+ save128Aligned ((__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+
+ mask += 16;
+ dst += 16;
+ w -= 16;
+ }
+
+ while (w)
+ {
+ m = (uint32_t) *mask++;
+ d = (uint32_t) *dst;
+
+ *dst++ = (uint8_t) pack_1x64_32 (_mm_adds_pu16 (pixMultiply_1x64 (_mm_movepi64_pi64 (xmmAlpha), unpack_32_1x64 (m)),
+ unpack_32_1x64 (d)));
+ w--;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSrcAdd_8000x8000
+ */
+
+void
+fbCompositeSrcAdd_8000x8000sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint8_t *dstLine, *dst;
+ uint8_t *srcLine, *src;
+ int dstStride, srcStride;
+ uint16_t w;
+ uint16_t t;
+
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint8_t, srcStride, srcLine, 1);
+ fbComposeGetStart (pDst, xDst, yDst, uint8_t, dstStride, dstLine, 1);
+
+ while (height--)
+ {
+ dst = dstLine;
+ src = srcLine;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+
+ dstLine += dstStride;
+ srcLine += srcStride;
+ w = width;
+
+ /* Small head */
+ while (w && (unsigned long)dst & 3)
+ {
+ t = (*dst) + (*src++);
+ *dst++ = t | (0 - (t >> 8));
+ w--;
+ }
+
+ coreCombineAddUsse2 ((uint32_t*)dst, (uint32_t*)src, w >> 2);
+
+ /* Small tail */
+ dst += w & 0xfffc;
+ src += w & 0xfffc;
+
+ w &= 3;
+
+ while (w)
+ {
+ t = (*dst) + (*src++);
+ *dst++ = t | (0 - (t >> 8));
+ w--;
+ }
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeSrcAdd_8888x8888
+ */
+void
+fbCompositeSrcAdd_8888x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t *dstLine, *dst;
+ uint32_t *srcLine, *src;
+ int dstStride, srcStride;
+
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ src = srcLine;
+ srcLine += srcStride;
+
+ coreCombineAddUsse2 (dst, src, width);
+ }
+
+ _mm_empty();
+}
+
+/* -------------------------------------------------------------------------------------------------
+ * fbCompositeCopyAreasse2
+ */
+
+pixman_bool_t
+pixmanBltsse2 (uint32_t *src_bits,
+ uint32_t *dst_bits,
+ int src_stride,
+ int dst_stride,
+ int src_bpp,
+ int dst_bpp,
+ int src_x, int src_y,
+ int dst_x, int dst_y,
+ int width, int height)
+{
+ uint8_t * src_bytes;
+ uint8_t * dst_bytes;
+ int byte_width;
+
+ if (src_bpp != dst_bpp)
+ return FALSE;
+
+ if (src_bpp == 16)
+ {
+ src_stride = src_stride * (int) sizeof (uint32_t) / 2;
+ dst_stride = dst_stride * (int) sizeof (uint32_t) / 2;
+ src_bytes = (uint8_t *)(((uint16_t *)src_bits) + src_stride * (src_y) + (src_x));
+ dst_bytes = (uint8_t *)(((uint16_t *)dst_bits) + dst_stride * (dst_y) + (dst_x));
+ byte_width = 2 * width;
+ src_stride *= 2;
+ dst_stride *= 2;
+ }
+ else if (src_bpp == 32)
+ {
+ src_stride = src_stride * (int) sizeof (uint32_t) / 4;
+ dst_stride = dst_stride * (int) sizeof (uint32_t) / 4;
+ src_bytes = (uint8_t *)(((uint32_t *)src_bits) + src_stride * (src_y) + (src_x));
+ dst_bytes = (uint8_t *)(((uint32_t *)dst_bits) + dst_stride * (dst_y) + (dst_x));
+ byte_width = 4 * width;
+ src_stride *= 4;
+ dst_stride *= 4;
+ }
+ else
+ {
+ return FALSE;
+ }
+
+ cachePrefetch ((__m128i*)src_bytes);
+ cachePrefetch ((__m128i*)dst_bytes);
+
+ while (height--)
+ {
+ int w;
+ uint8_t *s = src_bytes;
+ uint8_t *d = dst_bytes;
+ src_bytes += src_stride;
+ dst_bytes += dst_stride;
+ w = byte_width;
+
+ cachePrefetchNext ((__m128i*)s);
+ cachePrefetchNext ((__m128i*)d);
+
+ while (w >= 2 && ((unsigned long)d & 3))
+ {
+ *(uint16_t *)d = *(uint16_t *)s;
+ w -= 2;
+ s += 2;
+ d += 2;
+ }
+
+ while (w >= 4 && ((unsigned long)d & 15))
+ {
+ *(uint32_t *)d = *(uint32_t *)s;
+
+ w -= 4;
+ s += 4;
+ d += 4;
+ }
+
+ cachePrefetchNext ((__m128i*)s);
+ cachePrefetchNext ((__m128i*)d);
+
+ while (w >= 64)
+ {
+ __m128i xmm0, xmm1, xmm2, xmm3;
+
+ /* 128 bytes ahead */
+ cachePrefetch (((__m128i*)s) + 8);
+ cachePrefetch (((__m128i*)d) + 8);
+
+ xmm0 = load128Unaligned ((__m128i*)(s));
+ xmm1 = load128Unaligned ((__m128i*)(s+16));
+ xmm2 = load128Unaligned ((__m128i*)(s+32));
+ xmm3 = load128Unaligned ((__m128i*)(s+48));
+
+ save128Aligned ((__m128i*)(d), xmm0);
+ save128Aligned ((__m128i*)(d+16), xmm1);
+ save128Aligned ((__m128i*)(d+32), xmm2);
+ save128Aligned ((__m128i*)(d+48), xmm3);
+
+ s += 64;
+ d += 64;
+ w -= 64;
+ }
+
+ cachePrefetchNext ((__m128i*)s);
+ cachePrefetchNext ((__m128i*)d);
+
+ while (w >= 16)
+ {
+ save128Aligned ((__m128i*)d, load128Unaligned ((__m128i*)s) );
+
+ w -= 16;
+ d += 16;
+ s += 16;
+ }
+
+ cachePrefetchNext ((__m128i*)s);
+ cachePrefetchNext ((__m128i*)d);
+
+ while (w >= 4)
+ {
+ *(uint32_t *)d = *(uint32_t *)s;
+
+ w -= 4;
+ s += 4;
+ d += 4;
+ }
+
+ if (w >= 2)
+ {
+ *(uint16_t *)d = *(uint16_t *)s;
+ w -= 2;
+ s += 2;
+ d += 2;
+ }
+ }
+
+ _mm_empty();
+
+ return TRUE;
+}
+
+void
+fbCompositeCopyAreasse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ pixmanBltsse2 (pSrc->bits.bits,
+ pDst->bits.bits,
+ pSrc->bits.rowstride,
+ pDst->bits.rowstride,
+ PIXMAN_FORMAT_BPP (pSrc->bits.format),
+ PIXMAN_FORMAT_BPP (pDst->bits.format),
+ xSrc, ySrc, xDst, yDst, width, height);
+}
+
+#if 0
+/* This code are buggy in MMX version, now the bug was translated to SSE2 version */
+void
+fbCompositeOver_x888x8x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t *src, *srcLine, s;
+ uint32_t *dst, *dstLine, d;
+ uint8_t *mask, *maskLine;
+ uint32_t m;
+ int srcStride, maskStride, dstStride;
+ uint16_t w;
+
+ __m128i xmmSrc, xmmSrcLo, xmmSrcHi;
+ __m128i xmmDst, xmmDstLo, xmmDstHi;
+ __m128i xmmMask, xmmMaskLo, xmmMaskHi;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+ fbComposeGetStart (pMask, xMask, yMask, uint8_t, maskStride, maskLine, 1);
+ fbComposeGetStart (pSrc, xSrc, ySrc, uint32_t, srcStride, srcLine, 1);
+
+ while (height--)
+ {
+ src = srcLine;
+ srcLine += srcStride;
+ dst = dstLine;
+ dstLine += dstStride;
+ mask = maskLine;
+ maskLine += maskStride;
+
+ w = width;
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+ cachePrefetch ((__m128i*)mask);
+
+ while (w && (unsigned long)dst & 15)
+ {
+ s = 0xff000000 | *src++;
+ m = (uint32_t) *mask++;
+ d = *dst;
+
+ __m64 ms = unpack_32_1x64 (s);
+
+ if (m != 0xff)
+ {
+ ms = inOver_1x64 (ms,
+ xMask00ff,
+ expandAlphaRev_1x64 (unpack_32_1x64 (m)),
+ unpack_32_1x64 (d));
+ }
+
+ *dst++ = pack_1x64_32 (ms);
+ w--;
+ }
+
+ /* call prefetch hint to optimize cache load*/
+ cachePrefetch ((__m128i*)src);
+ cachePrefetch ((__m128i*)dst);
+ cachePrefetch ((__m128i*)mask);
+
+ while (w >= 4)
+ {
+ /* fill cache line with next memory */
+ cachePrefetchNext ((__m128i*)src);
+ cachePrefetchNext ((__m128i*)dst);
+ cachePrefetchNext ((__m128i*)mask);
+
+ m = *(uint32_t*) mask;
+ xmmSrc = _mm_or_si128 (load128Unaligned ((__m128i*)src), Maskff000000);
+
+ if (m == 0xffffffff)
+ {
+ save128Aligned ((__m128i*)dst, xmmSrc);
+ }
+ else
+ {
+ xmmDst = load128Aligned ((__m128i*)dst);
+
+ xmmMask = _mm_unpacklo_epi16 (unpack_32_1x128 (m), _mm_setzero_si128());
+
+ unpack_128_2x128 (xmmSrc, &xmmSrcLo, &xmmSrcHi);
+ unpack_128_2x128 (xmmMask, &xmmMaskLo, &xmmMaskHi);
+ unpack_128_2x128 (xmmDst, &xmmDstLo, &xmmDstHi);
+
+ expandAlphaRev_2x128 (xmmMaskLo, xmmMaskHi, &xmmMaskLo, &xmmMaskHi);
+
+ inOver_2x128 (xmmSrcLo, xmmSrcHi, Mask00ff, Mask00ff, xmmMaskLo, xmmMaskHi, &xmmDstLo, &xmmDstHi);
+
+ save128Aligned( (__m128i*)dst, pack_2x128_128 (xmmDstLo, xmmDstHi));
+ }
+
+ src += 4;
+ dst += 4;
+ mask += 4;
+ w -= 4;
+ }
+
+ while (w)
+ {
+ m = (uint32_t) *mask++;
+
+ if (m)
+ {
+ s = 0xff000000 | *src;
+
+ if (m == 0xff)
+ {
+ *dst = s;
+ }
+ else
+ {
+ d = *dst;
+
+ *dst = pack_1x64_32 (inOver_1x64 (unpack_32_1x64 (s),
+ xMask00ff,
+ expandAlphaRev_1x64 (unpack_32_1x64 (m)),
+ unpack_32_1x64 (d)));
+ }
+
+ }
+
+ src++;
+ dst++;
+ w--;
+ }
+ }
+
+ _mm_empty();
+}
+#endif /* #if 0 */
+
+#endif /* USE_SSE2 */
diff --git a/lib/pixman/pixman/pixman-sse2.h b/lib/pixman/pixman/pixman-sse2.h
new file mode 100644
index 000000000..2bcbf971b
--- /dev/null
+++ b/lib/pixman/pixman/pixman-sse2.h
@@ -0,0 +1,358 @@
+/*
+ * Copyright © 2008 Rodrigo Kumpera
+ * Copyright © 2008 André Tupinambá
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Red Hat makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * Author: Rodrigo Kumpera (kumpera@gmail.com)
+ * André Tupinambá (andrelrt@gmail.com)
+ *
+ * Based on work by Owen Taylor and Søren Sandmann
+ */
+#ifndef _PIXMAN_SSE_H_
+#define _PIXMAN_SSE_H_
+
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
+#include "pixman-private.h"
+
+#ifdef USE_SSE2
+
+#if !defined(__amd64__) && !defined(__x86_64__)
+pixman_bool_t pixman_have_sse2(void);
+#else
+#define pixman_have_sse2() TRUE
+#endif
+
+#else
+#define pixman_have_sse2() FALSE
+#endif
+
+#ifdef USE_SSE2
+
+void fbComposeSetupSSE2(void);
+
+pixman_bool_t
+pixmanFillsse2 (uint32_t *bits,
+ int stride,
+ int bpp,
+ int x,
+ int y,
+ int width,
+ int height,
+ uint32_t data);
+
+pixman_bool_t
+pixmanBltsse2 (uint32_t *src_bits,
+ uint32_t *dst_bits,
+ int src_stride,
+ int dst_stride,
+ int src_bpp,
+ int dst_bpp,
+ int src_x, int src_y,
+ int dst_x, int dst_y,
+ int width, int height);
+
+void
+fbCompositeSolid_nx8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSolid_nx0565sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSolidMask_nx8888x8888Csse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSrc_8888x8x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSrc_x888xnx8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSrc_8888x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSrc_8888x0565sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSolidMask_nx8x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSolidMaskSrc_nx8x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSolidMask_nx8x0565sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSrc_8888RevNPx0565sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSrc_8888RevNPx8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSolidMask_nx8888x0565Csse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeIn_nx8x8sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeIn_8x8sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSrcAdd_8888x8x8sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+
+void
+fbCompositeSrcAdd_8000x8000sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeSrcAdd_8888x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeCopyAreasse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+void
+fbCompositeOver_x888x8x8888sse2 (pixman_op_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+
+#endif /* USE_SSE2 */
+
+#endif /* _PIXMAN_SSE_H_ */
diff --git a/lib/pixman/pixman/pixman-transformed.c b/lib/pixman/pixman/pixman-transformed.c
index 19085ca87..5ad92ae9f 100644
--- a/lib/pixman/pixman/pixman-transformed.c
+++ b/lib/pixman/pixman/pixman-transformed.c
@@ -2,6 +2,7 @@
*
* Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
* 2005 Lars Knoll & Zack Rusin, Trolltech
+ * 2008 Aaron Plattner, NVIDIA Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -31,52 +32,41 @@
#include "pixman-private.h"
-#ifdef PIXMAN_FB_ACCESSORS
-#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture_accessors
-#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture_accessors
-#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture_accessors
+#define Alpha(x) ((x) >> 24)
+#define Red(x) (((x) >> 16) & 0xff)
+#define Green(x) (((x) >> 8) & 0xff)
+#define Blue(x) ((x) & 0xff)
-#define FB_FETCH_TRANSFORMED fbFetchTransformed_accessors
-#define FB_FETCH_EXTERNAL_ALPHA fbFetchExternalAlpha_accessors
-#define FB_STORE_EXTERNAL_ALPHA fbStoreExternalAlpha_accessors
-
-#else
-
-#define FETCH_PROC_FOR_PICTURE pixman_fetchProcForPicture
-#define FETCH_PIXEL_PROC_FOR_PICTURE pixman_fetchPixelProcForPicture
-#define STORE_PROC_FOR_PICTURE pixman_storeProcForPicture
-
-#define FB_FETCH_TRANSFORMED fbFetchTransformed
-#define FB_FETCH_EXTERNAL_ALPHA fbFetchExternalAlpha
-#define FB_STORE_EXTERNAL_ALPHA fbStoreExternalAlpha
-
-#endif
+#define Alpha64(x) ((x) >> 48)
+#define Red64(x) (((x) >> 32) & 0xffff)
+#define Green64(x) (((x) >> 16) & 0xffff)
+#define Blue64(x) ((x) & 0xffff)
/*
* Fetch from region strategies
*/
-typedef FASTCALL uint32_t (*fetchFromRegionProc)(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box);
+typedef FASTCALL uint32_t (*fetchFromRegionProc)(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc32 fetch, pixman_box32_t *box);
static inline uint32_t
-fbFetchFromNoRegion(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box)
+fbFetchFromNoRegion(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc32 fetch, pixman_box32_t *box)
{
return fetch (pict, x, y);
}
static uint32_t
-fbFetchFromNRectangles(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box)
+fbFetchFromNRectangles(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc32 fetch, pixman_box32_t *box)
{
- pixman_box16_t box2;
- if (pixman_region_contains_point (pict->common.src_clip, x, y, &box2))
+ pixman_box32_t box2;
+ if (pixman_region32_contains_point (pict->common.src_clip, x, y, &box2))
return fbFetchFromNoRegion(pict, x, y, buffer, fetch, box);
else
return 0;
}
static uint32_t
-fbFetchFromOneRectangle(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box)
+fbFetchFromOneRectangle(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc32 fetch, pixman_box32_t *box)
{
- pixman_box16_t box2 = *box;
+ pixman_box32_t box2 = *box;
return ((x < box2.x1) | (x >= box2.x2) | (y < box2.y1) | (y >= box2.y2)) ?
0 : fbFetchFromNoRegion(pict, x, y, buffer, fetch, box);
}
@@ -87,15 +77,15 @@ fbFetchFromOneRectangle(bits_image_t *pict, int x, int y, uint32_t *buffer, fetc
static void
fbFetchTransformed_Nearest_Normal(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
{
- pixman_box16_t* box = NULL;
- fetchPixelProc fetch;
+ pixman_box32_t* box = NULL;
+ fetchPixelProc32 fetch;
fetchFromRegionProc fetchFromRegion;
int x, y, i;
/* initialize the two function pointers */
- fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict);
+ fetch = ACCESS(pixman_fetchPixelProcForPicture32)(pict);
- if(pixman_region_n_rects (pict->common.src_clip) == 1)
+ if(pixman_region32_n_rects (pict->common.src_clip) == 1)
fetchFromRegion = fbFetchFromNoRegion;
else
fetchFromRegion = fbFetchFromNRectangles;
@@ -133,15 +123,15 @@ fbFetchTransformed_Nearest_Normal(bits_image_t * pict, int width, uint32_t *buff
static void
fbFetchTransformed_Nearest_Pad(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
{
- pixman_box16_t *box = NULL;
- fetchPixelProc fetch;
+ pixman_box32_t *box = NULL;
+ fetchPixelProc32 fetch;
fetchFromRegionProc fetchFromRegion;
int x, y, i;
/* initialize the two function pointers */
- fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict);
+ fetch = ACCESS(pixman_fetchPixelProcForPicture32)(pict);
- if(pixman_region_n_rects (pict->common.src_clip) == 1)
+ if(pixman_region32_n_rects (pict->common.src_clip) == 1)
fetchFromRegion = fbFetchFromNoRegion;
else
fetchFromRegion = fbFetchFromNRectangles;
@@ -180,15 +170,15 @@ fbFetchTransformed_Nearest_Pad(bits_image_t * pict, int width, uint32_t *buffer,
static void
fbFetchTransformed_Nearest_General(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
{
- pixman_box16_t *box = NULL;
- fetchPixelProc fetch;
+ pixman_box32_t *box = NULL;
+ fetchPixelProc32 fetch;
fetchFromRegionProc fetchFromRegion;
int x, y, i;
/* initialize the two function pointers */
- fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict);
+ fetch = ACCESS(pixman_fetchPixelProcForPicture32)(pict);
- if(pixman_region_n_rects (pict->common.src_clip) == 1)
+ if(pixman_region32_n_rects (pict->common.src_clip) == 1)
{
box = &(pict->common.src_clip->extents);
fetchFromRegion = fbFetchFromOneRectangle;
@@ -223,15 +213,15 @@ fbFetchTransformed_Nearest_General(bits_image_t * pict, int width, uint32_t *buf
static void
fbFetchTransformed_Bilinear_Normal(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
{
- pixman_box16_t *box = NULL;
- fetchPixelProc fetch;
+ pixman_box32_t *box = NULL;
+ fetchPixelProc32 fetch;
fetchFromRegionProc fetchFromRegion;
int i;
/* initialize the two function pointers */
- fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict);
+ fetch = ACCESS(pixman_fetchPixelProcForPicture32)(pict);
- if(pixman_region_n_rects (pict->common.src_clip) == 1)
+ if(pixman_region32_n_rects (pict->common.src_clip) == 1)
fetchFromRegion = fbFetchFromNoRegion;
else
fetchFromRegion = fbFetchFromNRectangles;
@@ -300,15 +290,15 @@ fbFetchTransformed_Bilinear_Normal(bits_image_t * pict, int width, uint32_t *buf
static void
fbFetchTransformed_Bilinear_Pad(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
{
- pixman_box16_t *box = NULL;
- fetchPixelProc fetch;
+ pixman_box32_t *box = NULL;
+ fetchPixelProc32 fetch;
fetchFromRegionProc fetchFromRegion;
int i;
/* initialize the two function pointers */
- fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict);
+ fetch = ACCESS(pixman_fetchPixelProcForPicture32)(pict);
- if(pixman_region_n_rects (pict->common.src_clip) == 1)
+ if(pixman_region32_n_rects (pict->common.src_clip) == 1)
fetchFromRegion = fbFetchFromNoRegion;
else
fetchFromRegion = fbFetchFromNRectangles;
@@ -377,15 +367,15 @@ fbFetchTransformed_Bilinear_Pad(bits_image_t * pict, int width, uint32_t *buffer
static void
fbFetchTransformed_Bilinear_General(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
{
- pixman_box16_t *box = NULL;
- fetchPixelProc fetch;
+ pixman_box32_t *box = NULL;
+ fetchPixelProc32 fetch;
fetchFromRegionProc fetchFromRegion;
int i;
/* initialize the two function pointers */
- fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict);
+ fetch = ACCESS(pixman_fetchPixelProcForPicture32)(pict);
- if(pixman_region_n_rects (pict->common.src_clip) == 1)
+ if(pixman_region32_n_rects (pict->common.src_clip) == 1)
{
box = &(pict->common.src_clip->extents);
fetchFromRegion = fbFetchFromOneRectangle;
@@ -456,8 +446,8 @@ fbFetchTransformed_Bilinear_General(bits_image_t * pict, int width, uint32_t *bu
static void
fbFetchTransformed_Convolution(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
{
- pixman_box16_t dummy;
- fetchPixelProc fetch;
+ pixman_box32_t dummy;
+ fetchPixelProc32 fetch;
int i;
pixman_fixed_t *params = pict->common.filter_params;
@@ -465,7 +455,7 @@ fbFetchTransformed_Convolution(bits_image_t * pict, int width, uint32_t *buffer,
int32_t cheight = pixman_fixed_to_int(params[1]);
int xoff = (params[0] - pixman_fixed_1) >> 1;
int yoff = (params[1] - pixman_fixed_1) >> 1;
- fetch = FETCH_PIXEL_PROC_FOR_PICTURE(pict);
+ fetch = ACCESS(pixman_fetchPixelProcForPicture32)(pict);
params += 2;
for (i = 0; i < width; ++i) {
@@ -518,7 +508,7 @@ fbFetchTransformed_Convolution(bits_image_t * pict, int width, uint32_t *buffer,
default:
tx = x;
}
- if (pixman_region_contains_point (pict->common.src_clip, tx, ty, &dummy)) {
+ if (pixman_region32_contains_point (pict->common.src_clip, tx, ty, &dummy)) {
uint32_t c = fetch(pict, tx, ty);
srtot += Red(c) * *p;
@@ -567,7 +557,8 @@ adjust (pixman_vector_t *v, pixman_vector_t *u, pixman_fixed_t adjustment)
}
void
-FB_FETCH_TRANSFORMED(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
+ACCESS(fbFetchTransformed)(bits_image_t * pict, int x, int y, int width,
+ uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
{
uint32_t *bits;
int32_t stride;
@@ -602,7 +593,7 @@ FB_FETCH_TRANSFORMED(bits_image_t * pict, int x, int y, int width, uint32_t *buf
/* This allows filtering code to pretend that pixels are located at integer coordinates */
adjust (&v, &unit, -(pixman_fixed_1 / 2));
-
+
if (pict->common.filter == PIXMAN_FILTER_NEAREST || pict->common.filter == PIXMAN_FILTER_FAST)
{
/* Round down to closest integer, ensuring that 0.5 rounds to 0, not 1 */
@@ -611,7 +602,6 @@ FB_FETCH_TRANSFORMED(bits_image_t * pict, int x, int y, int width, uint32_t *buf
if (pict->common.repeat == PIXMAN_REPEAT_NORMAL)
{
fbFetchTransformed_Nearest_Normal(pict, width, buffer, mask, maskBits, affine, v, unit);
-
}
else if (pict->common.repeat == PIXMAN_REPEAT_PAD)
{
@@ -647,27 +637,52 @@ FB_FETCH_TRANSFORMED(bits_image_t * pict, int x, int y, int width, uint32_t *buf
}
}
+void
+ACCESS(fbFetchTransformed64)(bits_image_t * pict, int x, int y, int width,
+ uint64_t *buffer, uint64_t *mask, uint32_t maskBits)
+{
+ // TODO: Don't lose precision for wide pictures!
+ uint32_t *mask8 = NULL;
+
+ // Contract the mask image, if one exists, so that the 32-bit fetch function
+ // can use it.
+ if (mask) {
+ mask8 = pixman_malloc_ab(width, sizeof(uint32_t));
+ pixman_contract(mask8, mask, width);
+ }
+
+ // Fetch the image into the first half of buffer.
+ ACCESS(fbFetchTransformed)(pict, x, y, width, (uint32_t*)buffer, mask8,
+ maskBits);
+
+ // Expand from 32bpp to 64bpp in place.
+ pixman_expand(buffer, (uint32_t*)buffer, PIXMAN_a8r8g8b8, width);
+
+ free(mask8);
+}
+
#define SCANLINE_BUFFER_LENGTH 2048
void
-FB_FETCH_EXTERNAL_ALPHA(bits_image_t * pict, int x, int y, int width,
- uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
+ACCESS(fbFetchExternalAlpha)(bits_image_t * pict, int x, int y, int width,
+ uint32_t *buffer, uint32_t *mask,
+ uint32_t maskBits)
{
int i;
uint32_t _alpha_buffer[SCANLINE_BUFFER_LENGTH];
uint32_t *alpha_buffer = _alpha_buffer;
if (!pict->common.alpha_map) {
- FB_FETCH_TRANSFORMED (pict, x, y, width, buffer, mask, maskBits);
+ ACCESS(fbFetchTransformed) (pict, x, y, width, buffer, mask, maskBits);
return;
}
if (width > SCANLINE_BUFFER_LENGTH)
alpha_buffer = (uint32_t *) pixman_malloc_ab (width, sizeof(uint32_t));
- FB_FETCH_TRANSFORMED(pict, x, y, width, buffer, mask, maskBits);
- FB_FETCH_TRANSFORMED((bits_image_t *)pict->common.alpha_map, x - pict->common.alpha_origin.x,
- y - pict->common.alpha_origin.y, width, alpha_buffer,
- mask, maskBits);
+ ACCESS(fbFetchTransformed)(pict, x, y, width, buffer, mask, maskBits);
+ ACCESS(fbFetchTransformed)((bits_image_t *)pict->common.alpha_map, x - pict->common.alpha_origin.x,
+ y - pict->common.alpha_origin.y, width,
+ alpha_buffer, mask, maskBits);
for (i = 0; i < width; ++i) {
if (!mask || mask[i] & maskBits)
{
@@ -684,14 +699,53 @@ FB_FETCH_EXTERNAL_ALPHA(bits_image_t * pict, int x, int y, int width,
}
void
-FB_STORE_EXTERNAL_ALPHA(bits_image_t * pict, int x, int y, int width,
- uint32_t *buffer)
+ACCESS(fbFetchExternalAlpha64)(bits_image_t * pict, int x, int y, int width,
+ uint64_t *buffer, uint64_t *mask,
+ uint32_t maskBits)
+{
+ int i;
+ uint64_t _alpha_buffer[SCANLINE_BUFFER_LENGTH];
+ uint64_t *alpha_buffer = _alpha_buffer;
+ uint64_t maskBits64;
+
+ if (!pict->common.alpha_map) {
+ ACCESS(fbFetchTransformed64) (pict, x, y, width, buffer, mask, maskBits);
+ return;
+ }
+ if (width > SCANLINE_BUFFER_LENGTH)
+ alpha_buffer = (uint64_t *) pixman_malloc_ab (width, sizeof(uint64_t));
+
+ ACCESS(fbFetchTransformed64)(pict, x, y, width, buffer, mask, maskBits);
+ ACCESS(fbFetchTransformed64)((bits_image_t *)pict->common.alpha_map, x - pict->common.alpha_origin.x,
+ y - pict->common.alpha_origin.y, width,
+ alpha_buffer, mask, maskBits);
+
+ pixman_expand(&maskBits64, &maskBits, PIXMAN_a8r8g8b8, 1);
+
+ for (i = 0; i < width; ++i) {
+ if (!mask || mask[i] & maskBits64)
+ {
+ int64_t a = alpha_buffer[i]>>48;
+ *(buffer + i) = (a << 48)
+ | (div_65535(Red64(*(buffer + i)) * a) << 32)
+ | (div_65535(Green64(*(buffer + i)) * a) << 16)
+ | (div_65535(Blue64(*(buffer + i)) * a));
+ }
+ }
+
+ if (alpha_buffer != _alpha_buffer)
+ free(alpha_buffer);
+}
+
+void
+ACCESS(fbStoreExternalAlpha)(bits_image_t * pict, int x, int y, int width,
+ uint32_t *buffer)
{
uint32_t *bits, *alpha_bits;
int32_t stride, astride;
int ax, ay;
- storeProc store;
- storeProc astore;
+ storeProc32 store;
+ storeProc32 astore;
const pixman_indexed_t * indexed = pict->indexed;
const pixman_indexed_t * aindexed;
@@ -702,8 +756,8 @@ FB_STORE_EXTERNAL_ALPHA(bits_image_t * pict, int x, int y, int width,
return;
}
- store = STORE_PROC_FOR_PICTURE(pict);
- astore = STORE_PROC_FOR_PICTURE(pict->common.alpha_map);
+ store = ACCESS(pixman_storeProcForPicture32)(pict);
+ astore = ACCESS(pixman_storeProcForPicture32)(pict->common.alpha_map);
aindexed = pict->common.alpha_map->indexed;
ax = x;
@@ -724,3 +778,36 @@ FB_STORE_EXTERNAL_ALPHA(bits_image_t * pict, int x, int y, int width,
alpha_bits, buffer, ax - pict->common.alpha_origin.x, width, aindexed);
}
+void
+ACCESS(fbStoreExternalAlpha64)(bits_image_t * pict, int x, int y, int width,
+ uint64_t *buffer)
+{
+ uint32_t *bits, *alpha_bits;
+ int32_t stride, astride;
+ int ax, ay;
+ storeProc64 store;
+ storeProc64 astore;
+ const pixman_indexed_t * indexed = pict->indexed;
+ const pixman_indexed_t * aindexed;
+
+ store = ACCESS(pixman_storeProcForPicture64)(pict);
+ astore = ACCESS(pixman_storeProcForPicture64)(pict->common.alpha_map);
+ aindexed = pict->common.alpha_map->indexed;
+
+ ax = x;
+ ay = y;
+
+ bits = pict->bits;
+ stride = pict->rowstride;
+
+ alpha_bits = pict->common.alpha_map->bits;
+ astride = pict->common.alpha_map->rowstride;
+
+ bits += y*stride;
+ alpha_bits += (ay - pict->common.alpha_origin.y)*astride;
+
+
+ store((pixman_image_t *)pict, bits, buffer, x, width, indexed);
+ astore((pixman_image_t *)pict->common.alpha_map,
+ alpha_bits, buffer, ax - pict->common.alpha_origin.x, width, aindexed);
+}
diff --git a/lib/pixman/pixman/pixman-trap.c b/lib/pixman/pixman/pixman-trap.c
index 0dca6ccf0..28dacafcc 100644
--- a/lib/pixman/pixman/pixman-trap.c
+++ b/lib/pixman/pixman/pixman-trap.c
@@ -29,7 +29,7 @@
typedef uint32_t FbBits;
-void
+PIXMAN_EXPORT void
pixman_add_traps (pixman_image_t * image,
int16_t x_off,
int16_t y_off,
@@ -115,12 +115,12 @@ dump_image (pixman_image_t *image,
}
}
-void
-pixman_add_trapezoids (pixman_image_t *image,
- int16_t x_off,
- int y_off,
- int ntraps,
- const pixman_trapezoid_t *traps)
+PIXMAN_EXPORT void
+pixman_add_trapezoids (pixman_image_t *image,
+ int16_t x_off,
+ int y_off,
+ int ntraps,
+ const pixman_trapezoid_t *traps)
{
int i;
@@ -143,7 +143,7 @@ pixman_add_trapezoids (pixman_image_t *image,
#endif
}
-void
+PIXMAN_EXPORT void
pixman_rasterize_trapezoid (pixman_image_t * image,
const pixman_trapezoid_t *trap,
int x_off,
diff --git a/lib/pixman/pixman/pixman-utils.c b/lib/pixman/pixman/pixman-utils.c
index b100d096c..21d9a2fd2 100644
--- a/lib/pixman/pixman/pixman-utils.c
+++ b/lib/pixman/pixman/pixman-utils.c
@@ -30,7 +30,7 @@
#include "pixman-private.h"
#include "pixman-mmx.h"
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
pixman_transform_point_3d (pixman_transform_t *transform,
pixman_vector_t *vector)
{
@@ -62,7 +62,7 @@ pixman_transform_point_3d (pixman_transform_t *transform,
return TRUE;
}
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
pixman_blt (uint32_t *src_bits,
uint32_t *dst_bits,
int src_stride,
@@ -156,7 +156,7 @@ pixman_fill32 (uint32_t *bits,
}
}
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
pixman_fill (uint32_t *bits,
int stride,
int bpp,
@@ -204,7 +204,7 @@ pixman_fill (uint32_t *bits,
* grid row
*/
-pixman_fixed_t
+PIXMAN_EXPORT pixman_fixed_t
pixman_sample_ceil_y (pixman_fixed_t y, int n)
{
pixman_fixed_t f = pixman_fixed_frac(y);
@@ -225,7 +225,7 @@ pixman_sample_ceil_y (pixman_fixed_t y, int n)
* Compute the largest value no greater than y which is on a
* grid row
*/
-pixman_fixed_t
+PIXMAN_EXPORT pixman_fixed_t
pixman_sample_floor_y (pixman_fixed_t y, int n)
{
pixman_fixed_t f = pixman_fixed_frac(y);
@@ -243,7 +243,7 @@ pixman_sample_floor_y (pixman_fixed_t y, int n)
/*
* Step an edge by any amount (including negative values)
*/
-void
+PIXMAN_EXPORT void
pixman_edge_step (pixman_edge_t *e, int n)
{
pixman_fixed_48_16_t ne;
@@ -298,7 +298,7 @@ _pixman_edge_tMultiInit (pixman_edge_t *e, int n, pixman_fixed_t *stepx_p, pixma
* Initialize one edge structure given the line endpoints and a
* starting y value
*/
-void
+PIXMAN_EXPORT void
pixman_edge_init (pixman_edge_t *e,
int n,
pixman_fixed_t y_start,
@@ -342,7 +342,7 @@ pixman_edge_init (pixman_edge_t *e,
* Initialize one edge structure given a line, starting y value
* and a pixel offset for the line
*/
-void
+PIXMAN_EXPORT void
pixman_line_fixed_edge_init (pixman_edge_t *e,
int n,
pixman_fixed_t y,
@@ -428,7 +428,7 @@ pixman_malloc_abc (unsigned int a,
*
* Return value: the encoded version.
**/
-int
+PIXMAN_EXPORT int
pixman_version (void)
{
return PIXMAN_VERSION;
@@ -445,7 +445,7 @@ pixman_version (void)
*
* Return value: a string containing the version.
**/
-const char*
+PIXMAN_EXPORT const char*
pixman_version_string (void)
{
return PIXMAN_VERSION_STRING;
@@ -462,11 +462,13 @@ pixman_version_string (void)
* Currently, all pixman_format_code_t values are supported
* except for the YUV formats.
**/
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
pixman_format_supported_destination (pixman_format_code_t format)
{
switch (format) {
/* 32 bpp formats */
+ case PIXMAN_a2b10g10r10:
+ case PIXMAN_x2b10g10r10:
case PIXMAN_a8r8g8b8:
case PIXMAN_x8r8g8b8:
case PIXMAN_a8b8g8r8:
@@ -530,11 +532,13 @@ pixman_format_supported_destination (pixman_format_code_t format)
*
* Currently, all pixman_format_code_t values are supported.
**/
-pixman_bool_t
+PIXMAN_EXPORT pixman_bool_t
pixman_format_supported_source (pixman_format_code_t format)
{
switch (format) {
/* 32 bpp formats */
+ case PIXMAN_a2b10g10r10:
+ case PIXMAN_x2b10g10r10:
case PIXMAN_a8r8g8b8:
case PIXMAN_x8r8g8b8:
case PIXMAN_a8b8g8r8:
diff --git a/lib/pixman/pixman/pixman-version.h b/lib/pixman/pixman/pixman-version.h
deleted file mode 100644
index a57031484..000000000
--- a/lib/pixman/pixman/pixman-version.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright © 2008 Red Hat, Inc.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Author: Carl D. Worth <cworth@cworth.org>
- */
-
-#ifndef PIXMAN_VERSION_H__
-#define PIXMAN_VERSION_H__
-
-#ifndef PIXMAN_H__
-# error pixman-version.h should only be included by pixman.h
-#endif
-
-#define PIXMAN_VERSION_MAJOR 0
-#define PIXMAN_VERSION_MINOR 10
-#define PIXMAN_VERSION_MICRO 0
-
-#define PIXMAN_VERSION_STRING "0.10.0"
-
-#define PIXMAN_VERSION_ENCODE(major, minor, micro) ( \
- ((major) * 10000) \
- + ((minor) * 100) \
- + ((micro) * 1))
-
-#define PIXMAN_VERSION PIXMAN_VERSION_ENCODE( \
- PIXMAN_VERSION_MAJOR, \
- PIXMAN_VERSION_MINOR, \
- PIXMAN_VERSION_MICRO)
-
-#endif /* PIXMAN_VERSION_H__ */
diff --git a/lib/pixman/pixman/pixman-vmx.c b/lib/pixman/pixman/pixman-vmx.c
new file mode 100644
index 000000000..8c8a2a364
--- /dev/null
+++ b/lib/pixman/pixman/pixman-vmx.c
@@ -0,0 +1,1068 @@
+/*
+ * Copyright © 2007 Luca Barbato
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Luca Barbato not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Luca Barbato makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * Author: Luca Barbato (lu_zero@gentoo.org)
+ *
+ * Based on fbmmx.c by Owen Taylor, Søren Sandmann and Nicholas Miell
+ */
+
+#include <config.h>
+#include "pixman-vmx.h"
+#include "pixman-combine32.h"
+#include <altivec.h>
+
+#ifdef __GNUC__
+# define inline __inline__ __attribute__ ((__always_inline__))
+#endif
+
+static inline vector unsigned int
+splat_alpha (vector unsigned int pix) {
+ return vec_perm (pix, pix,
+ (vector unsigned char)AVV(0x00,0x00,0x00,0x00, 0x04,0x04,0x04,0x04,
+ 0x08,0x08,0x08,0x08, 0x0C,0x0C,0x0C,0x0C));
+}
+
+static inline vector unsigned int
+pix_multiply (vector unsigned int p, vector unsigned int a)
+{
+ vector unsigned short hi, lo, mod;
+ /* unpack to short */
+ hi = (vector unsigned short)
+ vec_mergeh ((vector unsigned char)AVV(0),
+ (vector unsigned char)p);
+ mod = (vector unsigned short)
+ vec_mergeh ((vector unsigned char)AVV(0),
+ (vector unsigned char)a);
+
+ hi = vec_mladd (hi, mod, (vector unsigned short)
+ AVV(0x0080,0x0080,0x0080,0x0080,
+ 0x0080,0x0080,0x0080,0x0080));
+
+ hi = vec_adds (hi, vec_sr (hi, vec_splat_u16 (8)));
+
+ hi = vec_sr (hi, vec_splat_u16 (8));
+
+ /* unpack to short */
+ lo = (vector unsigned short)
+ vec_mergel ((vector unsigned char)AVV(0),
+ (vector unsigned char)p);
+ mod = (vector unsigned short)
+ vec_mergel ((vector unsigned char)AVV(0),
+ (vector unsigned char)a);
+
+ lo = vec_mladd (lo, mod, (vector unsigned short)
+ AVV(0x0080,0x0080,0x0080,0x0080,
+ 0x0080,0x0080,0x0080,0x0080));
+
+ lo = vec_adds (lo, vec_sr (lo, vec_splat_u16 (8)));
+
+ lo = vec_sr (lo, vec_splat_u16 (8));
+
+ return (vector unsigned int)vec_packsu (hi, lo);
+}
+
+static inline vector unsigned int
+pix_add (vector unsigned int a, vector unsigned int b)
+{
+ return (vector unsigned int)vec_adds ((vector unsigned char)a,
+ (vector unsigned char)b);
+}
+
+static inline vector unsigned int
+pix_add_mul (vector unsigned int x, vector unsigned int a,
+ vector unsigned int y, vector unsigned int b)
+{
+ vector unsigned short hi, lo, mod, hiy, loy, mody;
+
+ hi = (vector unsigned short)
+ vec_mergeh ((vector unsigned char)AVV(0),
+ (vector unsigned char)x);
+ mod = (vector unsigned short)
+ vec_mergeh ((vector unsigned char)AVV(0),
+ (vector unsigned char)a);
+ hiy = (vector unsigned short)
+ vec_mergeh ((vector unsigned char)AVV(0),
+ (vector unsigned char)y);
+ mody = (vector unsigned short)
+ vec_mergeh ((vector unsigned char)AVV(0),
+ (vector unsigned char)b);
+
+ hi = vec_mladd (hi, mod, (vector unsigned short)
+ AVV(0x0080,0x0080,0x0080,0x0080,
+ 0x0080,0x0080,0x0080,0x0080));
+
+ hi = vec_mladd (hiy, mody, hi);
+
+ hi = vec_adds (hi, vec_sr (hi, vec_splat_u16 (8)));
+
+ hi = vec_sr (hi, vec_splat_u16 (8));
+
+ lo = (vector unsigned short)
+ vec_mergel ((vector unsigned char)AVV(0),
+ (vector unsigned char)x);
+ mod = (vector unsigned short)
+ vec_mergel ((vector unsigned char)AVV(0),
+ (vector unsigned char)a);
+
+ loy = (vector unsigned short)
+ vec_mergel ((vector unsigned char)AVV(0),
+ (vector unsigned char)y);
+ mody = (vector unsigned short)
+ vec_mergel ((vector unsigned char)AVV(0),
+ (vector unsigned char)b);
+
+ lo = vec_mladd (lo, mod, (vector unsigned short)
+ AVV(0x0080,0x0080,0x0080,0x0080,
+ 0x0080,0x0080,0x0080,0x0080));
+
+ lo = vec_mladd (loy, mody, lo);
+
+ lo = vec_adds (lo, vec_sr (lo, vec_splat_u16 (8)));
+
+ lo = vec_sr (lo, vec_splat_u16 (8));
+
+ return (vector unsigned int)vec_packsu (hi, lo);
+}
+
+static inline vector unsigned int
+negate (vector unsigned int src)
+{
+ return vec_nor (src, src);
+}
+/* dest*~srca + src */
+static inline vector unsigned int
+over (vector unsigned int src, vector unsigned int srca,
+ vector unsigned int dest)
+{
+ vector unsigned char tmp = (vector unsigned char)
+ pix_multiply (dest, negate (srca));
+ tmp = vec_adds ((vector unsigned char)src, tmp);
+ return (vector unsigned int)tmp;
+}
+
+/* in == pix_multiply */
+#define in_over(src, srca, mask, dest) over (pix_multiply (src, mask),\
+ pix_multiply (srca, mask), dest)
+
+
+#define COMPUTE_SHIFT_MASK(source) \
+ source ## _mask = vec_lvsl (0, source);
+
+#define COMPUTE_SHIFT_MASKS(dest, source) \
+ dest ## _mask = vec_lvsl (0, dest); \
+ source ## _mask = vec_lvsl (0, source); \
+ store_mask = vec_lvsr (0, dest);
+
+#define COMPUTE_SHIFT_MASKC(dest, source, mask) \
+ mask ## _mask = vec_lvsl (0, mask); \
+ dest ## _mask = vec_lvsl (0, dest); \
+ source ## _mask = vec_lvsl (0, source); \
+ store_mask = vec_lvsr (0, dest);
+
+/* notice you have to declare temp vars...
+ * Note: tmp3 and tmp4 must remain untouched!
+ */
+
+#define LOAD_VECTORS(dest, source) \
+ tmp1 = (typeof(tmp1))vec_ld(0, source); \
+ tmp2 = (typeof(tmp2))vec_ld(15, source); \
+ tmp3 = (typeof(tmp3))vec_ld(0, dest); \
+ v ## source = (typeof(v ## source)) \
+ vec_perm(tmp1, tmp2, source ## _mask); \
+ tmp4 = (typeof(tmp4))vec_ld(15, dest); \
+ v ## dest = (typeof(v ## dest)) \
+ vec_perm(tmp3, tmp4, dest ## _mask);
+
+#define LOAD_VECTORSC(dest, source, mask) \
+ tmp1 = (typeof(tmp1))vec_ld(0, source); \
+ tmp2 = (typeof(tmp2))vec_ld(15, source); \
+ tmp3 = (typeof(tmp3))vec_ld(0, dest); \
+ v ## source = (typeof(v ## source)) \
+ vec_perm(tmp1, tmp2, source ## _mask); \
+ tmp4 = (typeof(tmp4))vec_ld(15, dest); \
+ tmp1 = (typeof(tmp1))vec_ld(0, mask); \
+ v ## dest = (typeof(v ## dest)) \
+ vec_perm(tmp3, tmp4, dest ## _mask); \
+ tmp2 = (typeof(tmp2))vec_ld(15, mask); \
+ v ## mask = (typeof(v ## mask)) \
+ vec_perm(tmp1, tmp2, mask ## _mask);
+#define STORE_VECTOR(dest) \
+ edges = vec_perm (tmp4, tmp3, dest ## _mask); \
+ tmp3 = vec_perm ((vector unsigned char)v ## dest, edges, store_mask); \
+ tmp1 = vec_perm (edges, (vector unsigned char)v ## dest, store_mask); \
+ vec_st ((vector unsigned int) tmp3, 15, dest ); \
+ vec_st ((vector unsigned int) tmp1, 0, dest );
+
+static FASTCALL void
+vmxCombineMaskU (uint32_t *src, const uint32_t *msk, int width)
+{
+ int i;
+ vector unsigned int vsrc, vmsk;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ src_mask, msk_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(src, msk)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(src, msk)
+
+ vsrc = pix_multiply (vsrc, splat_alpha (vmsk));
+
+ STORE_VECTOR(src)
+
+ msk+=4;
+ src+=4;
+ }
+
+ for (i = width%4; --i >= 0;) {
+ uint32_t a = msk[i] >> 24;
+ uint32_t s = src[i];
+ FbByteMul (s, a);
+ src[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineOverU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(dest, src)
+
+ vdest = over (vsrc, splat_alpha (vsrc), vdest);
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t ia = Alpha (~s);
+
+ FbByteMulAdd (d, ia, s);
+ dest[i] = d;
+ }
+}
+
+
+static FASTCALL void
+vmxCombineOverReverseU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(dest, src)
+
+ vdest = over (vdest, splat_alpha (vdest) , vsrc);
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t ia = Alpha (~dest[i]);
+
+ FbByteMulAdd (s, ia, d);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineInU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(dest, src)
+
+ vdest = pix_multiply (vsrc, splat_alpha (vdest));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+
+ uint32_t s = src[i];
+ uint32_t a = Alpha (dest[i]);
+ FbByteMul (s, a);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineInReverseU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(dest, src)
+
+ vdest = pix_multiply (vdest, splat_alpha (vsrc));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t d = dest[i];
+ uint32_t a = Alpha (src[i]);
+ FbByteMul (d, a);
+ dest[i] = d;
+ }
+}
+
+static FASTCALL void
+vmxCombineOutU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(dest, src)
+
+ vdest = pix_multiply (vsrc, splat_alpha (negate (vdest)));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t s = src[i];
+ uint32_t a = Alpha (~dest[i]);
+ FbByteMul (s, a);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineOutReverseU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(dest, src)
+
+ vdest = pix_multiply (vdest, splat_alpha (negate (vsrc)));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t d = dest[i];
+ uint32_t a = Alpha (~src[i]);
+ FbByteMul (d, a);
+ dest[i] = d;
+ }
+}
+
+static FASTCALL void
+vmxCombineAtopU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(dest, src)
+
+ vdest = pix_add_mul (vsrc, splat_alpha (vdest),
+ vdest, splat_alpha (negate (vsrc)));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t dest_a = Alpha (d);
+ uint32_t src_ia = Alpha (~s);
+
+ FbByteAddMul (s, dest_a, d, src_ia);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineAtopReverseU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(dest, src)
+
+ vdest = pix_add_mul (vdest, splat_alpha (vsrc),
+ vsrc, splat_alpha (negate (vdest)));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t src_a = Alpha (s);
+ uint32_t dest_ia = Alpha (~d);
+
+ FbByteAddMul (s, dest_ia, d, src_a);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineXorU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS (dest, src)
+
+ vdest = pix_add_mul (vsrc, splat_alpha (negate (vdest)),
+ vdest, splat_alpha (negate (vsrc)));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t src_ia = Alpha (~s);
+ uint32_t dest_ia = Alpha (~d);
+
+ FbByteAddMul (s, dest_ia, d, src_ia);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineAddU (uint32_t *dest, const uint32_t *src, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKS(dest, src)
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORS(dest, src)
+
+ vdest = pix_add (vsrc, vdest);
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ FbByteAdd (d, s);
+ dest[i] = d;
+ }
+}
+
+static FASTCALL void
+vmxCombineSrcC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask);
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = pix_multiply (vsrc, vmask);
+
+ STORE_VECTOR(dest)
+
+ mask+=4;
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ FbByteMulC (s, a);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineOverC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask);
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = in_over (vsrc, splat_alpha (vsrc), vmask, vdest);
+
+ STORE_VECTOR(dest)
+
+ mask+=4;
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ FbByteMulC (s, a);
+ FbByteMulAddC (d, ~a, s);
+ dest[i] = d;
+ }
+}
+
+static FASTCALL void
+vmxCombineOverReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask);
+ /* printf("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC (dest, src, mask)
+
+ vdest = over (vdest, splat_alpha (vdest), pix_multiply (vsrc, vmask));
+
+ STORE_VECTOR(dest)
+
+ mask+=4;
+ src+=4;
+ dest+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t da = Alpha (d);
+ FbByteMulC (s, a);
+ FbByteMulAddC (s, ~da, d);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineInC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = pix_multiply (pix_multiply (vsrc, vmask), splat_alpha (vdest));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ mask+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ uint32_t da = Alpha (dest[i]);
+ FbByteMul (s, a);
+ FbByteMul (s, da);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineInReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = pix_multiply (vdest, pix_multiply (vmask, splat_alpha (vsrc)));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ mask+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t d = dest[i];
+ uint32_t sa = Alpha (src[i]);
+ FbByteMul (a, sa);
+ FbByteMulC (d, a);
+ dest[i] = d;
+ }
+}
+
+static FASTCALL void
+vmxCombineOutC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = pix_multiply (pix_multiply (vsrc, vmask), splat_alpha (vdest));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ mask+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t da = Alpha (~d);
+ FbByteMulC (s, a);
+ FbByteMulC (s, da);
+ dest[i] = s;
+ }
+}
+
+static FASTCALL void
+vmxCombineOutReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = pix_multiply (vdest,
+ negate (pix_multiply (vmask, splat_alpha (vsrc))));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ mask+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t sa = Alpha (s);
+ FbByteMulC (a, sa);
+ FbByteMulC (d, ~a);
+ dest[i] = d;
+ }
+}
+
+static FASTCALL void
+vmxCombineAtopC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = pix_add_mul (pix_multiply (vsrc, vmask), splat_alpha (vdest),
+ vdest,
+ negate (pix_multiply (vmask,
+ splat_alpha (vmask))));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ mask+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t sa = Alpha (s);
+ uint32_t da = Alpha (d);
+
+ FbByteMulC (s, a);
+ FbByteMul (a, sa);
+ FbByteAddMulC (d, ~a, s, da);
+ dest[i] = d;
+ }
+}
+
+static FASTCALL void
+vmxCombineAtopReverseC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = pix_add_mul (vdest,
+ pix_multiply (vmask, splat_alpha (vsrc)),
+ pix_multiply (vsrc, vmask),
+ negate (splat_alpha (vdest)));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ mask+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t sa = Alpha (s);
+ uint32_t da = Alpha (d);
+
+ FbByteMulC (s, a);
+ FbByteMul (a, sa);
+ FbByteAddMulC (d, a, s, ~da);
+ dest[i] = d;
+ }
+}
+
+static FASTCALL void
+vmxCombineXorC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = pix_add_mul (vdest,
+ negate (pix_multiply (vmask, splat_alpha (vsrc))),
+ pix_multiply (vsrc, vmask),
+ negate (splat_alpha (vdest)));
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ mask+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+ uint32_t sa = Alpha (s);
+ uint32_t da = Alpha (d);
+
+ FbByteMulC (s, a);
+ FbByteMul (a, sa);
+ FbByteAddMulC (d, ~a, s, ~da);
+ dest[i] = d;
+ }
+}
+
+static FASTCALL void
+vmxCombineAddC (uint32_t *dest, uint32_t *src, uint32_t *mask, int width)
+{
+ int i;
+ vector unsigned int vdest, vsrc, vmask;
+ vector unsigned char tmp1, tmp2, tmp3, tmp4, edges,
+ dest_mask, mask_mask, src_mask, store_mask;
+
+ COMPUTE_SHIFT_MASKC(dest, src, mask)
+
+ /* printf ("%s\n",__PRETTY_FUNCTION__); */
+ for (i = width/4; i > 0; i--) {
+
+ LOAD_VECTORSC(dest, src, mask)
+
+ vdest = pix_add (pix_multiply (vsrc, vmask), vdest);
+
+ STORE_VECTOR(dest)
+
+ src+=4;
+ dest+=4;
+ mask+=4;
+ }
+
+ for (i = width%4; --i >=0;) {
+ uint32_t a = mask[i];
+ uint32_t s = src[i];
+ uint32_t d = dest[i];
+
+ FbByteMulC (s, a);
+ FbByteAdd (s, d);
+ dest[i] = s;
+ }
+}
+
+
+#if 0
+void
+fbCompositeSolid_nx8888vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t src;
+ uint32_t *dstLine, *dst;
+ int dstStride;
+
+ fbComposeGetSolid (pSrc, pDst, src);
+
+ if (src >> 24 == 0)
+ return;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint32_t, dstStride, dstLine, 1);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ /* XXX vmxCombineOverU (dst, src, width); */
+ }
+}
+
+void
+fbCompositeSolid_nx0565vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height)
+{
+ uint32_t src;
+ uint16_t *dstLine, *dst;
+ uint16_t w;
+ int dstStride;
+
+ fbComposeGetSolid (pSrc, pDst, src);
+
+ if (src >> 24 == 0)
+ return;
+
+ fbComposeGetStart (pDst, xDst, yDst, uint16_t, dstStride, dstLine, 1);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ vmxCombineOverU565(dst, src, width);
+ }
+}
+
+#endif
+
+void fbComposeSetupVMX (void)
+{
+ /* check if we have VMX support and initialize accordingly */
+ if (pixman_have_vmx ()) {
+ pixman_composeFunctions.combineU[PIXMAN_OP_OVER] = vmxCombineOverU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_OVER_REVERSE] = vmxCombineOverReverseU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_IN] = vmxCombineInU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_IN_REVERSE] = vmxCombineInReverseU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_OUT] = vmxCombineOutU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_OUT_REVERSE] = vmxCombineOutReverseU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_ATOP] = vmxCombineAtopU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_ATOP_REVERSE] = vmxCombineAtopReverseU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_XOR] = vmxCombineXorU;
+ pixman_composeFunctions.combineU[PIXMAN_OP_ADD] = vmxCombineAddU;
+
+ pixman_composeFunctions.combineC[PIXMAN_OP_SRC] = vmxCombineSrcC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_OVER] = vmxCombineOverC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_OVER_REVERSE] = vmxCombineOverReverseC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_IN] = vmxCombineInC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_IN_REVERSE] = vmxCombineInReverseC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_OUT] = vmxCombineOutC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_OUT_REVERSE] = vmxCombineOutReverseC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_ATOP] = vmxCombineAtopC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_ATOP_REVERSE] = vmxCombineAtopReverseC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_XOR] = vmxCombineXorC;
+ pixman_composeFunctions.combineC[PIXMAN_OP_ADD] = vmxCombineAddC;
+
+ pixman_composeFunctions.combineMaskU = vmxCombineMaskU;
+ }
+}
diff --git a/lib/pixman/pixman/pixman-vmx.h b/lib/pixman/pixman/pixman-vmx.h
new file mode 100644
index 000000000..70cb53a7f
--- /dev/null
+++ b/lib/pixman/pixman/pixman-vmx.h
@@ -0,0 +1,308 @@
+/*
+ * Copyright © 2007 Luca Barbato
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Luca Barbato not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. Luca Barbato makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+ * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ *
+ * Author: Luca Barbato (lu_zero@gentoo.org)
+ *
+ * Based on work by Owen Taylor, Søren Sandmann and Lars Knoll
+ */
+
+#include "pixman-private.h"
+
+#ifdef USE_VMX
+
+pixman_bool_t pixman_have_vmx(void);
+
+#else
+#define pixman_have_vmx() FALSE
+#endif
+
+#ifdef USE_VMX
+
+#define AVV(x...) {x}
+
+void fbComposeSetupVMX (void);
+
+#if 0
+void fbCompositeIn_nx8x8vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSolidMask_nx8888x0565Cvmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSrcAdd_8888x8888vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSolidMask_nx8888x8888Cvmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSolidMask_nx8x8888vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSolidMaskSrc_nx8x8888vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSrcAdd_8888x8x8vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeIn_8x8vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSrcAdd_8000x8000vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSrc_8888RevNPx8888vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSrc_8888x0565vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSrc_8888RevNPx0565vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSolid_nx8888vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSolid_nx0565vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSolidMask_nx8x0565vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSrc_x888x8x8888vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSrc_8888x8x8888vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+void fbCompositeSrc_8888x8888vmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+pixman_bool_t fbCopyAreavmx (FbPixels *pSrc,
+ FbPixels *pDst,
+ int src_x,
+ int src_y,
+ int dst_x,
+ int dst_y,
+ int width,
+ int height);
+
+void fbCompositeCopyAreavmx (pixman_operator_t op,
+ pixman_image_t * pSrc,
+ pixman_image_t * pMask,
+ pixman_image_t * pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
+
+pixman_bool_t fbSolidFillvmx (FbPixels *pDraw,
+ int x,
+ int y,
+ int width,
+ int height,
+ FbBits xor);
+#endif
+#endif /* USE_VMX */
diff --git a/lib/pixman/pixman/pixman.h b/lib/pixman/pixman/pixman.h
index 6a27a3fbc..36d91a900 100644
--- a/lib/pixman/pixman/pixman.h
+++ b/lib/pixman/pixman/pixman.h
@@ -74,10 +74,7 @@ SOFTWARE.
/*
* Standard integers
*/
-#if defined (__SVR4) && defined (__sun)
-# include <sys/int_types.h>
-# include <stdint.h>
-#elif defined (__OpenBSD__)
+#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun)
# include <inttypes.h>
#elif defined (_MSC_VER)
typedef __int8 int8_t;
@@ -88,17 +85,12 @@ typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
+#elif defined (_AIX)
+# include <sys/inttypes.h>
#else
# include <stdint.h>
#endif
-/* GCC visibility */
-#if defined(__GNUC__) && __GNUC__ >= 4
-#define PIXMAN_EXPORT __attribute__ ((visibility("default")))
-#else
-#define PIXMAN_EXPORT
-#endif
-
/*
* Boolean
*/
@@ -167,10 +159,6 @@ struct pixman_transform
pixman_fixed_t matrix[3][3];
};
-PIXMAN_EXPORT
-pixman_bool_t pixman_transform_point_3d (pixman_transform_t *transform,
- pixman_vector_t *vector);
-
/* Don't blame me, blame XRender */
typedef enum
{
@@ -274,112 +262,186 @@ typedef enum
PIXMAN_REGION_PART
} pixman_region_overlap_t;
-PIXMAN_EXPORT
-int pixman_version (void);
-
-PIXMAN_EXPORT
-const char* pixman_version_string (void);
-
/* This function exists only to make it possible to preserve the X ABI - it should
* go away at first opportunity.
*/
-PIXMAN_EXPORT
-void pixman_region_set_static_pointers (pixman_box16_t *empty_box,
+void pixman_region_set_static_pointers (pixman_box16_t *empty_box,
pixman_region16_data_t *empty_data,
pixman_region16_data_t *broken_data);
+
/* creation/destruction */
-PIXMAN_EXPORT
-void pixman_region_init (pixman_region16_t *region);
-PIXMAN_EXPORT
-void pixman_region_init_rect (pixman_region16_t *region,
- int x,
- int y,
- unsigned int width,
- unsigned int height);
-PIXMAN_EXPORT
-void pixman_region_init_with_extents (pixman_region16_t *region,
- pixman_box16_t *extents);
-PIXMAN_EXPORT
-void pixman_region_fini (pixman_region16_t *region);
+void pixman_region_init (pixman_region16_t *region);
+void pixman_region_init_rect (pixman_region16_t *region,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height);
+pixman_bool_t pixman_region_init_rects (pixman_region16_t *region,
+ pixman_box16_t *boxes,
+ int count);
+void pixman_region_init_with_extents (pixman_region16_t *region,
+ pixman_box16_t *extents);
+void pixman_region_fini (pixman_region16_t *region);
+
/* manipulation */
-PIXMAN_EXPORT
-void pixman_region_translate (pixman_region16_t *region,
- int x,
- int y);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_copy (pixman_region16_t *dest,
- pixman_region16_t *source);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_intersect (pixman_region16_t *newReg,
- pixman_region16_t *reg1,
- pixman_region16_t *reg2);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_union (pixman_region16_t *newReg,
- pixman_region16_t *reg1,
- pixman_region16_t *reg2);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_union_rect (pixman_region16_t *dest,
- pixman_region16_t *source,
- int x,
- int y,
- unsigned int width,
- unsigned int height);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_subtract (pixman_region16_t *regD,
- pixman_region16_t *regM,
- pixman_region16_t *regS);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_inverse (pixman_region16_t *newReg,
- pixman_region16_t *reg1,
- pixman_box16_t *invRect);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_contains_point (pixman_region16_t *region,
- int x, int y, pixman_box16_t *box);
-PIXMAN_EXPORT
-pixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *pixman_region16_t,
- pixman_box16_t *prect);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_not_empty (pixman_region16_t *region);
-PIXMAN_EXPORT
-pixman_box16_t * pixman_region_extents (pixman_region16_t *region);
-PIXMAN_EXPORT
-int pixman_region_n_rects (pixman_region16_t *region);
-PIXMAN_EXPORT
-pixman_box16_t * pixman_region_rectangles (pixman_region16_t *region,
- int *n_rects);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_equal (pixman_region16_t *region1,
- pixman_region16_t *region2);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_selfcheck (pixman_region16_t *region);
-PIXMAN_EXPORT
-void pixman_region_reset (pixman_region16_t *region, pixman_box16_t *box);
-PIXMAN_EXPORT
-pixman_bool_t pixman_region_init_rects (pixman_region16_t *region,
- pixman_box16_t *boxes, int count);
-
-/* Copy / Fill */
-PIXMAN_EXPORT
-pixman_bool_t pixman_blt (uint32_t *src_bits,
- uint32_t *dst_bits,
- int src_stride,
- int dst_stride,
- int src_bpp,
- int dst_bpp,
- int src_x, int src_y,
- int dst_x, int dst_y,
- int width, int height);
-PIXMAN_EXPORT
-pixman_bool_t pixman_fill (uint32_t *bits,
- int stride,
- int bpp,
- int x,
- int y,
- int width,
- int height,
- uint32_t _xor);
+void pixman_region_translate (pixman_region16_t *region,
+ int x,
+ int y);
+pixman_bool_t pixman_region_copy (pixman_region16_t *dest,
+ pixman_region16_t *source);
+pixman_bool_t pixman_region_intersect (pixman_region16_t *newReg,
+ pixman_region16_t *reg1,
+ pixman_region16_t *reg2);
+pixman_bool_t pixman_region_union (pixman_region16_t *newReg,
+ pixman_region16_t *reg1,
+ pixman_region16_t *reg2);
+pixman_bool_t pixman_region_union_rect (pixman_region16_t *dest,
+ pixman_region16_t *source,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height);
+pixman_bool_t pixman_region_subtract (pixman_region16_t *regD,
+ pixman_region16_t *regM,
+ pixman_region16_t *regS);
+pixman_bool_t pixman_region_inverse (pixman_region16_t *newReg,
+ pixman_region16_t *reg1,
+ pixman_box16_t *invRect);
+pixman_bool_t pixman_region_contains_point (pixman_region16_t *region,
+ int x,
+ int y,
+ pixman_box16_t *box);
+pixman_region_overlap_t pixman_region_contains_rectangle (pixman_region16_t *pixman_region16_t,
+ pixman_box16_t *prect);
+pixman_bool_t pixman_region_not_empty (pixman_region16_t *region);
+pixman_box16_t * pixman_region_extents (pixman_region16_t *region);
+int pixman_region_n_rects (pixman_region16_t *region);
+pixman_box16_t * pixman_region_rectangles (pixman_region16_t *region,
+ int *n_rects);
+pixman_bool_t pixman_region_equal (pixman_region16_t *region1,
+ pixman_region16_t *region2);
+pixman_bool_t pixman_region_selfcheck (pixman_region16_t *region);
+void pixman_region_reset (pixman_region16_t *region,
+ pixman_box16_t *box);
+
+/*
+ * 32 bit regions
+ */
+typedef struct pixman_region32_data pixman_region32_data_t;
+typedef struct pixman_box32 pixman_box32_t;
+typedef struct pixman_rectangle32 pixman_rectangle32_t;
+typedef struct pixman_region32 pixman_region32_t;
+
+struct pixman_region32_data {
+ long size;
+ long numRects;
+/* pixman_box32_t rects[size]; in memory but not explicitly declared */
+};
+
+struct pixman_rectangle32
+{
+ int32_t x, y;
+ uint32_t width, height;
+};
+
+struct pixman_box32
+{
+ int32_t x1, y1, x2, y2;
+};
+
+struct pixman_region32
+{
+ pixman_box32_t extents;
+ pixman_region32_data_t *data;
+};
+
+/* creation/destruction */
+void pixman_region32_init (pixman_region32_t *region);
+void pixman_region32_init_rect (pixman_region32_t *region,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height);
+pixman_bool_t pixman_region32_init_rects (pixman_region32_t *region,
+ pixman_box32_t *boxes,
+ int count);
+void pixman_region32_init_with_extents (pixman_region32_t *region,
+ pixman_box32_t *extents);
+void pixman_region32_fini (pixman_region32_t *region);
+
+
+/* manipulation */
+void pixman_region32_translate (pixman_region32_t *region,
+ int x,
+ int y);
+pixman_bool_t pixman_region32_copy (pixman_region32_t *dest,
+ pixman_region32_t *source);
+pixman_bool_t pixman_region32_intersect (pixman_region32_t *newReg,
+ pixman_region32_t *reg1,
+ pixman_region32_t *reg2);
+pixman_bool_t pixman_region32_union (pixman_region32_t *newReg,
+ pixman_region32_t *reg1,
+ pixman_region32_t *reg2);
+pixman_bool_t pixman_region32_union_rect (pixman_region32_t *dest,
+ pixman_region32_t *source,
+ int x,
+ int y,
+ unsigned int width,
+ unsigned int height);
+pixman_bool_t pixman_region32_subtract (pixman_region32_t *regD,
+ pixman_region32_t *regM,
+ pixman_region32_t *regS);
+pixman_bool_t pixman_region32_inverse (pixman_region32_t *newReg,
+ pixman_region32_t *reg1,
+ pixman_box32_t *invRect);
+pixman_bool_t pixman_region32_contains_point (pixman_region32_t *region,
+ int x,
+ int y,
+ pixman_box32_t *box);
+pixman_region_overlap_t pixman_region32_contains_rectangle (pixman_region32_t *region,
+ pixman_box32_t *prect);
+pixman_bool_t pixman_region32_not_empty (pixman_region32_t *region);
+pixman_box32_t * pixman_region32_extents (pixman_region32_t *region);
+int pixman_region32_n_rects (pixman_region32_t *region);
+pixman_box32_t * pixman_region32_rectangles (pixman_region32_t *region,
+ int *n_rects);
+pixman_bool_t pixman_region32_equal (pixman_region32_t *region1,
+ pixman_region32_t *region2);
+pixman_bool_t pixman_region32_selfcheck (pixman_region32_t *region);
+void pixman_region32_reset (pixman_region32_t *region,
+ pixman_box32_t *box);
+
+
+/* Copy / Fill / Misc */
+pixman_bool_t pixman_blt (uint32_t *src_bits,
+ uint32_t *dst_bits,
+ int src_stride,
+ int dst_stride,
+ int src_bpp,
+ int dst_bpp,
+ int src_x,
+ int src_y,
+ int dst_x,
+ int dst_y,
+ int width,
+ int height);
+pixman_bool_t pixman_fill (uint32_t *bits,
+ int stride,
+ int bpp,
+ int x,
+ int y,
+ int width,
+ int height,
+ uint32_t _xor);
+
+pixman_bool_t pixman_transform_point_3d (pixman_transform_t *transform,
+ pixman_vector_t *vector);
+
+int pixman_version (void);
+const char* pixman_version_string (void);
+
/*
* Images
*/
@@ -450,7 +512,9 @@ typedef enum {
PIXMAN_x8r8g8b8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,0,8,8,8),
PIXMAN_a8b8g8r8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ABGR,8,8,8,8),
PIXMAN_x8b8g8r8 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ABGR,0,8,8,8),
-
+ PIXMAN_x2b10g10r10 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ABGR,0,10,10,10),
+ PIXMAN_a2b10g10r10 = PIXMAN_FORMAT(32,PIXMAN_TYPE_ABGR,2,10,10,10),
+
/* 24bpp formats */
PIXMAN_r8g8b8 = PIXMAN_FORMAT(24,PIXMAN_TYPE_ARGB,0,8,8,8),
PIXMAN_b8g8r8 = PIXMAN_FORMAT(24,PIXMAN_TYPE_ABGR,0,8,8,8),
@@ -500,37 +564,29 @@ typedef enum {
/* YUV formats */
PIXMAN_yuy2 = PIXMAN_FORMAT(16,PIXMAN_TYPE_YUY2,0,0,0,0),
- PIXMAN_yv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0),
+ PIXMAN_yv12 = PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0)
} pixman_format_code_t;
/* Querying supported format values. */
-PIXMAN_EXPORT
-pixman_bool_t pixman_format_supported_destination (pixman_format_code_t format);
-
-PIXMAN_EXPORT
-pixman_bool_t pixman_format_supported_source (pixman_format_code_t format);
+pixman_bool_t pixman_format_supported_destination (pixman_format_code_t format);
+pixman_bool_t pixman_format_supported_source (pixman_format_code_t format);
/* Constructors */
-PIXMAN_EXPORT
pixman_image_t *pixman_image_create_solid_fill (pixman_color_t *color);
-PIXMAN_EXPORT
pixman_image_t *pixman_image_create_linear_gradient (pixman_point_fixed_t *p1,
pixman_point_fixed_t *p2,
const pixman_gradient_stop_t *stops,
int n_stops);
-PIXMAN_EXPORT
pixman_image_t *pixman_image_create_radial_gradient (pixman_point_fixed_t *inner,
pixman_point_fixed_t *outer,
pixman_fixed_t inner_radius,
pixman_fixed_t outer_radius,
const pixman_gradient_stop_t *stops,
int n_stops);
-PIXMAN_EXPORT
pixman_image_t *pixman_image_create_conical_gradient (pixman_point_fixed_t *center,
pixman_fixed_t angle,
const pixman_gradient_stop_t *stops,
int n_stops);
-PIXMAN_EXPORT
pixman_image_t *pixman_image_create_bits (pixman_format_code_t format,
int width,
int height,
@@ -538,96 +594,74 @@ pixman_image_t *pixman_image_create_bits (pixman_format_code_t
int rowstride_bytes);
/* Destructor */
-PIXMAN_EXPORT
pixman_image_t *pixman_image_ref (pixman_image_t *image);
-PIXMAN_EXPORT
pixman_bool_t pixman_image_unref (pixman_image_t *image);
/* Set properties */
-PIXMAN_EXPORT
pixman_bool_t pixman_image_set_clip_region (pixman_image_t *image,
pixman_region16_t *region);
-PIXMAN_EXPORT
+pixman_bool_t pixman_image_set_clip_region32 (pixman_image_t *image,
+ pixman_region32_t *region);
void pixman_image_set_has_client_clip (pixman_image_t *image,
pixman_bool_t clien_clip);
-PIXMAN_EXPORT
pixman_bool_t pixman_image_set_transform (pixman_image_t *image,
const pixman_transform_t *transform);
-PIXMAN_EXPORT
void pixman_image_set_repeat (pixman_image_t *image,
pixman_repeat_t repeat);
-PIXMAN_EXPORT
pixman_bool_t pixman_image_set_filter (pixman_image_t *image,
pixman_filter_t filter,
const pixman_fixed_t *filter_params,
int n_filter_params);
-PIXMAN_EXPORT
-void pixman_image_set_filter_params (pixman_image_t *image,
- pixman_fixed_t *params,
- int n_params);
-PIXMAN_EXPORT
void pixman_image_set_source_clipping (pixman_image_t *image,
pixman_bool_t source_clipping);
-PIXMAN_EXPORT
void pixman_image_set_alpha_map (pixman_image_t *image,
pixman_image_t *alpha_map,
int16_t x,
int16_t y);
-PIXMAN_EXPORT
void pixman_image_set_component_alpha (pixman_image_t *image,
pixman_bool_t component_alpha);
-PIXMAN_EXPORT
void pixman_image_set_accessors (pixman_image_t *image,
pixman_read_memory_func_t read_func,
pixman_write_memory_func_t write_func);
-PIXMAN_EXPORT
void pixman_image_set_indexed (pixman_image_t *image,
const pixman_indexed_t *indexed);
-PIXMAN_EXPORT
uint32_t *pixman_image_get_data (pixman_image_t *image);
-PIXMAN_EXPORT
int pixman_image_get_width (pixman_image_t *image);
-PIXMAN_EXPORT
int pixman_image_get_height (pixman_image_t *image);
-PIXMAN_EXPORT
int pixman_image_get_stride (pixman_image_t *image);
-PIXMAN_EXPORT
int pixman_image_get_depth (pixman_image_t *image);
-PIXMAN_EXPORT
pixman_bool_t pixman_image_fill_rectangles (pixman_op_t op,
pixman_image_t *image,
pixman_color_t *color,
int n_rects,
- const pixman_rectangle16_t *rects);
+ const pixman_rectangle16_t *rects);
/* Composite */
-PIXMAN_EXPORT
-pixman_bool_t pixman_compute_composite_region (pixman_region16_t * pRegion,
- pixman_image_t * pSrc,
- pixman_image_t * pMask,
- pixman_image_t * pDst,
- int16_t xSrc,
- int16_t ySrc,
- int16_t xMask,
- int16_t yMask,
- int16_t xDst,
- int16_t yDst,
- uint16_t width,
- uint16_t height);
-PIXMAN_EXPORT
-void pixman_image_composite (pixman_op_t op,
- pixman_image_t *src,
- pixman_image_t *mask,
- pixman_image_t *dest,
- int16_t src_x,
- int16_t src_y,
- int16_t mask_x,
- int16_t mask_y,
- int16_t dest_x,
- int16_t dest_y,
- uint16_t width,
- uint16_t height);
+pixman_bool_t pixman_compute_composite_region (pixman_region16_t *pRegion,
+ pixman_image_t *pSrc,
+ pixman_image_t *pMask,
+ pixman_image_t *pDst,
+ int16_t xSrc,
+ int16_t ySrc,
+ int16_t xMask,
+ int16_t yMask,
+ int16_t xDst,
+ int16_t yDst,
+ uint16_t width,
+ uint16_t height);
+void pixman_image_composite (pixman_op_t op,
+ pixman_image_t *src,
+ pixman_image_t *mask,
+ pixman_image_t *dest,
+ int16_t src_x,
+ int16_t src_y,
+ int16_t mask_x,
+ int16_t mask_y,
+ int16_t dest_x,
+ int16_t dest_y,
+ uint16_t width,
+ uint16_t height);
/*
* Trapezoids
@@ -680,52 +714,44 @@ struct pixman_trap
pixman_span_fix_t top, bot;
};
-PIXMAN_EXPORT
-pixman_fixed_t pixman_sample_ceil_y (pixman_fixed_t y,
- int bpp);
-PIXMAN_EXPORT
-pixman_fixed_t pixman_sample_floor_y (pixman_fixed_t y,
- int bpp);
-PIXMAN_EXPORT
-void pixman_edge_step (pixman_edge_t *e,
- int n);
-PIXMAN_EXPORT
-void pixman_edge_init (pixman_edge_t *e,
- int bpp,
- pixman_fixed_t y_start,
- pixman_fixed_t x_top,
- pixman_fixed_t y_top,
- pixman_fixed_t x_bot,
- pixman_fixed_t y_bot);
-PIXMAN_EXPORT
-void pixman_line_fixed_edge_init (pixman_edge_t *e,
- int bpp,
- pixman_fixed_t y,
+pixman_fixed_t pixman_sample_ceil_y (pixman_fixed_t y,
+ int bpp);
+pixman_fixed_t pixman_sample_floor_y (pixman_fixed_t y,
+ int bpp);
+void pixman_edge_step (pixman_edge_t *e,
+ int n);
+void pixman_edge_init (pixman_edge_t *e,
+ int bpp,
+ pixman_fixed_t y_start,
+ pixman_fixed_t x_top,
+ pixman_fixed_t y_top,
+ pixman_fixed_t x_bot,
+ pixman_fixed_t y_bot);
+void pixman_line_fixed_edge_init (pixman_edge_t *e,
+ int bpp,
+ pixman_fixed_t y,
const pixman_line_fixed_t *line,
- int x_off,
- int y_off);
-PIXMAN_EXPORT
-void pixman_rasterize_edges (pixman_image_t *image,
- pixman_edge_t *l,
- pixman_edge_t *r,
- pixman_fixed_t t,
- pixman_fixed_t b);
-PIXMAN_EXPORT
-void pixman_add_traps (pixman_image_t *image,
- int16_t x_off,
- int16_t y_off,
- int ntrap,
- pixman_trap_t *traps);
-PIXMAN_EXPORT
-void pixman_add_trapezoids (pixman_image_t *image,
- int16_t x_off,
- int y_off,
- int ntraps,
+ int x_off,
+ int y_off);
+void pixman_rasterize_edges (pixman_image_t *image,
+ pixman_edge_t *l,
+ pixman_edge_t *r,
+ pixman_fixed_t t,
+ pixman_fixed_t b);
+void pixman_add_traps (pixman_image_t *image,
+ int16_t x_off,
+ int16_t y_off,
+ int ntrap,
+ pixman_trap_t *traps);
+void pixman_add_trapezoids (pixman_image_t *image,
+ int16_t x_off,
+ int y_off,
+ int ntraps,
const pixman_trapezoid_t *traps);
-PIXMAN_EXPORT
-void pixman_rasterize_trapezoid (pixman_image_t *image,
+void pixman_rasterize_trapezoid (pixman_image_t *image,
const pixman_trapezoid_t *trap,
- int x_off,
- int y_off);
+ int x_off,
+ int y_off);
+
#endif /* PIXMAN_H__ */
diff --git a/lib/pixman/test/Makefile.am b/lib/pixman/test/Makefile.am
index 3db77b341..33e2200db 100644
--- a/lib/pixman/test/Makefile.am
+++ b/lib/pixman/test/Makefile.am
@@ -1,15 +1,19 @@
if HAVE_GTK
-TESTPROGRAMS = \
+TESTPROGRAMS = \
+ clip-test \
composite-test \
gradient-test \
+ region-test \
fetch-test
noinst_PROGRAMS = $(TESTPROGRAMS)
-INCLUDES = -I$(top_srcdir)/pixman $(GTK_CFLAGS)
+INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman $(GTK_CFLAGS)
composite_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS)
gradient_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS)
fetch_test_LDADD = $(top_builddir)/pixman/libpixman-1.la
+region_test_LDADD = $(top_builddir)/pixman/libpixman-1.la
+clip_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS)
endif
diff --git a/lib/pixman/test/Makefile.in b/lib/pixman/test/Makefile.in
index c49b472b8..c58c3688a 100644
--- a/lib/pixman/test/Makefile.in
+++ b/lib/pixman/test/Makefile.in
@@ -46,12 +46,18 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
-@HAVE_GTK_TRUE@am__EXEEXT_1 = composite-test$(EXEEXT) \
-@HAVE_GTK_TRUE@ gradient-test$(EXEEXT) fetch-test$(EXEEXT)
+@HAVE_GTK_TRUE@am__EXEEXT_1 = clip-test$(EXEEXT) \
+@HAVE_GTK_TRUE@ composite-test$(EXEEXT) gradient-test$(EXEEXT) \
+@HAVE_GTK_TRUE@ region-test$(EXEEXT) fetch-test$(EXEEXT)
PROGRAMS = $(noinst_PROGRAMS)
+clip_test_SOURCES = clip-test.c
+clip_test_OBJECTS = clip-test.$(OBJEXT)
+am__DEPENDENCIES_1 =
+@HAVE_GTK_TRUE@clip_test_DEPENDENCIES = \
+@HAVE_GTK_TRUE@ $(top_builddir)/pixman/libpixman-1.la \
+@HAVE_GTK_TRUE@ $(am__DEPENDENCIES_1)
composite_test_SOURCES = composite-test.c
composite_test_OBJECTS = composite-test.$(OBJEXT)
-am__DEPENDENCIES_1 =
@HAVE_GTK_TRUE@composite_test_DEPENDENCIES = \
@HAVE_GTK_TRUE@ $(top_builddir)/pixman/libpixman-1.la \
@HAVE_GTK_TRUE@ $(am__DEPENDENCIES_1)
@@ -64,6 +70,10 @@ gradient_test_OBJECTS = gradient-test.$(OBJEXT)
@HAVE_GTK_TRUE@gradient_test_DEPENDENCIES = \
@HAVE_GTK_TRUE@ $(top_builddir)/pixman/libpixman-1.la \
@HAVE_GTK_TRUE@ $(am__DEPENDENCIES_1)
+region_test_SOURCES = region-test.c
+region_test_OBJECTS = region-test.$(OBJEXT)
+@HAVE_GTK_TRUE@region_test_DEPENDENCIES = \
+@HAVE_GTK_TRUE@ $(top_builddir)/pixman/libpixman-1.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -75,8 +85,10 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
CCLD = $(CC)
LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = composite-test.c fetch-test.c gradient-test.c
-DIST_SOURCES = composite-test.c fetch-test.c gradient-test.c
+SOURCES = clip-test.c composite-test.c fetch-test.c gradient-test.c \
+ region-test.c
+DIST_SOURCES = clip-test.c composite-test.c fetch-test.c \
+ gradient-test.c region-test.c
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -103,6 +115,7 @@ DEFS = @DEFS@
DEPDIR = @DEPDIR@
DEP_CFLAGS = @DEP_CFLAGS@
DEP_LIBS = @DEP_LIBS@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -128,6 +141,7 @@ LTLIBOBJS = @LTLIBOBJS@
LT_VERSION_INFO = @LT_VERSION_INFO@
MAKEINFO = @MAKEINFO@
MMX_CFLAGS = @MMX_CFLAGS@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -136,26 +150,31 @@ PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
PIXMAN_VERSION_MAJOR = @PIXMAN_VERSION_MAJOR@
PIXMAN_VERSION_MICRO = @PIXMAN_VERSION_MICRO@
PIXMAN_VERSION_MINOR = @PIXMAN_VERSION_MINOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
+SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
-SSE_CFLAGS = @SSE_CFLAGS@
+SSE2_CFLAGS = @SSE2_CFLAGS@
STRIP = @STRIP@
USE_MMX_FALSE = @USE_MMX_FALSE@
USE_MMX_TRUE = @USE_MMX_TRUE@
USE_SSE2_FALSE = @USE_SSE2_FALSE@
USE_SSE2_TRUE = @USE_SSE2_TRUE@
-USE_SSE_FALSE = @USE_SSE_FALSE@
-USE_SSE_TRUE = @USE_SSE_TRUE@
+USE_VMX_FALSE = @USE_VMX_FALSE@
+USE_VMX_TRUE = @USE_VMX_TRUE@
VERSION = @VERSION@
+VMX_CFLAGS = @VMX_CFLAGS@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_F77 = @ac_ct_F77@
+ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@
@@ -197,14 +216,18 @@ sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
@HAVE_GTK_TRUE@TESTPROGRAMS = \
+@HAVE_GTK_TRUE@ clip-test \
@HAVE_GTK_TRUE@ composite-test \
@HAVE_GTK_TRUE@ gradient-test \
+@HAVE_GTK_TRUE@ region-test \
@HAVE_GTK_TRUE@ fetch-test
-@HAVE_GTK_TRUE@INCLUDES = -I$(top_srcdir)/pixman $(GTK_CFLAGS)
+@HAVE_GTK_TRUE@INCLUDES = -I$(top_srcdir)/pixman -I$(top_builddir)/pixman $(GTK_CFLAGS)
@HAVE_GTK_TRUE@composite_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS)
@HAVE_GTK_TRUE@gradient_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS)
@HAVE_GTK_TRUE@fetch_test_LDADD = $(top_builddir)/pixman/libpixman-1.la
+@HAVE_GTK_TRUE@region_test_LDADD = $(top_builddir)/pixman/libpixman-1.la
+@HAVE_GTK_TRUE@clip_test_LDADD = $(top_builddir)/pixman/libpixman-1.la $(GTK_LIBS)
all: all-am
.SUFFIXES:
@@ -245,6 +268,9 @@ clean-noinstPROGRAMS:
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
+clip-test$(EXEEXT): $(clip_test_OBJECTS) $(clip_test_DEPENDENCIES)
+ @rm -f clip-test$(EXEEXT)
+ $(LINK) $(clip_test_LDFLAGS) $(clip_test_OBJECTS) $(clip_test_LDADD) $(LIBS)
composite-test$(EXEEXT): $(composite_test_OBJECTS) $(composite_test_DEPENDENCIES)
@rm -f composite-test$(EXEEXT)
$(LINK) $(composite_test_LDFLAGS) $(composite_test_OBJECTS) $(composite_test_LDADD) $(LIBS)
@@ -254,6 +280,9 @@ fetch-test$(EXEEXT): $(fetch_test_OBJECTS) $(fetch_test_DEPENDENCIES)
gradient-test$(EXEEXT): $(gradient_test_OBJECTS) $(gradient_test_DEPENDENCIES)
@rm -f gradient-test$(EXEEXT)
$(LINK) $(gradient_test_LDFLAGS) $(gradient_test_OBJECTS) $(gradient_test_LDADD) $(LIBS)
+region-test$(EXEEXT): $(region_test_OBJECTS) $(region_test_DEPENDENCIES)
+ @rm -f region-test$(EXEEXT)
+ $(LINK) $(region_test_LDFLAGS) $(region_test_OBJECTS) $(region_test_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
@@ -261,9 +290,11 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clip-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/composite-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fetch-test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gradient-test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/region-test.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
diff --git a/lib/pixman/test/clip-test.c b/lib/pixman/test/clip-test.c
new file mode 100644
index 000000000..457e97a2b
--- /dev/null
+++ b/lib/pixman/test/clip-test.c
@@ -0,0 +1,159 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <gtk/gtk.h>
+#include "pixman.h"
+
+GdkPixbuf *
+pixbuf_from_argb32 (uint32_t *bits,
+ int width,
+ int height,
+ int stride)
+{
+ GdkPixbuf *pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE,
+ 8, width, height);
+ int p_stride = gdk_pixbuf_get_rowstride (pixbuf);
+ guint32 *p_bits = (guint32 *)gdk_pixbuf_get_pixels (pixbuf);
+ int w, h;
+
+ for (h = 0; h < height; ++h)
+ {
+ for (w = 0; w < width; ++w)
+ {
+ uint32_t argb = bits[h * stride + w];
+ guint32 abgr;
+
+ abgr = (argb & 0xff000000) |
+ (argb & 0xff) << 16 |
+ (argb & 0x00ff00) |
+ (argb & 0xff0000) >> 16;
+
+ p_bits[h * (p_stride / 4) + w] = abgr;
+ }
+ }
+
+ return pixbuf;
+}
+
+static gboolean
+on_expose (GtkWidget *widget, GdkEventExpose *expose, gpointer data)
+{
+ GdkPixbuf *pixbuf = data;
+
+ gdk_draw_pixbuf (widget->window, NULL,
+ pixbuf, 0, 0, 0, 0,
+ gdk_pixbuf_get_width (pixbuf),
+ gdk_pixbuf_get_height (pixbuf),
+ GDK_RGB_DITHER_NONE,
+ 0, 0);
+
+ return TRUE;
+}
+
+static void
+show_window (pixman_image_t *img, int w, int h, int stride)
+{
+ GdkPixbuf *pixbuf;
+
+ GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+
+ pixbuf = pixbuf_from_argb32 (pixman_image_get_data (img), w, h, stride);
+
+ g_signal_connect (window, "expose_event", G_CALLBACK (on_expose), pixbuf);
+ g_signal_connect (window, "delete_event", G_CALLBACK (gtk_main_quit), NULL);
+
+ gtk_widget_show (window);
+
+ gtk_main ();
+}
+
+#define WIDTH 200
+#define HEIGHT 200
+
+static pixman_image_t *
+create_solid_bits (uint32_t pixel)
+{
+ uint32_t *pixels = malloc (WIDTH * HEIGHT * 4);
+ int i;
+
+ for (i = 0; i < WIDTH * HEIGHT; ++i)
+ pixels[i] = pixel;
+
+ return pixman_image_create_bits (PIXMAN_a8r8g8b8,
+ WIDTH, HEIGHT,
+ pixels,
+ WIDTH * 4);
+}
+
+int
+main (int argc, char **argv)
+{
+ pixman_image_t *gradient_img;
+ pixman_image_t *src_img, *dst_img;
+ pixman_gradient_stop_t stops[2] =
+ {
+ { pixman_int_to_fixed (0), { 0xffff, 0x0000, 0x0000, 0xffff } },
+ { pixman_int_to_fixed (1), { 0xffff, 0xffff, 0x0000, 0xffff } }
+ };
+ pixman_point_fixed_t p1 = { 0, 0 };
+ pixman_point_fixed_t p2 = { pixman_int_to_fixed (WIDTH),
+ pixman_int_to_fixed (HEIGHT) };
+ pixman_point_fixed_t c_inner;
+ pixman_point_fixed_t c_outer;
+ pixman_fixed_t r_inner;
+ pixman_fixed_t r_outer;
+ pixman_region32_t clip_region;
+ pixman_transform_t trans = {
+ { { pixman_double_to_fixed (1.3), pixman_double_to_fixed (0), pixman_double_to_fixed (-0.5), },
+ { pixman_double_to_fixed (0), pixman_double_to_fixed (1), pixman_double_to_fixed (-0.5), },
+ { pixman_double_to_fixed (0), pixman_double_to_fixed (0), pixman_double_to_fixed (1.0) }
+ }
+ };
+
+ gtk_init (&argc, &argv);
+
+ src_img = create_solid_bits (0xff0000ff);
+
+ c_inner.x = pixman_double_to_fixed (100.0);
+ c_inner.y = pixman_double_to_fixed (100.0);
+ c_outer.x = pixman_double_to_fixed (100.0);
+ c_outer.y = pixman_double_to_fixed (100.0);
+ r_inner = 0;
+ r_outer = pixman_double_to_fixed (100.0);
+
+ gradient_img = pixman_image_create_radial_gradient (&c_inner, &c_outer,
+ r_inner, r_outer,
+ stops, 2);
+
+#if 0
+ gradient_img = pixman_image_create_linear_gradient (&p1, &p2,
+ stops, 2);
+
+#endif
+
+ pixman_image_composite (PIXMAN_OP_OVER, gradient_img, NULL, src_img,
+ 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+
+ pixman_region32_init_rect (&clip_region, 50, 0, 100, 200);
+ pixman_image_set_clip_region32 (src_img, &clip_region);
+ pixman_image_set_source_clipping (src_img, TRUE);
+ pixman_image_set_transform (src_img, &trans);
+ pixman_image_set_repeat (src_img, PIXMAN_REPEAT_NORMAL);
+
+ dst_img = create_solid_bits (0xffff0000);
+ pixman_image_composite (PIXMAN_OP_OVER, src_img, NULL, dst_img,
+ 0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+
+
+#if 0
+ printf ("0, 0: %x\n", src[0]);
+ printf ("10, 10: %x\n", src[10 * 10 + 10]);
+ printf ("w, h: %x\n", src[(HEIGHT - 1) * 100 + (WIDTH - 1)]);
+#endif
+
+ show_window (dst_img, WIDTH, HEIGHT, WIDTH);
+
+ pixman_image_unref (gradient_img);
+ pixman_image_unref (src_img);
+
+ return 0;
+}
diff --git a/lib/pixman/test/region-test.c b/lib/pixman/test/region-test.c
new file mode 100644
index 000000000..e214e9b89
--- /dev/null
+++ b/lib/pixman/test/region-test.c
@@ -0,0 +1,23 @@
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "pixman.h"
+
+/* This used to go into an infinite loop before pixman-region.c
+ * was fixed to not use explict "short" variables
+ */
+int
+main ()
+{
+ pixman_region32_t r1;
+ pixman_region32_t r2;
+ pixman_region32_t r3;
+
+ pixman_region32_init_rect (&r1, 0, 0, 20, 64000);
+ pixman_region32_init_rect (&r2, 0, 0, 20, 64000);
+ pixman_region32_init_rect (&r3, 0, 0, 20, 64000);
+
+ pixman_region32_subtract (&r1, &r2, &r3);
+
+}
+