pixman: Branch 'master' - 2 commits

Andrea Canciani ranma42 at kemper.freedesktop.org
Fri Sep 14 22:53:24 PDT 2012


 Makefile.win32        |   14 +++++++-------
 Makefile.win32.common |    4 +++-
 pixman/Makefile.win32 |    2 ++
 pixman/pixman-mmx.c   |   25 +++++++++++++------------
 test/Makefile.win32   |   10 +++++++---
 5 files changed, 32 insertions(+), 23 deletions(-)

New commits:
commit 46e4faf8ef34d49f15e1946d105289fb06365553
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Jun 21 06:07:07 2012 +0200

    build: Improve win32 build system
    
    Handle cross-directory dependencies using PHONY targets and clean up
    some redundancies.

diff --git a/Makefile.win32 b/Makefile.win32
index 91cd12a..c3ca3bc 100644
--- a/Makefile.win32
+++ b/Makefile.win32
@@ -3,23 +3,23 @@ default: all
 top_srcdir = .
 include $(top_srcdir)/Makefile.win32.common
 
-# Recursive targets
-pixman_r:
+all: pixman test
+
+pixman:
 	@$(MAKE) -C pixman -f Makefile.win32
 
-test_r:
+test:
 	@$(MAKE) -C test -f Makefile.win32
 
 clean_r:
 	@$(MAKE) -C pixman -f Makefile.win32 clean
 	@$(MAKE) -C test   -f Makefile.win32 clean
 
-check_r:
+check:
 	@$(MAKE) -C test -f Makefile.win32 check
 
-# Base targets
-all: test_r
 
 clean: clean_r
 
-check: check_r
+
+.PHONY: all pixman test clean check
diff --git a/Makefile.win32.common b/Makefile.win32.common
index 56c3593..777f94c 100644
--- a/Makefile.win32.common
+++ b/Makefile.win32.common
@@ -46,9 +46,11 @@ endif
 endif
 
 
-$(CFG_VAR)/%.obj: %.c $(BUILT_SOURCES)
+$(CFG_VAR)/%.obj: %.c $(libpixman_headers)
 	@mkdir -p $(CFG_VAR)
 	@$(CC) -c $(PIXMAN_CFLAGS) -Fo"$@" $<
 
 clean: inform
 	@$(RM) $(CFG_VAR)/*.{exe,ilk,lib,obj,pdb} $(BUILT_SOURCES) || exit 0
+
+.PHONY: inform clean
diff --git a/pixman/Makefile.win32 b/pixman/Makefile.win32
index 381f2cd..57ed7a5 100644
--- a/pixman/Makefile.win32
+++ b/pixman/Makefile.win32
@@ -64,3 +64,5 @@ endif
 # pixman linking
 $(CFG_VAR)/$(LIBRARY).lib: $(OBJECTS)
 	@$(AR) $(PIXMAN_ARFLAGS) -OUT:$@ $^
+
+.PHONY: all informMMX informSSE2
diff --git a/test/Makefile.win32 b/test/Makefile.win32
index c88d087..b6254a3 100644
--- a/test/Makefile.win32
+++ b/test/Makefile.win32
@@ -16,9 +16,9 @@ OBJECTS = $(patsubst %.c, $(CFG_VAR)/%.obj, $(SOURCES))
 TESTS   = $(patsubst %,   $(CFG_VAR)/%.exe, $(TESTPROGRAMS))
 BENCHS  = $(patsubst %,   $(CFG_VAR)/%.exe, $(BENCHMARKS))
 
-all: inform $(TESTS) $(BENCHS)
+all: pixman inform $(TESTS) $(BENCHS)
 
-check: inform $(TESTS)
+check: pixman inform $(TESTS)
 	@failures=0 ; \
 	total=0 ; \
 	for test in $(TESTS) ; \
@@ -46,5 +46,9 @@ $(CFG_VAR)/libutils.lib: $(libutils_OBJECTS)
 $(CFG_VAR)/%.exe: $(CFG_VAR)/%.obj $(TEST_LDADD)
 	@$(LD) $(PIXMAN_LDFLAGS) -OUT:$@ $^
 
-$(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib:
+$(top_builddir)/pixman/$(CFG_VAR)/$(LIBRARY).lib: pixman
+
+pixman:
 	@$(MAKE) -C $(top_builddir)/pixman -f Makefile.win32
+
+.PHONY: all check pixman
commit c89efdd211cf7cd3dc69a4140045ceab6f445730
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Tue Jul 17 16:14:20 2012 +0200

    mmx: Fix x86 build on MSVC
    
    The MSVC compiler is very strict about variable declarations after
    statements.
    
    Move all the declarations of each block before any statement in
    the same block to fix multiple instances of:
    
    pixman-mmx.c(xxxx) : error C2275: '__m64' : illegal use of this type
    as an expression

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 74a5e87..b3a4c5f 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -541,7 +541,7 @@ expand565 (__m64 pixel, int pos)
 static force_inline void
 expand_4xpacked565 (__m64 vin, __m64 *vout0, __m64 *vout1, int full_alpha)
 {
-    __m64 t0, t1, alpha = _mm_setzero_si64 ();;
+    __m64 t0, t1, alpha = _mm_setzero_si64 ();
     __m64 r = _mm_and_si64 (vin, MC (expand_565_r));
     __m64 g = _mm_and_si64 (vin, MC (expand_565_g));
     __m64 b = _mm_and_si64 (vin, MC (expand_565_b));
@@ -1903,13 +1903,14 @@ mmx_composite_over_8888_0565 (pixman_implementation_t *imp,
 	{
 	    __m64 vdest = *(__m64 *)dst;
 	    __m64 v0, v1, v2, v3;
+	    __m64 vsrc0, vsrc1, vsrc2, vsrc3;
 
 	    expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
 
-	    __m64 vsrc0 = load8888 ((src + 0));
-	    __m64 vsrc1 = load8888 ((src + 1));
-	    __m64 vsrc2 = load8888 ((src + 2));
-	    __m64 vsrc3 = load8888 ((src + 3));
+	    vsrc0 = load8888 ((src + 0));
+	    vsrc1 = load8888 ((src + 1));
+	    vsrc2 = load8888 ((src + 2));
+	    vsrc3 = load8888 ((src + 3));
 
 	    v0 = over (vsrc0, expand_alpha (vsrc0), v0);
 	    v1 = over (vsrc1, expand_alpha (vsrc1), v1);
@@ -2455,19 +2456,20 @@ mmx_composite_over_n_8_0565 (pixman_implementation_t *imp,
 	    {
 		__m64 vdest = *(__m64 *)dst;
 		__m64 v0, v1, v2, v3;
+		__m64 vm0, vm1, vm2, vm3;
 
 		expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
 
-		__m64 vm0 = to_m64 (m0);
+		vm0 = to_m64 (m0);
 		v0 = in_over (vsrc, vsrca, expand_alpha_rev (vm0), v0);
 
-		__m64 vm1 = to_m64 (m1);
+		vm1 = to_m64 (m1);
 		v1 = in_over (vsrc, vsrca, expand_alpha_rev (vm1), v1);
 
-		__m64 vm2 = to_m64 (m2);
+		vm2 = to_m64 (m2);
 		v2 = in_over (vsrc, vsrca, expand_alpha_rev (vm2), v2);
 
-		__m64 vm3 = to_m64 (m3);
+		vm3 = to_m64 (m3);
 		v3 = in_over (vsrc, vsrca, expand_alpha_rev (vm3), v3);
 
 		*(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);;
@@ -3548,7 +3550,6 @@ do {										\
     /* fetch 2x2 pixel block into 2 mmx registers */				\
     __m64 t = ldq_u ((__m64 *)&src_top [pixman_fixed_to_int (vx)]);		\
     __m64 b = ldq_u ((__m64 *)&src_bottom [pixman_fixed_to_int (vx)]);		\
-    vx += unit_x;								\
     /* vertical interpolation */						\
     __m64 t_hi = _mm_mullo_pi16 (_mm_unpackhi_pi8 (t, mm_zero), mm_wt);		\
     __m64 t_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (t, mm_zero), mm_wt);		\
@@ -3556,13 +3557,13 @@ 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;								\
     if (BILINEAR_INTERPOLATION_BITS < 8)					\
     {										\
 	/* calculate horizontal weights */					\
 	__m64 mm_wh = _mm_add_pi16 (mm_addc7, _mm_xor_si64 (mm_xorc7,		\
 			  _mm_srli_pi16 (mm_x,					\
 					 16 - BILINEAR_INTERPOLATION_BITS)));	\
-	mm_x = _mm_add_pi16 (mm_x, mm_ux);					\
 	/* horizontal interpolation */						\
 	__m64 p = _mm_unpacklo_pi16 (lo, hi);					\
 	__m64 q = _mm_unpackhi_pi16 (lo, hi);					\
@@ -3576,7 +3577,6 @@ do {										\
 					16 - BILINEAR_INTERPOLATION_BITS));	\
 	__m64 mm_wh_hi = _mm_srli_pi16 (mm_x,					\
 					16 - BILINEAR_INTERPOLATION_BITS);	\
-	mm_x = _mm_add_pi16 (mm_x, mm_ux);					\
 	/* horizontal interpolation */						\
 	__m64 mm_lo_lo = _mm_mullo_pi16 (lo, mm_wh_lo);				\
 	__m64 mm_lo_hi = _mm_mullo_pi16 (hi, mm_wh_hi);				\
@@ -3587,6 +3587,7 @@ do {										\
 	hi = _mm_add_pi32 (_mm_unpackhi_pi16 (mm_lo_lo, mm_hi_lo),		\
 			   _mm_unpackhi_pi16 (mm_lo_hi, mm_hi_hi));		\
     }										\
+    mm_x = _mm_add_pi16 (mm_x, mm_ux);						\
     /* shift and pack the result */						\
     hi = _mm_srli_pi32 (hi, BILINEAR_INTERPOLATION_BITS * 2);			\
     lo = _mm_srli_pi32 (lo, BILINEAR_INTERPOLATION_BITS * 2);			\


More information about the xorg-commit mailing list