[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

pixman: Changes to 'upstream-experimental'



 Makefile.am                           |    7 
 configure.ac                          |   98 +--
 demos/alpha-test.c                    |    4 
 demos/gradient-test.c                 |    4 
 demos/tri-test.c                      |    2 
 pixman/Makefile.am                    |    2 
 pixman/Makefile.win32                 |    7 
 pixman/pixman-access.c                |   97 +++
 pixman/pixman-arm-common.h            |  196 ++++--
 pixman/pixman-arm-neon-asm-bilinear.S |  768 ++++++++++++++++++++++++++
 pixman/pixman-arm-neon-asm.S          |  982 +++++++++++++++++++++++++++++++++-
 pixman/pixman-arm-neon-asm.h          |   17 
 pixman/pixman-arm-neon.c              |   78 ++
 pixman/pixman-arm-simd-asm.S          |   66 +-
 pixman/pixman-arm-simd.c              |    9 
 pixman/pixman-bits-image.c            |   45 -
 pixman/pixman-combine.c.template      |    7 
 pixman/pixman-compiler.h              |    6 
 pixman/pixman-conical-gradient.c      |    7 
 pixman/pixman-cpu.c                   |    2 
 pixman/pixman-fast-path.c             |  436 +++------------
 pixman/pixman-fast-path.h             |  628 +++++++++++++++++++++
 pixman/pixman-general.c               |  103 ---
 pixman/pixman-image.c                 |    1 
 pixman/pixman-implementation.c        |   76 --
 pixman/pixman-linear-gradient.c       |   16 
 pixman/pixman-mmx.c                   |  390 +++----------
 pixman/pixman-noop.c                  |  137 ++++
 pixman/pixman-private.h               |  105 +--
 pixman/pixman-radial-gradient.c       |    7 
 pixman/pixman-solid-fill.c            |   17 
 pixman/pixman-sse2.c                  |  648 ++++++++--------------
 pixman/pixman-trap.c                  |   23 
 pixman/pixman.c                       |   76 +-
 pixman/pixman.h                       |   12 
 test/Makefile.am                      |    2 
 test/Makefile.win32                   |   73 ++
 test/affine-test.c                    |    6 
 test/blitters-test.c                  |   33 -
 test/composite-traps-test.c           |    8 
 test/composite.c                      |   58 +-
 test/fetch-test.c                     |   63 +-
 test/lowlevel-blt-bench.c             |   84 +-
 test/scaling-helpers-test.c           |   93 +++
 test/scaling-test.c                   |    6 
 test/stress-test.c                    |   41 +
 test/trap-crasher.c                   |   20 
 test/utils.c                          |   21 
 test/utils.h                          |    5 
 49 files changed, 3960 insertions(+), 1632 deletions(-)

New commits:
commit 6c4001a0e1cc0350147638ba941d23e129d00e0d
Author: Søren Sandmann Pedersen <ssp@redhat.com>
Date:   Mon Jul 4 08:13:19 2011 -0400

    Pre-release version bump to 0.23.2

diff --git a/configure.ac b/configure.ac
index 8ce9e19..7708c45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,7 +54,7 @@ AC_PREREQ([2.57])
 
 m4_define([pixman_major], 0)
 m4_define([pixman_minor], 23)
-m4_define([pixman_micro], 1)
+m4_define([pixman_micro], 2)
 
 m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
 

commit eff7c8efabe2da33edbf0bdc06e101352981286b
Author: Taekyun Kim <tkq.kim@samsung.com>
Date:   Mon Jun 13 19:53:49 2011 +0900

    Bilinear REPEAT_NORMAL source line extension for too short src_width
    
    To avoid function call and other calculation overhead, extend source
    scanline into temporary buffer when source width is too small.
    Temporary buffer will be repeatedly accessed, so extension cost is
    very small due to cache effect.

diff --git a/pixman/pixman-fast-path.h b/pixman/pixman-fast-path.h
index 8bc1d8a..e94591a 100644
--- a/pixman/pixman-fast-path.h
+++ b/pixman/pixman-fast-path.h
@@ -48,6 +48,11 @@
 #define FLAG_HAVE_SOLID_MASK			(1 <<   1)
 #define FLAG_HAVE_NON_SOLID_MASK		(1 <<   2)
 
+/* To avoid too short repeated scanline function calls, extend source
+ * scanlines having width less than below constant value.
+ */
+#define REPEAT_NORMAL_MIN_WIDTH			64
+
 static force_inline pixman_bool_t
 repeat (pixman_repeat_t repeat, int *c, int size)
 {
@@ -692,6 +697,8 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 												\
     int src_width;										\
     pixman_fixed_t src_width_fixed;								\
+    int max_x;											\
+    pixman_bool_t need_src_extension;								\
 												\
     PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, dst_type_t, dst_stride, dst_line, 1);	\
     if (flags & FLAG_HAVE_SOLID_MASK)								\
@@ -743,7 +750,25 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 												\
     if (PIXMAN_REPEAT_ ## repeat_mode == PIXMAN_REPEAT_NORMAL)					\
     {												\
-	src_width = src_image->bits.width;							\
+	vx = v.vector[0];									\
+	repeat (PIXMAN_REPEAT_NORMAL, &vx, pixman_int_to_fixed(src_image->bits.width));		\
+	max_x = pixman_fixed_to_int (vx + (width - 1) * unit_x) + 1;				\
+												\
+	if (src_image->bits.width < REPEAT_NORMAL_MIN_WIDTH)					\
+	{											\
+	    src_width = 0;									\
+												\
+	    while (src_width < REPEAT_NORMAL_MIN_WIDTH && src_width <= max_x)			\
+		src_width += src_image->bits.width;						\
+												\
+	    need_src_extension = TRUE;								\
+	}											\
+	else											\
+	{											\
+	    src_width = src_image->bits.width;							\
+	    need_src_extension = FALSE;								\
+	}											\
+												\
 	src_width_fixed = pixman_int_to_fixed (src_width);					\
     }												\
 												\
@@ -901,22 +926,41 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 	    src_type_t *    src_line_bottom;							\
 	    src_type_t	    buf1[2];								\
 	    src_type_t	    buf2[2];								\
+	    src_type_t	    extended_src_line0[REPEAT_NORMAL_MIN_WIDTH*2];			\
+	    src_type_t	    extended_src_line1[REPEAT_NORMAL_MIN_WIDTH*2];			\
+	    int		    i, j;								\
 												\
 	    repeat (PIXMAN_REPEAT_NORMAL, &y1, src_image->bits.height);				\
 	    repeat (PIXMAN_REPEAT_NORMAL, &y2, src_image->bits.height);				\
 	    src_line_top = src_first_line + src_stride * y1;					\
 	    src_line_bottom = src_first_line + src_stride * y2;					\
 												\
+	    if (need_src_extension)								\
+	    {											\
+		for (i=0; i<src_width;)								\
+		{										\
+		    for (j=0; j<src_image->bits.width; j++, i++)				\
+		    {										\
+			extended_src_line0[i] = src_line_top[j];				\
+			extended_src_line1[i] = src_line_bottom[j];				\
+		    }										\
+		}										\
+												\
+		src_line_top = &extended_src_line0[0];						\
+		src_line_bottom = &extended_src_line1[0];					\
+	    }											\
+												\
 	    /* Top & Bottom wrap around buffer */						\
-	    buf1[0] = src_line_top[src_image->bits.width - 1];					\
+	    buf1[0] = src_line_top[src_width - 1];						\
 	    buf1[1] = src_line_top[0];								\
-	    buf2[0] = src_line_bottom[src_image->bits.width - 1];				\
+	    buf2[0] = src_line_bottom[src_width - 1];						\
 	    buf2[1] = src_line_bottom[0];							\
 												\
 	    width_remain = width;								\
 												\
 	    while (width_remain > 0)								\
 	    {											\
+		/* We use src_width_fixed because it can make vx in original source range */	\
 		repeat (PIXMAN_REPEAT_NORMAL, &vx, src_width_fixed);				\
 												\
 		/* Wrap around part */								\

commit 828794d328e7ad1efc860baee8d6e72450b486b9
Author: Taekyun Kim <tkq.kim@samsung.com>
Date:   Wed Jun 8 17:17:42 2011 +0900

    Enable REPEAT_NORMAL bilinear fast path entries

diff --git a/pixman/pixman-fast-path.h b/pixman/pixman-fast-path.h
index ca497ad..8bc1d8a 100644
--- a/pixman/pixman-fast-path.h
+++ b/pixman/pixman-fast-path.h
@@ -1027,6 +1027,17 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 	fast_composite_scaled_bilinear_ ## func ## _cover ## _ ## op,	\
     }
 
+#define SIMPLE_BILINEAR_FAST_PATH_NORMAL(op,s,d,func)			\
+    {   PIXMAN_OP_ ## op,						\
+	PIXMAN_ ## s,							\
+	(SCALED_BILINEAR_FLAGS		|				\
+	 FAST_PATH_NORMAL_REPEAT	|				\
+	 FAST_PATH_X_UNIT_POSITIVE),					\
+	PIXMAN_null, 0,							\
+	PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS,				\
+	fast_composite_scaled_bilinear_ ## func ## _normal ## _ ## op,	\
+    }
+
 #define SIMPLE_BILINEAR_A8_MASK_FAST_PATH_PAD(op,s,d,func)		\
     {   PIXMAN_OP_ ## op,						\
 	PIXMAN_ ## s,							\
@@ -1058,6 +1069,17 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 	fast_composite_scaled_bilinear_ ## func ## _cover ## _ ## op,	\
     }
 
+#define SIMPLE_BILINEAR_A8_MASK_FAST_PATH_NORMAL(op,s,d,func)		\
+    {   PIXMAN_OP_ ## op,						\
+	PIXMAN_ ## s,							\
+	(SCALED_BILINEAR_FLAGS		|				\
+	 FAST_PATH_NORMAL_REPEAT	|				\
+	 FAST_PATH_X_UNIT_POSITIVE),					\
+	PIXMAN_a8, MASK_FLAGS (a8, FAST_PATH_UNIFIED_ALPHA),		\
+	PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS,				\
+	fast_composite_scaled_bilinear_ ## func ## _normal ## _ ## op,	\
+    }
+
 #define SIMPLE_BILINEAR_SOLID_MASK_FAST_PATH_PAD(op,s,d,func)		\
     {   PIXMAN_OP_ ## op,						\
 	PIXMAN_ ## s,							\
@@ -1089,20 +1111,34 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 	fast_composite_scaled_bilinear_ ## func ## _cover ## _ ## op,	\
     }
 
+#define SIMPLE_BILINEAR_SOLID_MASK_FAST_PATH_NORMAL(op,s,d,func)	\
+    {   PIXMAN_OP_ ## op,						\
+	PIXMAN_ ## s,							\
+	(SCALED_BILINEAR_FLAGS		|				\
+	 FAST_PATH_NORMAL_REPEAT	|				\
+	 FAST_PATH_X_UNIT_POSITIVE),					\
+	PIXMAN_solid, MASK_FLAGS (solid, FAST_PATH_UNIFIED_ALPHA),	\
+	PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS,				\
+	fast_composite_scaled_bilinear_ ## func ## _normal ## _ ## op,	\
+    }
+
 /* Prefer the use of 'cover' variant, because it is faster */
 #define SIMPLE_BILINEAR_FAST_PATH(op,s,d,func)				\
     SIMPLE_BILINEAR_FAST_PATH_COVER (op,s,d,func),			\
     SIMPLE_BILINEAR_FAST_PATH_NONE (op,s,d,func),			\
-    SIMPLE_BILINEAR_FAST_PATH_PAD (op,s,d,func)
+    SIMPLE_BILINEAR_FAST_PATH_PAD (op,s,d,func),			\
+    SIMPLE_BILINEAR_FAST_PATH_NORMAL (op,s,d,func)
 
 #define SIMPLE_BILINEAR_A8_MASK_FAST_PATH(op,s,d,func)			\
     SIMPLE_BILINEAR_A8_MASK_FAST_PATH_COVER (op,s,d,func),		\
     SIMPLE_BILINEAR_A8_MASK_FAST_PATH_NONE (op,s,d,func),		\
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH_PAD (op,s,d,func)
+    SIMPLE_BILINEAR_A8_MASK_FAST_PATH_PAD (op,s,d,func),		\
+    SIMPLE_BILINEAR_A8_MASK_FAST_PATH_NORMAL (op,s,d,func)
 
 #define SIMPLE_BILINEAR_SOLID_MASK_FAST_PATH(op,s,d,func)		\
     SIMPLE_BILINEAR_SOLID_MASK_FAST_PATH_COVER (op,s,d,func),		\
     SIMPLE_BILINEAR_SOLID_MASK_FAST_PATH_NONE (op,s,d,func),		\
-    SIMPLE_BILINEAR_SOLID_MASK_FAST_PATH_PAD (op,s,d,func)
+    SIMPLE_BILINEAR_SOLID_MASK_FAST_PATH_PAD (op,s,d,func),		\
+    SIMPLE_BILINEAR_SOLID_MASK_FAST_PATH_NORMAL (op,s,d,func)
 
 #endif

commit 1161b3f9edb6f5c396438b79f2df3218ea8d194e
Author: Taekyun Kim <tkq.kim@samsung.com>
Date:   Wed Jun 8 17:14:29 2011 +0900

    ARM: Add REPEAT_NORMAL functions to bilinear BIND macros
    
    Now bilinear template support REPEAT_NORMAL, so functions for that
    is added to PIXMAN_ARM_BIND_SCALED_BILINEAR_ macros. Fast path
    entries are not enabled yet.

diff --git a/pixman/pixman-arm-common.h b/pixman/pixman-arm-common.h
index 524ae70..f1d212c 100644
--- a/pixman/pixman-arm-common.h
+++ b/pixman/pixman-arm-common.h
@@ -354,7 +354,11 @@ FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_none_##op,                  \
                        src_type, uint32_t, dst_type, NONE, FLAG_NONE)         \
 FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_pad_##op,                   \
                        scaled_bilinear_scanline_##cputype##_##name##_##op,    \
-                       src_type, uint32_t, dst_type, PAD, FLAG_NONE)
+                       src_type, uint32_t, dst_type, PAD, FLAG_NONE)          \
+FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_normal_##op,                \
+                       scaled_bilinear_scanline_##cputype##_##name##_##op,    \
+                       src_type, uint32_t, dst_type, NORMAL,                  \
+                       FLAG_NONE)
 
 
 #define PIXMAN_ARM_BIND_SCALED_BILINEAR_SRC_A8_DST(flags, cputype, name, op,  \
@@ -402,6 +406,11 @@ FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_none_##op,                  \
 FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_pad_##op,                   \
                        scaled_bilinear_scanline_##cputype##_##name##_##op,    \
                        src_type, uint8_t, dst_type, PAD,                      \
+                       FLAG_HAVE_NON_SOLID_MASK)                              \
+FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_normal_##op,                \
+                       scaled_bilinear_scanline_##cputype##_##name##_##op,    \
+                       src_type, uint8_t, dst_type, NORMAL,                   \
                        FLAG_HAVE_NON_SOLID_MASK)
 
+
 #endif

commit ebd2f06d96ee91f9f7f13b906ae328862da7dde8
Author: Taekyun Kim <tkq.kim@samsung.com>
Date:   Wed Jun 8 17:11:24 2011 +0900

    sse2: Declare bilinear src_8888_8888 REPEAT_NORMAL composite function
    
    Now bilinear template support REPEAT_NORMAL, so declare composite
    functions using it. Function is just declared not used yet.

diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index dd15ccd..3d51c2f 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -5394,6 +5394,11 @@ FAST_BILINEAR_MAINLOOP_COMMON (sse2_8888_8888_none_SRC,
 			       scaled_bilinear_scanline_sse2_8888_8888_SRC,
 			       uint32_t, uint32_t, uint32_t,
 			       NONE, FLAG_NONE)
+FAST_BILINEAR_MAINLOOP_COMMON (sse2_8888_8888_normal_SRC,
+			       scaled_bilinear_scanline_sse2_8888_8888_SRC,
+			       uint32_t, uint32_t, uint32_t,
+			       NORMAL, FLAG_NONE)
+
 
 static const pixman_fast_path_t sse2_fast_paths[] =
 {

commit 7e22b2f7824f844076e1bb1fb26a6ec5e5d029cd
Author: Taekyun Kim <tkq.kim@samsung.com>
Date:   Wed Jun 8 15:58:01 2011 +0900

    REPEAT_NORMAL support for bilinear fast path template
    
    The basic idea is to break down normal repeat into a set of
    non-repeat scanline compositions and stitching them together.
    
    Bilinear may interpolate last and first pixels of source scanline.
    In this case, we can use temporary wrap around buffer.

diff --git a/pixman/pixman-fast-path.h b/pixman/pixman-fast-path.h
index e00b1a6..ca497ad 100644
--- a/pixman/pixman-fast-path.h
+++ b/pixman/pixman-fast-path.h
@@ -690,6 +690,9 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
     const mask_type_t *mask = &solid_mask;							\
     int src_stride, mask_stride, dst_stride;							\
 												\
+    int src_width;										\
+    pixman_fixed_t src_width_fixed;								\
+												\
     PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, dst_type_t, dst_stride, dst_line, 1);	\
     if (flags & FLAG_HAVE_SOLID_MASK)								\
     {												\
@@ -738,6 +741,12 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 	v.vector[0] += left_pad * unit_x;							\
     }												\
 												\
+    if (PIXMAN_REPEAT_ ## repeat_mode == PIXMAN_REPEAT_NORMAL)					\
+    {												\
+	src_width = src_image->bits.width;							\
+	src_width_fixed = pixman_int_to_fixed (src_width);					\
+    }												\
+												\
     while (--height >= 0)									\
     {												\
 	int weight1, weight2;									\
@@ -884,6 +893,87 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 			       buf1, buf2, right_pad, weight1, weight2, 0, 0, 0, TRUE);		\
 	    }											\
 	}											\
+	else if (PIXMAN_REPEAT_ ## repeat_mode == PIXMAN_REPEAT_NORMAL)				\
+	{											\
+	    int32_t	    num_pixels;								\
+	    int32_t	    width_remain;							\
+	    src_type_t *    src_line_top;							\
+	    src_type_t *    src_line_bottom;							\
+	    src_type_t	    buf1[2];								\
+	    src_type_t	    buf2[2];								\
+												\
+	    repeat (PIXMAN_REPEAT_NORMAL, &y1, src_image->bits.height);				\
+	    repeat (PIXMAN_REPEAT_NORMAL, &y2, src_image->bits.height);				\
+	    src_line_top = src_first_line + src_stride * y1;					\
+	    src_line_bottom = src_first_line + src_stride * y2;					\
+												\
+	    /* Top & Bottom wrap around buffer */						\
+	    buf1[0] = src_line_top[src_image->bits.width - 1];					\
+	    buf1[1] = src_line_top[0];								\
+	    buf2[0] = src_line_bottom[src_image->bits.width - 1];				\
+	    buf2[1] = src_line_bottom[0];							\
+												\
+	    width_remain = width;								\
+												\
+	    while (width_remain > 0)								\
+	    {											\
+		repeat (PIXMAN_REPEAT_NORMAL, &vx, src_width_fixed);				\
+												\
+		/* Wrap around part */								\
+		if (pixman_fixed_to_int (vx) == src_width - 1)					\
+		{										\
+		    /* for positive unit_x							\
+		     * num_pixels = max(n) + 1, where vx + n*unit_x < src_width_fixed		\
+		     *										\
+		     * vx is in range [0, src_width_fixed - pixman_fixed_e]			\
+		     * So we are safe from overflow.						\
+		     */										\
+		    num_pixels = ((src_width_fixed - vx - pixman_fixed_e) / unit_x) + 1;	\
+												\
+		    if (num_pixels > width_remain)						\
+			num_pixels = width_remain;						\
+												\
+		    scanline_func (dst, mask, buf1, buf2, num_pixels,				\
+				   weight1, weight2, pixman_fixed_frac(vx),			\
+				   unit_x, src_width_fixed, FALSE);				\
+												\
+		    width_remain -= num_pixels;							\
+		    vx += num_pixels * unit_x;							\
+		    dst += num_pixels;								\
+												\
+		    if (flags & FLAG_HAVE_NON_SOLID_MASK)					\
+			mask += num_pixels;							\
+												\
+		    repeat (PIXMAN_REPEAT_NORMAL, &vx, src_width_fixed);			\
+		}										\
+												\
+		/* Normal scanline composite */							\
+		if (pixman_fixed_to_int (vx) != src_width - 1 && width_remain > 0)		\
+		{										\
+		    /* for positive unit_x							\
+		     * num_pixels = max(n) + 1, where vx + n*unit_x < (src_width_fixed - 1)	\
+		     *										\
+		     * vx is in range [0, src_width_fixed - pixman_fixed_e]			\
+		     * So we are safe from overflow here.					\
+		     */										\
+		    num_pixels = ((src_width_fixed - pixman_fixed_1 - vx - pixman_fixed_e)	\
+				  / unit_x) + 1;						\
+												\
+		    if (num_pixels > width_remain)						\
+			num_pixels = width_remain;						\
+												\
+		    scanline_func (dst, mask, src_line_top, src_line_bottom, num_pixels,	\
+				   weight1, weight2, vx, unit_x, src_width_fixed, FALSE);	\
+												\
+		    width_remain -= num_pixels;							\
+		    vx += num_pixels * unit_x;							\
+		    dst += num_pixels;								\
+												\
+		    if (flags & FLAG_HAVE_NON_SOLID_MASK)					\
+		        mask += num_pixels;							\
+		}										\
+	    }											\
+	}											\
 	else											\
 	{											\
 	    scanline_func (dst, mask, src_first_line + src_stride * y1,				\

commit 2f025bad436982a2b1c54d7cb49b426ebf198350
Author: Taekyun Kim <tkq.kim@samsung.com>
Date:   Wed Jun 8 15:37:31 2011 +0900

    Replace boolean arguments with flags for bilinear fast path template
    
    By replacing boolean arguments with flags, the code can be more
    readable and flags can be extended to do some more things later.
    
    Currently following flags are defined.
    
    FLAG_NONE
        - No flags are turned on.
    
    FLAG_HAVE_SOLID_MASK
        - Template will generate solid mask composite functions.
    
    FLAG_HAVE_NON_SOLID_MASK
        - Template will generate bits mask composite functions.
    
    FLAG_HAVE_SOLID_MASK and FLAG_NON_SOLID_MASK should be mutually
    exclusive.

diff --git a/pixman/pixman-arm-common.h b/pixman/pixman-arm-common.h
index f7a10c4..524ae70 100644
--- a/pixman/pixman-arm-common.h
+++ b/pixman/pixman-arm-common.h
@@ -348,13 +348,13 @@ scaled_bilinear_scanline_##cputype##_##name##_##op (                          \
                                                                               \
 FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_cover_##op,                 \
                        scaled_bilinear_scanline_##cputype##_##name##_##op,    \
-                       src_type, uint32_t, dst_type, COVER, FALSE, FALSE)     \
+                       src_type, uint32_t, dst_type, COVER, FLAG_NONE)        \
 FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_none_##op,                  \
                        scaled_bilinear_scanline_##cputype##_##name##_##op,    \
-                       src_type, uint32_t, dst_type, NONE, FALSE, FALSE)      \
+                       src_type, uint32_t, dst_type, NONE, FLAG_NONE)         \
 FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_pad_##op,                   \
                        scaled_bilinear_scanline_##cputype##_##name##_##op,    \
-                       src_type, uint32_t, dst_type, PAD, FALSE, FALSE)
+                       src_type, uint32_t, dst_type, PAD, FLAG_NONE)
 
 
 #define PIXMAN_ARM_BIND_SCALED_BILINEAR_SRC_A8_DST(flags, cputype, name, op,  \
@@ -393,12 +393,15 @@ scaled_bilinear_scanline_##cputype##_##name##_##op (                          \
                                                                               \
 FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_cover_##op,                 \
                        scaled_bilinear_scanline_##cputype##_##name##_##op,    \
-                       src_type, uint8_t, dst_type, COVER, TRUE, FALSE)       \
+                       src_type, uint8_t, dst_type, COVER,                    \
+                       FLAG_HAVE_NON_SOLID_MASK)                              \
 FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_none_##op,                  \
                        scaled_bilinear_scanline_##cputype##_##name##_##op,    \
-                       src_type, uint8_t, dst_type, NONE, TRUE, FALSE)        \
+                       src_type, uint8_t, dst_type, NONE,                     \
+                       FLAG_HAVE_NON_SOLID_MASK)                              \
 FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_pad_##op,                   \
                        scaled_bilinear_scanline_##cputype##_##name##_##op,    \
-                       src_type, uint8_t, dst_type, PAD, TRUE, FALSE)
+                       src_type, uint8_t, dst_type, PAD,                      \
+                       FLAG_HAVE_NON_SOLID_MASK)
 
 #endif
diff --git a/pixman/pixman-fast-path.h b/pixman/pixman-fast-path.h
index fcbaa95..e00b1a6 100644
--- a/pixman/pixman-fast-path.h
+++ b/pixman/pixman-fast-path.h
@@ -30,6 +30,24 @@
 
 #define PIXMAN_REPEAT_COVER -1
 
+/* Flags describing input parameters to fast path macro template.
+ * Turning on some flag values may indicate that
+ * "some property X is available so template can use this" or
+ * "some property X should be handled by template".
+ *
+ * FLAG_HAVE_SOLID_MASK
+ *  Input mask is solid so template should handle this.
+ *
+ * FLAG_HAVE_NON_SOLID_MASK
+ *  Input mask is bits mask so template should handle this.
+ *
+ * FLAG_HAVE_SOLID_MASK and FLAG_HAVE_NON_SOLID_MASK are mutually
+ * exclusive. (It's not allowed to turn both flags on)
+ */
+#define FLAG_NONE				(0)
+#define FLAG_HAVE_SOLID_MASK			(1 <<   1)
+#define FLAG_HAVE_NON_SOLID_MASK		(1 <<   2)
+
 static force_inline pixman_bool_t
 repeat (pixman_repeat_t repeat, int *c, int size)
 {
@@ -651,7 +669,7 @@ bilinear_pad_repeat_get_scanline_bounds (int32_t         source_image_width,
  *       multiplication instructions.
  */
 #define FAST_BILINEAR_MAINLOOP_INT(scale_func_name, scanline_func, src_type_t, mask_type_t,	\
-				  dst_type_t, repeat_mode, have_mask, mask_is_solid)		\
+				  dst_type_t, repeat_mode, flags)				\
 static void											\
 fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,		\
 						   pixman_composite_info_t *info)		\
@@ -673,19 +691,17 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
     int src_stride, mask_stride, dst_stride;							\
 												\
     PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, dst_type_t, dst_stride, dst_line, 1);	\
-    if (have_mask)										\
+    if (flags & FLAG_HAVE_SOLID_MASK)								\
     {												\
-	if (mask_is_solid)									\
-	{											\
-	    solid_mask = _pixman_image_get_solid (imp, mask_image, dest_image->bits.format);	\
-	    mask_stride = 0;									\
-	}											\
-	else											\
-	{											\
-	    PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, mask_type_t,			\
-				   mask_stride, mask_line, 1);					\
-	}											\
+	solid_mask = _pixman_image_get_solid (imp, mask_image, dest_image->bits.format);	\
+	mask_stride = 0;									\
     }												\
+    else if (flags & FLAG_HAVE_NON_SOLID_MASK)							\
+    {												\
+	PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, mask_type_t,				\
+			       mask_stride, mask_line, 1);					\
+    }												\
+												\
     /* pass in 0 instead of src_x and src_y because src_x and src_y need to be			\
      * transformed from destination space to source space */					\
     PIXMAN_IMAGE_GET_LINE (src_image, 0, 0, src_type_t, src_stride, src_first_line, 1);		\
@@ -728,7 +744,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 	dst = dst_line;										\
 	dst_line += dst_stride;									\
 	vx = v.vector[0];									\
-	if (have_mask && !mask_is_solid)							\
+	if (flags & FLAG_HAVE_NON_SOLID_MASK)							\
 	{											\
 	    mask = mask_line;									\
 	    mask_line += mask_stride;								\
@@ -766,7 +782,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 		scanline_func (dst, mask,							\
 			       buf1, buf2, left_pad, weight1, weight2, 0, 0, 0, FALSE);		\
 		dst += left_pad;								\
-		if (have_mask && !mask_is_solid)						\
+		if (flags & FLAG_HAVE_NON_SOLID_MASK)						\
 		    mask += left_pad;								\
 	    }											\
 	    if (width > 0)									\
@@ -774,7 +790,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 		scanline_func (dst, mask,							\
 			       src1, src2, width, weight1, weight2, vx, unit_x, 0, FALSE);	\
 		dst += width;									\
-		if (have_mask && !mask_is_solid)						\
+		if (flags & FLAG_HAVE_NON_SOLID_MASK)						\
 		    mask += width;								\
 	    }											\
 	    if (right_pad > 0)									\
@@ -821,7 +837,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 		scanline_func (dst, mask,							\
 			       buf1, buf2, left_pad, weight1, weight2, 0, 0, 0, TRUE);		\
 		dst += left_pad;								\
-		if (have_mask && !mask_is_solid)						\
+		if (flags & FLAG_HAVE_NON_SOLID_MASK)						\
 		    mask += left_pad;								\
 	    }											\
 	    if (left_tz > 0)									\
@@ -834,7 +850,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 			       buf1, buf2, left_tz, weight1, weight2,				\
 			       pixman_fixed_frac (vx), unit_x, 0, FALSE);			\
 		dst += left_tz;									\
-		if (have_mask && !mask_is_solid)						\
+		if (flags & FLAG_HAVE_NON_SOLID_MASK)						\
 		    mask += left_tz;								\
 		vx += left_tz * unit_x;								\
 	    }											\
@@ -843,7 +859,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 		scanline_func (dst, mask,							\
 			       src1, src2, width, weight1, weight2, vx, unit_x, 0, FALSE);	\
 		dst += width;									\
-		if (have_mask && !mask_is_solid)						\
+		if (flags & FLAG_HAVE_NON_SOLID_MASK)						\
 		    mask += width;								\
 		vx += width * unit_x;								\
 	    }											\
@@ -857,7 +873,7 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 			       buf1, buf2, right_tz, weight1, weight2,				\
 			       pixman_fixed_frac (vx), unit_x, 0, FALSE);			\
 		dst += right_tz;								\
-		if (have_mask && !mask_is_solid)						\
+		if (flags & FLAG_HAVE_NON_SOLID_MASK)						\
 		    mask += right_tz;								\
 	    }											\
 	    if (right_pad > 0)									\
@@ -879,9 +895,9 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp,
 
 /* A workaround for old sun studio, see: https://bugs.freedesktop.org/show_bug.cgi?id=32764 */
 #define FAST_BILINEAR_MAINLOOP_COMMON(scale_func_name, scanline_func, src_type_t, mask_type_t,	\
-				  dst_type_t, repeat_mode, have_mask, mask_is_solid)		\
+				  dst_type_t, repeat_mode, flags)				\
 	FAST_BILINEAR_MAINLOOP_INT(_ ## scale_func_name, scanline_func, src_type_t, mask_type_t,\
-				  dst_type_t, repeat_mode, have_mask, mask_is_solid)
+				  dst_type_t, repeat_mode, flags)
 
 #define SCALED_BILINEAR_FLAGS						\
     (FAST_PATH_SCALE_TRANSFORM	|					\
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 79ef688..dd15ccd 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -5385,15 +5385,15 @@ scaled_bilinear_scanline_sse2_8888_8888_SRC (uint32_t *       dst,
 FAST_BILINEAR_MAINLOOP_COMMON (sse2_8888_8888_cover_SRC,
 			       scaled_bilinear_scanline_sse2_8888_8888_SRC,
 			       uint32_t, uint32_t, uint32_t,
-			       COVER, FALSE, FALSE)
+			       COVER, FLAG_NONE)
 FAST_BILINEAR_MAINLOOP_COMMON (sse2_8888_8888_pad_SRC,
 			       scaled_bilinear_scanline_sse2_8888_8888_SRC,
 			       uint32_t, uint32_t, uint32_t,
-			       PAD, FALSE, FALSE)
+			       PAD, FLAG_NONE)
 FAST_BILINEAR_MAINLOOP_COMMON (sse2_8888_8888_none_SRC,
 			       scaled_bilinear_scanline_sse2_8888_8888_SRC,
 			       uint32_t, uint32_t, uint32_t,
-			       NONE, FALSE, FALSE)
+			       NONE, FLAG_NONE)
 
 static const pixman_fast_path_t sse2_fast_paths[] =
 {

commit 4d4d1760e8118aaea06783079a3b87f83deb4907
Author: Søren Sandmann <ssp@redhat.com>
Date:   Sat Jun 25 10:16:25 2011 -0400

    test: Make fuzzer-find-diff.pl executable

diff --git a/test/fuzzer-find-diff.pl b/test/fuzzer-find-diff.pl
old mode 100644
new mode 100755

commit ece8d13bf77d050662bb9db9716576dabff37554
Author: Søren Sandmann <sandmann@cs.au.dk>
Date:   Sun Jun 19 20:29:08 2011 -0400

    ARM: Fix two bugs in neon_composite_over_n_8888_0565_ca().
    
    The first bug is that a vmull.u8 instruction would store its result in
    the q1 register, clobbering the d2 register used later on. The second
    is that a vraddhn instruction would overwrite d25, corrupting the q12
    register used later.
    
    Fixing the second bug caused a pipeline bubble where the d18 register
    would be unavailable for a clock cycle. This is fixed by swapping the
    instruction with its successor.

diff --git a/pixman/pixman-arm-neon-asm.S b/pixman/pixman-arm-neon-asm.S
index 833f18c..7cddf7e 100644
--- a/pixman/pixman-arm-neon-asm.S
+++ b/pixman/pixman-arm-neon-asm.S
@@ -1514,11 +1514,11 @@ generate_composite_function \
              * output: updated src in   {d0,  d1,  d2 }       [B, G, R]
              *         updated mask in  {d24, d25, d26}       [B, G, R]
              */
-            vmull.u8    q1,  d25, d9
+            vmull.u8    q6,  d26, d10
         vqadd.u8    q8,  q0, q8
             vmull.u8    q0,  d24, d8
         vqadd.u8    d22, d2, d22
-            vmull.u8    q6,  d26, d10
+            vmull.u8    q1,  d25, d9
         /*
          * convert the result in d16, d17, d22 to r5g6b5 and store
          * it into {d28, d29}
@@ -1541,6 +1541,7 @@ generate_composite_function \
             vrshr.u16   q11, q12, #8
             vrshr.u16   q8,  q9,  #8
             vrshr.u16   q6,  q13, #8
+            vraddhn.u16 d24, q12, q11
             vraddhn.u16 d25, q9,  q8
                 /*
                  * convert 8 r5g6b5 pixel data from {d4, d5} to planar
@@ -1549,11 +1550,10 @@ generate_composite_function \
                  */
                 vshrn.u16   d17, q2,  #3
                 vshrn.u16   d18, q2,  #8
-            vraddhn.u16 d24, q12, q11
             vraddhn.u16 d26, q13, q6
                 vsli.u16    q2,  q2,  #5
-                vsri.u8     d18, d18, #5
                 vsri.u8     d17, d17, #6
+                vsri.u8     d18, d18, #5
             /*
              * 'combine_over_ca' replacement
              *

commit 5715a394c41b2fd259ce7bf07b859d2a4eb2ec09
Author: Søren Sandmann Pedersen <ssp@redhat.com>
Date:   Sun Jun 19 19:10:45 2011 -0400

    blitters-test: Make common formats more likely to be tested.
    
    Move the eight most common formats to the top of the list of image
    formats and make create_random_image() much more likely to select one
    of those eight formats.
    
    This should help catch more bugs in SIMD optimized operations.

diff --git a/test/blitters-test.c b/test/blitters-test.c
index 3ecfb09..594ec54 100644
--- a/test/blitters-test.c
+++ b/test/blitters-test.c
@@ -14,6 +14,11 @@
 static pixman_indexed_t rgb_palette[9];
 static pixman_indexed_t y_palette[9];
 
+/* The first eight format in the list are by far the most widely
+ * used formats, so we test those more than the others
+ */
+#define N_MOST_LIKELY_FORMATS 8
+
 /* Create random image for testing purposes */
 static pixman_image_t *
 create_random_image (pixman_format_code_t *allowed_formats,
@@ -29,6 +34,9 @@ create_random_image (pixman_format_code_t *allowed_formats,
 
     while (allowed_formats[n] != PIXMAN_null)
 	n++;
+
+    if (n > N_MOST_LIKELY_FORMATS && lcg_rand_n (4) != 0)
+	n = N_MOST_LIKELY_FORMATS;
     fmt = allowed_formats[lcg_rand_n (n)];
 
     width = lcg_rand_n (max_width) + 1;
@@ -177,12 +185,14 @@ static pixman_op_t op_list[] = {
 
 static pixman_format_code_t img_fmt_list[] = {
     PIXMAN_a8r8g8b8,
+    PIXMAN_a8b8g8r8,
     PIXMAN_x8r8g8b8,
+    PIXMAN_x8b8g8r8,
     PIXMAN_r5g6b5,
-    PIXMAN_r3g3b2,
+    PIXMAN_b5g6r5,
     PIXMAN_a8,
-    PIXMAN_a8b8g8r8,
-    PIXMAN_x8b8g8r8,
+    PIXMAN_a1,
+    PIXMAN_r3g3b2,
     PIXMAN_b8g8r8a8,
     PIXMAN_b8g8r8x8,
     PIXMAN_r8g8b8a8,
@@ -190,8 +200,6 @@ static pixman_format_code_t img_fmt_list[] = {
     PIXMAN_x14r6g6b6,
     PIXMAN_r8g8b8,
     PIXMAN_b8g8r8,
-    PIXMAN_r5g6b5,
-    PIXMAN_b5g6r5,
     PIXMAN_x2r10g10b10,
     PIXMAN_a2r10g10b10,
     PIXMAN_x2b10g10r10,
@@ -204,7 +212,6 @@ static pixman_format_code_t img_fmt_list[] = {
     PIXMAN_x4r4g4b4,
     PIXMAN_a4b4g4r4,
     PIXMAN_x4b4g4r4,
-    PIXMAN_a8,
     PIXMAN_r3g3b2,
     PIXMAN_b2g3r3,
     PIXMAN_a2r2g2b2,
@@ -222,7 +229,6 @@ static pixman_format_code_t img_fmt_list[] = {
     PIXMAN_b1g2r1,
     PIXMAN_a1r1g1b1,
     PIXMAN_a1b1g1r1,
-    PIXMAN_a1,
     PIXMAN_null
 };
 
@@ -417,6 +423,6 @@ main (int argc, const char *argv[])
     }
 
     return fuzzer_test_main("blitters", 2000000,
-			    0x265CDFEB,
+			    0xB610300B,
 			    test_composite, argc, argv);
 }

commit d815a1c54ae6ea6ccd16dedb7f83db0d2526d637
Author: Andrea Canciani <ranma42@gmail.com>
Date:   Fri Jun 10 08:56:10 2011 +0200

    Silence autoconf warnings
    
    Autoconf 2.86 reports:
    
    warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body
    
    Every code fragment must be wrapped in [AC_LANG_SOURCE([...])]

diff --git a/configure.ac b/configure.ac
index 2defbd4..8ce9e19 100644
--- a/configure.ac
+++ b/configure.ac
@@ -90,7 +90,7 @@ AC_DEFUN([PIXMAN_LINK_WITH_ENV],[dnl
 	LIBS=""
 	$1
 	AC_LINK_IFELSE(
-		[$2],
+		[AC_LANG_SOURCE([$2])],
 		[pixman_cc_stderr=`test -f conftest.err && cat conftest.err`
 		 pixman_cc_flag=yes],
 		[pixman_cc_stderr=`test -f conftest.err && cat conftest.err`
@@ -290,7 +290,7 @@ have_mmx_intrinsics=no
 AC_MSG_CHECKING(whether to use MMX intrinsics)
 xserver_save_CFLAGS=$CFLAGS
 CFLAGS="$MMX_CFLAGS $CFLAGS"
-AC_COMPILE_IFELSE([
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
 error "Need GCC >= 3.4 for MMX intrinsics"
 #endif
@@ -298,7 +298,7 @@ error "Need GCC >= 3.4 for MMX intrinsics"
 int main () {
     __m64 v = _mm_cvtsi32_si64 (1);
     return _mm_cvtsi64_si32 (v);
-}], have_mmx_intrinsics=yes)
+}]])], have_mmx_intrinsics=yes)
 CFLAGS=$xserver_save_CFLAGS
 
 AC_ARG_ENABLE(mmx,
@@ -342,7 +342,7 @@ AC_MSG_CHECKING(whether to use SSE2 intrinsics)
 xserver_save_CFLAGS=$CFLAGS
 CFLAGS="$SSE2_CFLAGS $CFLAGS"
 
-AC_COMPILE_IFELSE([
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #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"
@@ -355,7 +355,7 @@ int main () {
     __m128i a = _mm_set1_epi32 (0), b = _mm_set1_epi32 (0), c;
 	c = _mm_xor_si128 (a, b);
     return 0;
-}], have_sse2_intrinsics=yes)
+}]])], have_sse2_intrinsics=yes)
 CFLAGS=$xserver_save_CFLAGS
 
 AC_ARG_ENABLE(sse2,
@@ -392,7 +392,7 @@ case $host_os in
 	 hwcap_save_LDFLAGS="$LDFLAGS"
 	 HWCAP_LDFLAGS='-Wl,-M,$(srcdir)/solaris-hwcap.mapfile'
 	 LDFLAGS="$LDFLAGS -Wl,-M,pixman/solaris-hwcap.mapfile"
-	 AC_LINK_IFELSE([int main() { return 0; }],
+	 AC_LINK_IFELSE([AC_LANG_SOURCE([[int main() { return 0; }]])],
 			use_hwcap_mapfile=yes,
 			HWCAP_LDFLAGS="")
 	 LDFLAGS="$hwcap_save_LDFLAGS"
@@ -424,7 +424,7 @@ have_vmx_intrinsics=no
 AC_MSG_CHECKING(whether to use VMX/Altivec intrinsics)
 xserver_save_CFLAGS=$CFLAGS
 CFLAGS="$VMX_CFLAGS $CFLAGS"
-AC_COMPILE_IFELSE([
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
 error "Need GCC >= 3.4 for sane altivec support"
 #endif
@@ -433,7 +433,7 @@ int main () {
     vector unsigned int v = vec_splat_u32 (1);
     v = vec_sub (v, v);
     return 0;
-}], have_vmx_intrinsics=yes)
+}]])], have_vmx_intrinsics=yes)
 CFLAGS=$xserver_save_CFLAGS
 
 AC_ARG_ENABLE(vmx,
@@ -466,7 +466,7 @@ have_arm_simd=no
 AC_MSG_CHECKING(whether to use ARM SIMD assembler)
 xserver_save_CFLAGS=$CFLAGS
 CFLAGS="-x assembler-with-cpp $CFLAGS"
-AC_COMPILE_IFELSE([[
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 .text
 .arch armv6
 .object_arch armv4
@@ -476,7 +476,7 @@ AC_COMPILE_IFELSE([[
 #error EABI is required (to be sure that calling conventions are compatible)
 #endif
 pld [r0]
-uqadd8 r0, r0, r0]], have_arm_simd=yes)
+uqadd8 r0, r0, r0]])], have_arm_simd=yes)
 CFLAGS=$xserver_save_CFLAGS
 
 AC_ARG_ENABLE(arm-simd,
@@ -505,7 +505,7 @@ have_arm_neon=no
 AC_MSG_CHECKING(whether to use ARM NEON assembler)
 xserver_save_CFLAGS=$CFLAGS
 CFLAGS="-x assembler-with-cpp $CFLAGS"
-AC_COMPILE_IFELSE([[
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 .text
 .fpu neon
 .arch armv7a
@@ -517,7 +517,7 @@ AC_COMPILE_IFELSE([[
 #error EABI is required (to be sure that calling conventions are compatible)
 #endif
 pld [r0]
-vmovn.u16 d0, q0]], have_arm_neon=yes)
+vmovn.u16 d0, q0]])], have_arm_neon=yes)
 CFLAGS=$xserver_save_CFLAGS
 
 AC_ARG_ENABLE(arm-neon,
@@ -545,12 +545,12 @@ dnl Check for GNU-style inline assembly support
 
 have_gcc_inline_asm=no
 AC_MSG_CHECKING(whether to use GNU-style inline assembler)
-AC_COMPILE_IFELSE([
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 int main () {
     /* Most modern architectures have a NOP instruction, so this is a fairly generic test. */
 	asm volatile ( "\tnop\n" : : : "cc", "memory" );
     return 0;
-}], have_gcc_inline_asm=yes)
+}]])], have_gcc_inline_asm=yes)
 
 AC_ARG_ENABLE(gcc-inline-asm,
    [AC_HELP_STRING([--disable-gcc-inline-asm],
@@ -685,7 +685,7 @@ dnl Thread local storage
 support_for__thread=no
 
 AC_MSG_CHECKING(for __thread)
-AC_LINK_IFELSE([
+AC_LINK_IFELSE([AC_LANG_SOURCE([[
 #if defined(__MINGW32__) && !(__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
 #error This MinGW version has broken __thread support
 #endif
@@ -694,7 +694,7 @@ AC_LINK_IFELSE([
 #endif
 static __thread int x ;
 int main () { x = 123; return x; }
-], support_for__thread=yes)
+]])], support_for__thread=yes)
 
 if test $support_for__thread = yes; then 
    AC_DEFINE([TOOLCHAIN_SUPPORTS__THREAD],[],[Whether the tool chain supports __thread])


Reply to: