pixman: Branch 'master' - 4 commits

Andrea Canciani ranma42 at kemper.freedesktop.org
Wed Oct 9 05:29:47 PDT 2013


 pixman/Makefile.win32 |   29 +++++++++++++++++++++++++++--
 pixman/pixman-mmx.c   |    2 +-
 pixman/pixman-sse2.c  |    2 +-
 test/Makefile.win32   |    6 +++---
 test/utils.h          |    5 +++++
 5 files changed, 37 insertions(+), 7 deletions(-)

New commits:
commit 0af2fcaebc4835ecf52d6002fcaacb09cbbcbaad
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Sep 26 09:23:41 2013 +0200

    Add support for SSSE3 to the MSVC build system
    
    Handle SSSE3 just like MMX and SSE2.

diff --git a/pixman/Makefile.win32 b/pixman/Makefile.win32
index 57ed7a5..7b64033 100644
--- a/pixman/Makefile.win32
+++ b/pixman/Makefile.win32
@@ -14,8 +14,14 @@ ifeq ($(SSE2_VAR),)
 SSE2_VAR=on
 endif
 
+SSSE3_VAR = $(SSSE3)
+ifeq ($(SSSE3_VAR),)
+SSSE3_VAR=on
+endif
+
 MMX_CFLAGS = -DUSE_X86_MMX -w14710 -w14714
 SSE2_CFLAGS = -DUSE_SSE2
+SSSE3_CFLAGS = -DUSE_SSSE3
 
 # MMX compilation flags
 ifeq ($(MMX_VAR),on)
@@ -29,10 +35,16 @@ PIXMAN_CFLAGS += $(SSE2_CFLAGS)
 libpixman_sources += pixman-sse2.c
 endif
 
+# SSSE3 compilation flags
+ifeq ($(SSSE3_VAR),on)
+PIXMAN_CFLAGS += $(SSSE3_CFLAGS)
+libpixman_sources += pixman-ssse3.c
+endif
+
 OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(libpixman_sources))
 
 # targets
-all: inform informMMX informSSE2 $(CFG_VAR)/$(LIBRARY).lib
+all: inform informMMX informSSE2 informSSSE3 $(CFG_VAR)/$(LIBRARY).lib
 
 informMMX:
 ifneq ($(MMX),off)
@@ -60,9 +72,22 @@ endif
 endif
 endif
 
+informSSSE3:
+ifneq ($(SSSE3),off)
+ifneq ($(SSSE3),on)
+ifneq ($(SSSE3),)
+	@echo "Invalid specified SSE option : "$(SSSE3)"."
+	@echo
+	@echo "Possible choices for SSSE3 are 'on' or 'off'"
+	@exit 1
+endif
+	@echo "Setting SSSE3 flag to default value 'on'... (use SSSE3=on or SSSE3=off)"
+endif
+endif
+
 
 # pixman linking
 $(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
 	@$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
 
-.PHONY: all informMMX informSSE2
+.PHONY: all informMMX informSSE2 informSSSE3
commit e4d9c623d3baee50a5bfbc87cba81b0d2d87ee26
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Sep 26 09:26:17 2013 +0200

    Fix build of check-formats on MSVC
    
    Fixes
    
    check-formats.obj : error LNK2019: unresolved external symbol
    _strcasecmp referenced in function _format_from_string
    
    check-formats.obj : error LNK2019: unresolved external symbol
    _snprintf referenced in function _list_operators

diff --git a/test/utils.h b/test/utils.h
index 28b7193..ebb14d9 100644
--- a/test/utils.h
+++ b/test/utils.h
@@ -6,6 +6,11 @@
 #include "pixman-private.h" /* For 'inline' definition */
 #include "utils-prng.h"
 
+#if defined(_MSC_VER)
+#define snprintf _snprintf
+#define strcasecmp _stricmp
+#endif
+
 #define ARRAY_LENGTH(A) ((int) (sizeof (A) / sizeof ((A) [0])))
 
 /* A primitive pseudorandom number generator,
commit 96ad6ebd8b8481aaa603d14953edb96504658eb7
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Sep 26 09:12:31 2013 +0200

    Fix building of "other" programs on MSVC
    
    In d1434d112ca5cd325e4fb85fc60afd1b9e902786 the benchmarks have been
    extended to include other programs as well and the variable names have
    been updated accordingly in the autotools-based build system, but not
    in the MSVC one.

diff --git a/test/Makefile.win32 b/test/Makefile.win32
index b6254a3..6cfb4a7 100644
--- a/test/Makefile.win32
+++ b/test/Makefile.win32
@@ -11,12 +11,12 @@ TEST_LDADD = \
 
 libutils_OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(libutils_sources))
 
-SOURCES = $(patsubst %,   %.c,              $(TESTPROGRAMS) $(BENCHMARKS))
+SOURCES = $(patsubst %,   %.c,              $(TESTPROGRAMS) $(OTHERPROGRAMS))
 OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
 TESTS   = $(patsubst %,   $(CFG_VAR)/%.exe, $(TESTPROGRAMS))
-BENCHS  = $(patsubst %,   $(CFG_VAR)/%.exe, $(BENCHMARKS))
+OTHERS  = $(patsubst %,   $(CFG_VAR)/%.exe, $(OTHERPROGRAMS))
 
-all: pixman inform $(TESTS) $(BENCHS)
+all: pixman inform $(TESTS) $(OTHERS)
 
 check: pixman inform $(TESTS)
 	@failures=0 ; \
commit 31ac784f3427a189e34ef6fdc937441b613407b9
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Sep 26 09:16:41 2013 +0200

    Fix build on MSVC
    
    After a4c79d695d52c94647b1aff78548e5892d616b70 the MMX and SSE2 code
    has some declarations after the beginning of a block, which is not
    allowed by MSVC.
    
    Fixes multiple errors like:
    
    pixman-mmx.c(3625) : error C2275: '__m64' : illegal use of this type
    as an expression
    
    pixman-sse2.c(5708) : error C2275: '__m128i' : illegal use of this
    type as an expression

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index a0f59ef..f9a92ce 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3579,7 +3579,6 @@ do {										\
     __m64 b_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (b, mm_zero), mm_wb);		\
     __m64 hi = _mm_add_pi16 (t_hi, b_hi);					\
     __m64 lo = _mm_add_pi16 (t_lo, b_lo);					\
-    vx += unit_x;								\
     /* calculate horizontal weights */						\
     __m64 mm_wh = _mm_add_pi16 (mm_addc7, _mm_xor_si64 (mm_xorc7,		\
 			  _mm_srli_pi16 (mm_x,					\
@@ -3587,6 +3586,7 @@ do {										\
     /* horizontal interpolation */						\
     __m64 p = _mm_unpacklo_pi16 (lo, hi);					\
     __m64 q = _mm_unpackhi_pi16 (lo, hi);					\
+    vx += unit_x;								\
     lo = _mm_madd_pi16 (p, mm_wh);						\
     hi = _mm_madd_pi16 (q, mm_wh);						\
     mm_x = _mm_add_pi16 (mm_x, mm_ux);						\
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 42c7209..2ab2690 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -5626,10 +5626,10 @@ do {										\
 #define BILINEAR_INTERPOLATE_ONE_PIXEL_HELPER(pix, phase)			\
 do {										\
     __m128i xmm_wh, xmm_a, xmm_b;						\
-    (void)xmm_ux4; /* suppress warning: unused variable 'xmm_ux4' */		\
     /* fetch 2x2 pixel block into sse2 registers */				\
     __m128i tltr = _mm_loadl_epi64 ((__m128i *)&src_top[vx >> 16]);		\
     __m128i blbr = _mm_loadl_epi64 ((__m128i *)&src_bottom[vx >> 16]);		\
+    (void)xmm_ux4; /* suppress warning: unused variable 'xmm_ux4' */		\
     vx += unit_x;								\
     /* vertical interpolation */						\
     xmm_a = _mm_mullo_epi16 (_mm_unpacklo_epi8 (tltr, xmm_zero), xmm_wt);	\


More information about the xorg-commit mailing list