Backout bug 828789 (bb755890ec69) because of bug 829335
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 10 Jan 2013 18:50:12 -0500
changeset 118352 8592c41069c206e8d522b4ed3734163ce01617d1
parent 118351 fc3ed72129d9f6709d1bf7706417d3d949e7c927
child 118353 c5cb5c111ea5e24ebc484c45dffba15a78ebd77f
child 118516 73d2891568afa1367c04984389958a3879d34283
push id24163
push userjmuizelaar@mozilla.com
push dateThu, 10 Jan 2013 23:59:56 +0000
treeherdermozilla-central@8592c41069c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs828789, 829335
milestone21.0a1
first release with
nightly linux32
8592c41069c2 / 21.0a1 / 20130111030906 / files
nightly linux64
8592c41069c2 / 21.0a1 / 20130111030906 / files
nightly mac
8592c41069c2 / 21.0a1 / 20130111030906 / files
nightly win32
8592c41069c2 / 21.0a1 / 20130111030906 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Backout bug 828789 (bb755890ec69) because of bug 829335 Backout pixman update. CLOSED TREE
gfx/cairo/libpixman/src/Makefile.in
gfx/cairo/libpixman/src/pixman-access.c
gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.S
gfx/cairo/libpixman/src/pixman-arm-neon-asm.S
gfx/cairo/libpixman/src/pixman-arm.c
gfx/cairo/libpixman/src/pixman-bits-image.c
gfx/cairo/libpixman/src/pixman-combine32.c
gfx/cairo/libpixman/src/pixman-combine32.h
gfx/cairo/libpixman/src/pixman-combine64.c
gfx/cairo/libpixman/src/pixman-combine64.h
gfx/cairo/libpixman/src/pixman-compiler.h
gfx/cairo/libpixman/src/pixman-conical-gradient.c
gfx/cairo/libpixman/src/pixman-fast-path.c
gfx/cairo/libpixman/src/pixman-general.c
gfx/cairo/libpixman/src/pixman-glyph.c
gfx/cairo/libpixman/src/pixman-image.c
gfx/cairo/libpixman/src/pixman-implementation.c
gfx/cairo/libpixman/src/pixman-inlines.h
gfx/cairo/libpixman/src/pixman-linear-gradient.c
gfx/cairo/libpixman/src/pixman-matrix.c
gfx/cairo/libpixman/src/pixman-mips-dspr2-asm.S
gfx/cairo/libpixman/src/pixman-mips-dspr2-asm.h
gfx/cairo/libpixman/src/pixman-mips-dspr2.c
gfx/cairo/libpixman/src/pixman-mips-dspr2.h
gfx/cairo/libpixman/src/pixman-mips-memcpy-asm.S
gfx/cairo/libpixman/src/pixman-mips.c
gfx/cairo/libpixman/src/pixman-mmx.c
gfx/cairo/libpixman/src/pixman-noop.c
gfx/cairo/libpixman/src/pixman-ppc.c
gfx/cairo/libpixman/src/pixman-private.h
gfx/cairo/libpixman/src/pixman-radial-gradient.c
gfx/cairo/libpixman/src/pixman-region.c
gfx/cairo/libpixman/src/pixman-solid-fill.c
gfx/cairo/libpixman/src/pixman-srgb.c
gfx/cairo/libpixman/src/pixman-sse2.c
gfx/cairo/libpixman/src/pixman-utils.c
gfx/cairo/libpixman/src/pixman-version.h
gfx/cairo/libpixman/src/pixman-vmx.c
gfx/cairo/libpixman/src/pixman-x86.c
gfx/cairo/libpixman/src/pixman.c
gfx/cairo/libpixman/src/pixman.h
--- a/gfx/cairo/libpixman/src/Makefile.in
+++ b/gfx/cairo/libpixman/src/Makefile.in
@@ -78,44 +78,39 @@ endif
 endif
 
 endif
 
 
 CSRCS	= \
 	pixman-access.c \
 	pixman-access-accessors.c \
-	pixman-arm.c \
 	pixman-bits-image.c \
 	pixman.c \
 	pixman-combine16.c \
 	pixman-combine32.c \
 	pixman-combine64.c \
 	pixman-conical-gradient.c \
+	pixman-cpu.c \
 	pixman-edge.c \
 	pixman-edge-accessors.c \
 	pixman-fast-path.c \
 	pixman-general.c \
 	pixman-gradient-walker.c \
-	pixman-glyph.c \
 	pixman-image.c \
 	pixman-implementation.c \
 	pixman-linear-gradient.c \
 	pixman-matrix.c \
-	pixman-mips.c \
 	pixman-noop.c \
-	pixman-ppc.c \
 	pixman-radial-gradient.c \
 	pixman-region16.c \
 	pixman-region32.c \
 	pixman-solid-fill.c \
-	pixman-srgb.c \
 	pixman-trap.c \
 	pixman-utils.c \
-	pixman-x86.c \
 	$(NULL)
 
 ifdef USE_MMX
 CSRCS += pixman-mmx.c
 DEFINES += -DUSE_MMX
 endif
 
 ifdef USE_SSE2
--- a/gfx/cairo/libpixman/src/pixman-access.c
+++ b/gfx/cairo/libpixman/src/pixman-access.c
@@ -27,18 +27,18 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 
+#include "pixman-private.h"
 #include "pixman-accessor.h"
-#include "pixman-private.h"
 
 #define CONVERT_RGB24_TO_Y15(s)						\
     (((((s) >> 16) & 0xff) * 153 +					\
       (((s) >>  8) & 0xff) * 301 +					\
       (((s)      ) & 0xff) * 58) >> 2)
 
 #define CONVERT_RGB24_TO_RGB15(s)                                       \
     ((((s) >> 3) & 0x001f) |                                            \
@@ -205,17 +205,16 @@ get_shifts (pixman_format_code_t  format
     case PIXMAN_TYPE_A:
 	*b = 0;
 	*g = 0;
 	*r = 0;
 	*a = 0;
 	break;
 
     case PIXMAN_TYPE_ARGB:
-    case PIXMAN_TYPE_ARGB_SRGB:
 	*b = 0;
 	*g = *b + PIXMAN_FORMAT_B (format);
 	*r = *g + PIXMAN_FORMAT_G (format);
 	*a = *r + PIXMAN_FORMAT_R (format);
 	break;
 
     case PIXMAN_TYPE_ABGR:
 	*r = 0;
@@ -1061,140 +1060,16 @@ fetch_pixel_generic_64 (bits_image_t *im
 	format = PIXMAN_a8r8g8b8;
     }
 
     pixman_expand ((uint64_t *)&result, &pixel32, format, 1);
 
     return result;
 }
 
-/* The 32_sRGB paths should be deleted after narrow processing
- * is no longer invoked for formats that are considered wide.
- * (Also see fetch_pixel_generic_lossy_32) */
-static void
-fetch_scanline_a8r8g8b8_32_sRGB (pixman_image_t *image,
-                                 int             x,
-                                 int             y,
-                                 int             width,
-                                 uint32_t       *buffer,
-                                 const uint32_t *mask)
-{
-    const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
-    const uint32_t *pixel = (uint32_t *)bits + x;
-    const uint32_t *end = pixel + width;
-    uint32_t tmp;
-    
-    while (pixel < end)
-    {
-	tmp = READ (image, pixel++);
-	*buffer++ =                 (tmp >> 24)               << 24
-		  | (srgb_to_linear[(tmp >> 16) & 0xff] >> 8) << 16
-		  | (srgb_to_linear[(tmp >>  8) & 0xff] >> 8) <<  8
-		  | (srgb_to_linear[(tmp >>  0) & 0xff] >> 8) <<  0;
-    }
-}
-
-static void
-fetch_scanline_a8r8g8b8_64_sRGB (pixman_image_t *image,
-                                 int             x,
-                                 int             y,
-                                 int             width,
-                                 uint32_t       *b,
-                                 const uint32_t *mask)
-{
-    const uint32_t *bits = image->bits.bits + y * image->bits.rowstride;
-    const uint32_t *pixel = (uint32_t *)bits + x;
-    const uint32_t *end = pixel + width;
-    uint64_t *buffer = (uint64_t *)b;
-    uint32_t tmp;
-    
-    while (pixel < end)
-    {
-	tmp = READ (image, pixel++);
-	*buffer++ = (uint64_t)               ((tmp >> 24) * 257)  << 48
-		  | (uint64_t) srgb_to_linear[(tmp >> 16) & 0xff] << 32
-		  | (uint64_t) srgb_to_linear[(tmp >>  8) & 0xff] << 16
-		  | (uint64_t) srgb_to_linear[(tmp >>  0) & 0xff] <<  0;
-    }
-}
-
-static uint32_t
-fetch_pixel_a8r8g8b8_32_sRGB (bits_image_t *image,
-			      int           offset,
-			      int           line)
-{
-    uint32_t *bits = image->bits + line * image->rowstride;
-    uint32_t tmp = READ (image, bits + offset);
-    return                 (tmp >> 24)               << 24
-	 | (srgb_to_linear[(tmp >> 16) & 0xff] >> 8) << 16
-	 | (srgb_to_linear[(tmp >>  8) & 0xff] >> 8) <<  8
-	 | (srgb_to_linear[(tmp >>  0) & 0xff] >> 8) <<  0;
-}
-
-static uint64_t
-fetch_pixel_a8r8g8b8_64_sRGB (bits_image_t *image,
-			      int           offset,
-			      int	    line)
-{
-    uint32_t *bits = image->bits + line * image->rowstride;
-    uint32_t tmp = READ (image, bits + offset);
-    return (uint64_t)               ((tmp >> 24) * 257)  << 48
-	 | (uint64_t) srgb_to_linear[(tmp >> 16) & 0xff] << 32
-	 | (uint64_t) srgb_to_linear[(tmp >>  8) & 0xff] << 16
-	 | (uint64_t) srgb_to_linear[(tmp >>  0) & 0xff] <<  0;
-}
-
-static void
-store_scanline_a8r8g8b8_32_sRGB (bits_image_t   *image,
-                                 int             x,
-                                 int             y,
-                                 int             width,
-                                 const uint32_t *v)
-{
-    uint32_t *bits = image->bits + image->rowstride * y;
-    uint64_t *values = (uint64_t *)v;
-    uint32_t *pixel = bits + x;
-    uint64_t tmp;
-    int i;
-    
-    for (i = 0; i < width; ++i)
-    {
-	tmp = values[i];
-	WRITE (image, pixel++,
-		  ((uint32_t)     (tmp >> 24     )          << 24)
-		| (linear_to_srgb[(tmp >> 16 << 4) & 0xfff] << 16)
-		| (linear_to_srgb[(tmp >>  8 << 4) & 0xfff] <<  8)
-		| (linear_to_srgb[(tmp >>  0 << 4) & 0xfff] <<  0));
-    }
-}
-
-static void
-store_scanline_a8r8g8b8_64_sRGB (bits_image_t  *image,
-                                int             x,
-                                int             y,
-                                int             width,
-                                const uint32_t *v)
-{
-    uint32_t *bits = image->bits + image->rowstride * y;
-    uint64_t *values = (uint64_t *)v;
-    uint32_t *pixel = bits + x;
-    uint64_t tmp;
-    int i;
-    
-    for (i = 0; i < width; ++i)
-    {
-	tmp = values[i];
-	WRITE (image, pixel++,
-		  ((uint32_t)     (tmp >> 56)          << 24)
-		| (linear_to_srgb[(tmp >> 36) & 0xfff] << 16)
-		| (linear_to_srgb[(tmp >> 20) & 0xfff] <<  8)
-		| (linear_to_srgb[(tmp >>  4) & 0xfff] <<  0));
-    }
-}
-
 /*
  * 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 uint32_t
 fetch_pixel_generic_lossy_32 (bits_image_t *image,
@@ -1252,23 +1127,16 @@ static const format_info_t accessors[] =
     FORMAT_INFO (a8b8g8r8),
     FORMAT_INFO (x8b8g8r8),
     FORMAT_INFO (b8g8r8a8),
     FORMAT_INFO (b8g8r8x8),
     FORMAT_INFO (r8g8b8a8),
     FORMAT_INFO (r8g8b8x8),
     FORMAT_INFO (x14r6g6b6),
 
-/* sRGB formats */
-  { PIXMAN_a8r8g8b8_sRGB,
-    fetch_scanline_a8r8g8b8_32_sRGB,
-    fetch_scanline_a8r8g8b8_64_sRGB,
-    fetch_pixel_a8r8g8b8_32_sRGB, fetch_pixel_a8r8g8b8_64_sRGB,
-    store_scanline_a8r8g8b8_32_sRGB, store_scanline_a8r8g8b8_64_sRGB },
-
 /* 24bpp formats */
     FORMAT_INFO (r8g8b8),
     FORMAT_INFO (b8g8r8),
     
 /* 16bpp formats */
     FORMAT_INFO16 (r5g6b5),
     FORMAT_INFO16 (b5g6r5),
     
--- a/gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.S
+++ b/gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.S
@@ -59,17 +59,16 @@
 .arch armv7a
 .object_arch armv4
 .eabi_attribute 10, 0
 .eabi_attribute 12, 0
 .arm
 .altmacro
 .p2align 2
 
-#include "pixman-private.h"
 #include "pixman-arm-neon-asm.h"
 
 /*
  * Bilinear macros from pixman-arm-neon-asm.S
  */
 
 /* Supplementary macro for setting function attributes */
 .macro pixman_asm_function fname
@@ -484,22 +483,22 @@ fname:
 
 .macro bilinear_interpolate_last_pixel src_fmt, mask_fmt, dst_fmt, op
     bilinear_load_&src_fmt d0, d1, d2
     bilinear_load_mask mask_fmt, 1, d4
     bilinear_load_dst dst_fmt, op, 1, d18, d19, q9
     vmull.u8  q1, d0, d28
     vmlal.u8  q1, d1, d29
     /* 5 cycles bubble */
-    vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d2, #8
     vmlsl.u16 q0, d2, d30
     vmlal.u16 q0, d3, d30
     /* 5 cycles bubble */
     bilinear_duplicate_mask mask_fmt, 1, d4
-    vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32 d0, q0, #16
     /* 3 cycles bubble */
     vmovn.u16 d0, q0
     /* 1 cycle bubble */
     bilinear_interleave_src_dst \
                 mask_fmt, op, 1, d0, d1, q0, d18, d19, q9
     bilinear_apply_mask_to_src \
                 mask_fmt, 1, d0, d1, q0, d4, \
                 q3, q8, q10, q11
@@ -510,26 +509,26 @@ fname:
     bilinear_store_&dst_fmt 1, q2, q3
 .endm
 
 .macro bilinear_interpolate_two_pixels src_fmt, mask_fmt, dst_fmt, op
     bilinear_load_and_vertical_interpolate_two_&src_fmt \
                 q1, q11, d0, d1, d20, d21, d22, d23
     bilinear_load_mask mask_fmt, 2, d4
     bilinear_load_dst dst_fmt, op, 2, d18, d19, q9
-    vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d2, #8
     vmlsl.u16 q0, d2, d30
     vmlal.u16 q0, d3, d30
-    vshll.u16 q10, d22, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q10, d22, #8
     vmlsl.u16 q10, d22, d31
     vmlal.u16 q10, d23, d31
-    vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32 d0, q0, #16
+    vshrn.u32 d1, q10, #16
     bilinear_duplicate_mask mask_fmt, 2, d4
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16  q15, q12, #8
     vadd.u16  q12, q12, q13
     vmovn.u16 d0, q0
     bilinear_interleave_src_dst \
                 mask_fmt, op, 2, d0, d1, q0, d18, d19, q9
     bilinear_apply_mask_to_src \
                 mask_fmt, 2, d0, d1, q0, d4, \
                 q3, q8, q10, q11
     bilinear_combine \
@@ -540,39 +539,39 @@ fname:
 .endm
 
 .macro bilinear_interpolate_four_pixels src_fmt, mask_fmt, dst_fmt, op
     bilinear_load_and_vertical_interpolate_four_&src_fmt \
                 q1, q11, d0, d1, d20, d21, d22, d23 \
                 q3, q9,  d4, d5, d16, d17, d18, d19
     pld       [TMP1, PF_OFFS]
     sub       TMP1, TMP1, STRIDE
-    vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d2, #8
     vmlsl.u16 q0, d2, d30
     vmlal.u16 q0, d3, d30
-    vshll.u16 q10, d22, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q10, d22, #8
     vmlsl.u16 q10, d22, d31
     vmlal.u16 q10, d23, d31
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-    vshll.u16 q2, d6, #BILINEAR_INTERPOLATION_BITS
+    vshr.u16  q15, q12, #8
+    vshll.u16 q2, d6, #8
     vmlsl.u16 q2, d6, d30
     vmlal.u16 q2, d7, d30
-    vshll.u16 q8, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q8, d18, #8
     bilinear_load_mask mask_fmt, 4, d22
     bilinear_load_dst dst_fmt, op, 4, d2, d3, q1
     pld       [TMP1, PF_OFFS]
     vmlsl.u16 q8, d18, d31
     vmlal.u16 q8, d19, d31
     vadd.u16  q12, q12, q13
-    vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d5, q8, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32 d0, q0, #16
+    vshrn.u32 d1, q10, #16
+    vshrn.u32 d4, q2, #16
+    vshrn.u32 d5, q8, #16
     bilinear_duplicate_mask mask_fmt, 4, d22
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16  q15, q12, #8
     vmovn.u16 d0, q0
     vmovn.u16 d1, q2
     vadd.u16  q12, q12, q13
     bilinear_interleave_src_dst \
                 mask_fmt, op, 4, d0, d1, q0, d2, d3, q1
     bilinear_apply_mask_to_src \
                 mask_fmt, 4, d0, d1, q0, d22, \
                 q3, q8, q9, q10
@@ -690,23 +689,23 @@ pixman_asm_function fname
     vdup.u8   d29, WB
     vadd.u16  d25, d25, d26
 
     /* ensure good destination alignment  */
     cmp       WIDTH, #1
     blt       0f
     tst       OUT, #(1 << dst_bpp_shift)
     beq       0f
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16  q15, q12, #8
     vadd.u16  q12, q12, q13
     bilinear_process_last_pixel
     sub       WIDTH, WIDTH, #1
 0:
     vadd.u16  q13, q13, q13
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16  q15, q12, #8
     vadd.u16  q12, q12, q13
 
     cmp       WIDTH, #2
     blt       0f
     tst       OUT, #(1 << (dst_bpp_shift + 1))
     beq       0f
     bilinear_process_two_pixels
     sub       WIDTH, WIDTH, #2
@@ -917,48 +916,48 @@ 3:
     vmull.u8    q9, d22, d28
     vmlal.u8    q9, d23, d29
 
     vld1.32     {d22}, [TMP3], STRIDE
     vld1.32     {d23}, [TMP3]
     vmull.u8    q10, d22, d28
     vmlal.u8    q10, d23, d29
 
-    vshll.u16   q0, d16, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16   q0, d16, #8
     vmlsl.u16   q0, d16, d30
     vmlal.u16   q0, d17, d30
 
     pld         [TMP4, PF_OFFS]
     vld1.32     {d16}, [TMP4], STRIDE
     vld1.32     {d17}, [TMP4]
     pld         [TMP4, PF_OFFS]
     vmull.u8    q11, d16, d28
     vmlal.u8    q11, d17, d29
 
-    vshll.u16   q1, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16   q1, d18, #8
     vmlsl.u16   q1, d18, d31
     vmlal.u16   q1, d19, d31
-    vshr.u16    q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16    q15, q12, #8
     vadd.u16    q12, q12, q13
 .endm
 
 .macro bilinear_over_8888_8888_process_pixblock_tail
-    vshll.u16   q2, d20, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16   q2, d20, #8
     vmlsl.u16   q2, d20, d30
     vmlal.u16   q2, d21, d30
-    vshll.u16   q3, d22, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16   q3, d22, #8
     vmlsl.u16   q3, d22, d31
     vmlal.u16   q3, d23, d31
-    vshrn.u32   d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32   d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32   d0, q0, #16
+    vshrn.u32   d1, q1, #16
     vld1.32     {d2, d3}, [OUT, :128]
     pld         [OUT, #(prefetch_offset * 4)]
-    vshrn.u32   d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshr.u16    q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32   d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32   d4, q2, #16
+    vshr.u16    q15, q12, #8
+    vshrn.u32   d5, q3, #16
     vmovn.u16   d6, q0
     vmovn.u16   d7, q2
     vuzp.8      d6, d7
     vuzp.8      d2, d3
     vuzp.8      d6, d7
     vuzp.8      d2, d3
     vdup.32     d4, d7[1]
     vmvn.8      d4, d4
@@ -971,40 +970,40 @@ 3:
     vqadd.u8    q3, q1, q3
     vuzp.8      d6, d7
     vuzp.8      d6, d7
     vadd.u16    q12, q12, q13
     vst1.32     {d6, d7}, [OUT, :128]!
 .endm
 
 .macro bilinear_over_8888_8888_process_pixblock_tail_head
-                                            vshll.u16   q2, d20, #BILINEAR_INTERPOLATION_BITS
+                                            vshll.u16   q2, d20, #8
     mov         TMP1, X, asr #16
     add         X, X, UX
     add         TMP1, TOP, TMP1, asl #2
                                             vmlsl.u16   q2, d20, d30
     mov         TMP2, X, asr #16
     add         X, X, UX
     add         TMP2, TOP, TMP2, asl #2
                                             vmlal.u16   q2, d21, d30
-                                            vshll.u16   q3, d22, #BILINEAR_INTERPOLATION_BITS
+                                            vshll.u16   q3, d22, #8
     vld1.32     {d20}, [TMP1], STRIDE
                                             vmlsl.u16   q3, d22, d31
                                             vmlal.u16   q3, d23, d31
     vld1.32     {d21}, [TMP1]
     vmull.u8    q8, d20, d28
     vmlal.u8    q8, d21, d29
-                                            vshrn.u32   d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-                                            vshrn.u32   d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
+                                            vshrn.u32   d0, q0, #16
+                                            vshrn.u32   d1, q1, #16
                                             vld1.32     {d2, d3}, [OUT, :128]
                                             pld         [OUT, PF_OFFS]
-                                            vshrn.u32   d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
-                                            vshr.u16    q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+                                            vshrn.u32   d4, q2, #16
+                                            vshr.u16    q15, q12, #8
     vld1.32     {d22}, [TMP2], STRIDE
-                                            vshrn.u32   d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
+                                            vshrn.u32   d5, q3, #16
                                             vmovn.u16   d6, q0
     vld1.32     {d23}, [TMP2]
     vmull.u8    q9, d22, d28
     mov         TMP3, X, asr #16
     add         X, X, UX
     add         TMP3, TOP, TMP3, asl #2
     mov         TMP4, X, asr #16
     add         X, X, UX
@@ -1018,37 +1017,37 @@ 3:
                                             vuzp.8      d2, d3
                                             vdup.32     d4, d7[1]
     vld1.32     {d23}, [TMP3]
                                             vmvn.8      d4, d4
     vmull.u8    q10, d22, d28
     vmlal.u8    q10, d23, d29
                                             vmull.u8    q11, d2, d4
                                             vmull.u8    q2, d3, d4
-    vshll.u16   q0, d16, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16   q0, d16, #8
     vmlsl.u16   q0, d16, d30
                                             vrshr.u16   q1, q11, #8
     vmlal.u16   q0, d17, d30
                                             vrshr.u16   q8, q2, #8
                                             vraddhn.u16 d2, q1, q11
                                             vraddhn.u16 d3, q8, q2
     pld         [TMP4, PF_OFFS]
     vld1.32     {d16}, [TMP4], STRIDE
                                             vqadd.u8    q3, q1, q3
     vld1.32     {d17}, [TMP4]
     pld         [TMP4, PF_OFFS]
     vmull.u8    q11, d16, d28
     vmlal.u8    q11, d17, d29
                                             vuzp.8      d6, d7
-    vshll.u16   q1, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16   q1, d18, #8
                                             vuzp.8      d6, d7
     vmlsl.u16   q1, d18, d31
                                             vadd.u16    q12, q12, q13
     vmlal.u16   q1, d19, d31
-    vshr.u16    q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16    q15, q12, #8
     vadd.u16    q12, q12, q13
                                             vst1.32     {d6, d7}, [OUT, :128]!
 .endm
 
 /* over_8888_8_8888 */
 .macro bilinear_over_8888_8_8888_process_last_pixel
     bilinear_interpolate_last_pixel 8888, 8, 8888, over
 .endm
@@ -1077,53 +1076,53 @@ 3:
     mov         TMP4, X, asr #16
     add         X, X, UX
     add         TMP4, TOP, TMP4, asl #2
     vld1.32     {d3}, [TMP2]
     vmull.u8    q2, d0, d28
     vmull.u8    q3, d2, d28
     vmlal.u8    q2, d1, d29
     vmlal.u8    q3, d3, d29
-    vshll.u16   q0, d4, #BILINEAR_INTERPOLATION_BITS
-    vshll.u16   q1, d6, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16   q0, d4, #8
+    vshll.u16   q1, d6, #8
     vmlsl.u16   q0, d4, d30
     vmlsl.u16   q1, d6, d31
     vmlal.u16   q0, d5, d30
     vmlal.u16   q1, d7, d31
-    vshrn.u32   d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32   d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32   d0, q0, #16
+    vshrn.u32   d1, q1, #16
     vld1.32     {d2}, [TMP3], STRIDE
     vld1.32     {d3}, [TMP3]
     pld         [TMP4, PF_OFFS]
     vld1.32     {d4}, [TMP4], STRIDE
     vld1.32     {d5}, [TMP4]
     pld         [TMP4, PF_OFFS]
     vmull.u8    q3, d2, d28
     vmlal.u8    q3, d3, d29
     vmull.u8    q1, d4, d28
     vmlal.u8    q1, d5, d29
-    vshr.u16    q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16    q15, q12, #8
     vld1.32     {d22[0]}, [MASK]!
     pld         [MASK, #prefetch_offset]
     vadd.u16    q12, q12, q13
     vmovn.u16   d16, q0
 .endm
 
 .macro bilinear_over_8888_8_8888_process_pixblock_tail
-    vshll.u16   q9, d6, #BILINEAR_INTERPOLATION_BITS
-    vshll.u16   q10, d2, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16   q9, d6, #8
+    vshll.u16   q10, d2, #8
     vmlsl.u16   q9, d6, d30
     vmlsl.u16   q10, d2, d31
     vmlal.u16   q9, d7, d30
     vmlal.u16   q10, d3, d31
-    vshr.u16    q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16    q15, q12, #8
     vadd.u16    q12, q12, q13
     vdup.32     d22, d22[0]
-    vshrn.u32   d18, q9, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32   d19, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32   d18, q9, #16
+    vshrn.u32   d19, q10, #16
     vmovn.u16   d17, q9
     vld1.32     {d18, d19}, [OUT, :128]
     pld         [OUT, PF_OFFS]
     vuzp.8      d16, d17
     vuzp.8      d18, d19
     vuzp.8      d16, d17
     vuzp.8      d18, d19
     vmull.u8    q10, d16, d22
@@ -1142,66 +1141,66 @@ 3:
     vraddhn.u16 d19, q0, q11
     vqadd.u8    q9, q8, q9
     vuzp.8      d18, d19
     vuzp.8      d18, d19
     vst1.32     {d18, d19}, [OUT, :128]!
 .endm
 
 .macro bilinear_over_8888_8_8888_process_pixblock_tail_head
-                                            vshll.u16   q9, d6, #BILINEAR_INTERPOLATION_BITS
+                                            vshll.u16   q9, d6, #8
     mov         TMP1, X, asr #16
     add         X, X, UX
     add         TMP1, TOP, TMP1, asl #2
-                                            vshll.u16   q10, d2, #BILINEAR_INTERPOLATION_BITS
+                                            vshll.u16   q10, d2, #8
     vld1.32     {d0}, [TMP1], STRIDE
     mov         TMP2, X, asr #16
     add         X, X, UX
     add         TMP2, TOP, TMP2, asl #2
                                             vmlsl.u16   q9, d6, d30
                                             vmlsl.u16   q10, d2, d31
     vld1.32     {d1}, [TMP1]
     mov         TMP3, X, asr #16
     add         X, X, UX
     add         TMP3, TOP, TMP3, asl #2
                                             vmlal.u16   q9, d7, d30
                                             vmlal.u16   q10, d3, d31
     vld1.32     {d2}, [TMP2], STRIDE
     mov         TMP4, X, asr #16
     add         X, X, UX
     add         TMP4, TOP, TMP4, asl #2
-                                            vshr.u16    q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+                                            vshr.u16    q15, q12, #8
                                             vadd.u16    q12, q12, q13
     vld1.32     {d3}, [TMP2]
                                             vdup.32     d22, d22[0]
-                                            vshrn.u32   d18, q9, #(2 * BILINEAR_INTERPOLATION_BITS)
-                                            vshrn.u32   d19, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
+                                            vshrn.u32   d18, q9, #16
+                                            vshrn.u32   d19, q10, #16
     vmull.u8    q2, d0, d28
     vmull.u8    q3, d2, d28
                                             vmovn.u16   d17, q9
                                             vld1.32     {d18, d19}, [OUT, :128]
                                             pld         [OUT, #(prefetch_offset * 4)]
     vmlal.u8    q2, d1, d29
     vmlal.u8    q3, d3, d29
                                             vuzp.8      d16, d17
                                             vuzp.8      d18, d19
-    vshll.u16   q0, d4, #BILINEAR_INTERPOLATION_BITS
-    vshll.u16   q1, d6, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16   q0, d4, #8
+    vshll.u16   q1, d6, #8
                                             vuzp.8      d16, d17
                                             vuzp.8      d18, d19
     vmlsl.u16   q0, d4, d30
     vmlsl.u16   q1, d6, d31
                                             vmull.u8    q10, d16, d22
                                             vmull.u8    q11, d17, d22
     vmlal.u16   q0, d5, d30
     vmlal.u16   q1, d7, d31
                                             vrsra.u16   q10, q10, #8
                                             vrsra.u16   q11, q11, #8
-    vshrn.u32   d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32   d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32   d0, q0, #16
+    vshrn.u32   d1, q1, #16
                                             vrshrn.u16  d16, q10, #8
                                             vrshrn.u16  d17, q11, #8
     vld1.32     {d2}, [TMP3], STRIDE
                                             vdup.32     d22, d17[1]
     vld1.32     {d3}, [TMP3]
                                             vmvn.8      d22, d22
     pld         [TMP4, PF_OFFS]
     vld1.32     {d4}, [TMP4], STRIDE
@@ -1212,17 +1211,17 @@ 3:
     vmull.u8    q3, d2, d28
                                             vrshr.u16   q9, q10, #8
                                             vrshr.u16   q15, q11, #8
     vmlal.u8    q3, d3, d29
     vmull.u8    q1, d4, d28
                                             vraddhn.u16 d18, q9, q10
                                             vraddhn.u16 d19, q15, q11
     vmlal.u8    q1, d5, d29
-    vshr.u16    q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16    q15, q12, #8
                                             vqadd.u8    q9, q8, q9
     vld1.32     {d22[0]}, [MASK]!
                                             vuzp.8      d18, d19
     vadd.u16    q12, q12, q13
                                             vuzp.8      d18, d19
     vmovn.u16   d16, q0
                                             vst1.32     {d18, d19}, [OUT, :128]!
 .endm
--- a/gfx/cairo/libpixman/src/pixman-arm-neon-asm.S
+++ b/gfx/cairo/libpixman/src/pixman-arm-neon-asm.S
@@ -44,17 +44,16 @@
     .arch armv7a
     .object_arch armv4
     .eabi_attribute 10, 0 /* suppress Tag_FP_arch */
     .eabi_attribute 12, 0 /* suppress Tag_Advanced_SIMD_arch */
     .arm
     .altmacro
     .p2align 2
 
-#include "pixman-private.h"
 #include "pixman-arm-neon-asm.h"
 
 /* Global configuration options and preferences */
 
 /*
  * The code can optionally make use of unaligned memory accesses to improve
  * performance of handling leading/trailing pixels for each scanline.
  * Configuration variable RESPECT_STRICT_ALIGNMENT can be set to 0 for
@@ -2982,70 +2981,70 @@ fname:
 .endif
 .endm
 
 .macro bilinear_interpolate_last_pixel src_fmt, dst_fmt
     bilinear_load_&src_fmt d0, d1, d2
     vmull.u8  q1, d0, d28
     vmlal.u8  q1, d1, d29
     /* 5 cycles bubble */
-    vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d2, #8
     vmlsl.u16 q0, d2, d30
     vmlal.u16 q0, d3, d30
     /* 5 cycles bubble */
-    vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32 d0, q0, #16
     /* 3 cycles bubble */
     vmovn.u16 d0, q0
     /* 1 cycle bubble */
     bilinear_store_&dst_fmt 1, q2, q3
 .endm
 
 .macro bilinear_interpolate_two_pixels src_fmt, dst_fmt
     bilinear_load_and_vertical_interpolate_two_&src_fmt \
                 q1, q11, d0, d1, d20, d21, d22, d23
-    vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d2, #8
     vmlsl.u16 q0, d2, d30
     vmlal.u16 q0, d3, d30
-    vshll.u16 q10, d22, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q10, d22, #8
     vmlsl.u16 q10, d22, d31
     vmlal.u16 q10, d23, d31
-    vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32 d0, q0, #16
+    vshrn.u32 d1, q10, #16
+    vshr.u16  q15, q12, #8
     vadd.u16  q12, q12, q13
     vmovn.u16 d0, q0
     bilinear_store_&dst_fmt 2, q2, q3
 .endm
 
 .macro bilinear_interpolate_four_pixels src_fmt, dst_fmt
     bilinear_load_and_vertical_interpolate_four_&src_fmt \
                 q1, q11, d0, d1, d20, d21, d22, d23 \
                 q3, q9,  d4, d5, d16, d17, d18, d19
     pld       [TMP1, PF_OFFS]
     sub       TMP1, TMP1, STRIDE
-    vshll.u16 q0, d2, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d2, #8
     vmlsl.u16 q0, d2, d30
     vmlal.u16 q0, d3, d30
-    vshll.u16 q10, d22, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q10, d22, #8
     vmlsl.u16 q10, d22, d31
     vmlal.u16 q10, d23, d31
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-    vshll.u16 q2, d6, #BILINEAR_INTERPOLATION_BITS
+    vshr.u16  q15, q12, #8
+    vshll.u16 q2, d6, #8
     vmlsl.u16 q2, d6, d30
     vmlal.u16 q2, d7, d30
-    vshll.u16 q8, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q8, d18, #8
     pld       [TMP2, PF_OFFS]
     vmlsl.u16 q8, d18, d31
     vmlal.u16 q8, d19, d31
     vadd.u16  q12, q12, q13
-    vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d1, q10, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d5, q8, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32 d0, q0, #16
+    vshrn.u32 d1, q10, #16
+    vshrn.u32 d4, q2, #16
+    vshrn.u32 d5, q8, #16
+    vshr.u16  q15, q12, #8
     vmovn.u16 d0, q0
     vmovn.u16 d1, q2
     vadd.u16  q12, q12, q13
     bilinear_store_&dst_fmt 4, q2, q3
 .endm
 
 .macro bilinear_interpolate_four_pixels_head src_fmt, dst_fmt
 .ifdef have_bilinear_interpolate_four_pixels_&src_fmt&_&dst_fmt
@@ -3154,23 +3153,23 @@ pixman_asm_function fname
     vdup.u8   d29, WB
     vadd.u16  d25, d25, d26
 
     /* ensure good destination alignment  */
     cmp       WIDTH, #1
     blt       0f
     tst       OUT, #(1 << dst_bpp_shift)
     beq       0f
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16  q15, q12, #8
     vadd.u16  q12, q12, q13
     bilinear_interpolate_last_pixel src_fmt, dst_fmt
     sub       WIDTH, WIDTH, #1
 0:
     vadd.u16  q13, q13, q13
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+    vshr.u16  q15, q12, #8
     vadd.u16  q12, q12, q13
 
     cmp       WIDTH, #2
     blt       0f
     tst       OUT, #(1 << (dst_bpp_shift + 1))
     beq       0f
     bilinear_interpolate_two_pixels src_fmt, dst_fmt
     sub       WIDTH, WIDTH, #2
@@ -3278,105 +3277,105 @@ 3:
     vmull.u8  q9, d22, d28
     vmlal.u8  q9, d23, d29
 
     vld1.32   {d22}, [TMP3], STRIDE
     vld1.32   {d23}, [TMP3]
     vmull.u8  q10, d22, d28
     vmlal.u8  q10, d23, d29
 
-    vshll.u16 q0, d16, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d16, #8
     vmlsl.u16 q0, d16, d30
     vmlal.u16 q0, d17, d30
 
     pld       [TMP4, PF_OFFS]
     vld1.32   {d16}, [TMP4], STRIDE
     vld1.32   {d17}, [TMP4]
     pld       [TMP4, PF_OFFS]
     vmull.u8  q11, d16, d28
     vmlal.u8  q11, d17, d29
 
-    vshll.u16 q1, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q1, d18, #8
     vmlsl.u16 q1, d18, d31
 .endm
 
 .macro bilinear_interpolate_four_pixels_8888_8888_tail
     vmlal.u16 q1, d19, d31
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-    vshll.u16 q2, d20, #BILINEAR_INTERPOLATION_BITS
+    vshr.u16  q15, q12, #8
+    vshll.u16 q2, d20, #8
     vmlsl.u16 q2, d20, d30
     vmlal.u16 q2, d21, d30
-    vshll.u16 q3, d22, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q3, d22, #8
     vmlsl.u16 q3, d22, d31
     vmlal.u16 q3, d23, d31
     vadd.u16  q12, q12, q13
-    vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32 d0, q0, #16
+    vshrn.u32 d1, q1, #16
+    vshrn.u32 d4, q2, #16
+    vshr.u16  q15, q12, #8
+    vshrn.u32 d5, q3, #16
     vmovn.u16 d6, q0
     vmovn.u16 d7, q2
     vadd.u16  q12, q12, q13
     vst1.32   {d6, d7}, [OUT, :128]!
 .endm
 
 .macro bilinear_interpolate_four_pixels_8888_8888_tail_head
     mov       TMP1, X, asr #16
     add       X, X, UX
     add       TMP1, TOP, TMP1, asl #2
     mov       TMP2, X, asr #16
     add       X, X, UX
     add       TMP2, TOP, TMP2, asl #2
         vmlal.u16 q1, d19, d31
-        vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-        vshll.u16 q2, d20, #BILINEAR_INTERPOLATION_BITS
+        vshr.u16  q15, q12, #8
+        vshll.u16 q2, d20, #8
         vmlsl.u16 q2, d20, d30
         vmlal.u16 q2, d21, d30
-        vshll.u16 q3, d22, #BILINEAR_INTERPOLATION_BITS
+        vshll.u16 q3, d22, #8
     vld1.32   {d20}, [TMP1], STRIDE
         vmlsl.u16 q3, d22, d31
         vmlal.u16 q3, d23, d31
     vld1.32   {d21}, [TMP1]
     vmull.u8  q8, d20, d28
     vmlal.u8  q8, d21, d29
-        vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-        vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
-        vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d0, q0, #16
+        vshrn.u32 d1, q1, #16
+        vshrn.u32 d4, q2, #16
     vld1.32   {d22}, [TMP2], STRIDE
-        vshrn.u32 d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d5, q3, #16
         vadd.u16  q12, q12, q13
     vld1.32   {d23}, [TMP2]
     vmull.u8  q9, d22, d28
     mov       TMP3, X, asr #16
     add       X, X, UX
     add       TMP3, TOP, TMP3, asl #2
     mov       TMP4, X, asr #16
     add       X, X, UX
     add       TMP4, TOP, TMP4, asl #2
     vmlal.u8  q9, d23, d29
     vld1.32   {d22}, [TMP3], STRIDE
-        vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+        vshr.u16  q15, q12, #8
     vld1.32   {d23}, [TMP3]
     vmull.u8  q10, d22, d28
     vmlal.u8  q10, d23, d29
         vmovn.u16 d6, q0
-    vshll.u16 q0, d16, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d16, #8
         vmovn.u16 d7, q2
     vmlsl.u16 q0, d16, d30
     vmlal.u16 q0, d17, d30
     pld       [TMP4, PF_OFFS]
     vld1.32   {d16}, [TMP4], STRIDE
         vadd.u16  q12, q12, q13
     vld1.32   {d17}, [TMP4]
     pld       [TMP4, PF_OFFS]
     vmull.u8  q11, d16, d28
     vmlal.u8  q11, d17, d29
         vst1.32   {d6, d7}, [OUT, :128]!
-    vshll.u16 q1, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q1, d18, #8
     vmlsl.u16 q1, d18, d31
 .endm
 
 /*****************************************************************************/
 
 .set have_bilinear_interpolate_eight_pixels_8888_0565, 1
 
 .macro bilinear_interpolate_eight_pixels_8888_0565_head
@@ -3399,97 +3398,97 @@ 3:
     mov       TMP4, X, asr #16
     add       X, X, UX
     add       TMP4, TOP, TMP4, asl #2
     vmlal.u8  q9, d23, d29
     vld1.32   {d22}, [TMP3], STRIDE
     vld1.32   {d23}, [TMP3]
     vmull.u8  q10, d22, d28
     vmlal.u8  q10, d23, d29
-    vshll.u16 q0, d16, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d16, #8
     vmlsl.u16 q0, d16, d30
     vmlal.u16 q0, d17, d30
     pld       [TMP4, PF_OFFS]
     vld1.32   {d16}, [TMP4], STRIDE
     vld1.32   {d17}, [TMP4]
     pld       [TMP4, PF_OFFS]
     vmull.u8  q11, d16, d28
     vmlal.u8  q11, d17, d29
-    vshll.u16 q1, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q1, d18, #8
     vmlsl.u16 q1, d18, d31
 
     mov       TMP1, X, asr #16
     add       X, X, UX
     add       TMP1, TOP, TMP1, asl #2
     mov       TMP2, X, asr #16
     add       X, X, UX
     add       TMP2, TOP, TMP2, asl #2
         vmlal.u16 q1, d19, d31
-        vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-        vshll.u16 q2, d20, #BILINEAR_INTERPOLATION_BITS
+        vshr.u16  q15, q12, #8
+        vshll.u16 q2, d20, #8
         vmlsl.u16 q2, d20, d30
         vmlal.u16 q2, d21, d30
-        vshll.u16 q3, d22, #BILINEAR_INTERPOLATION_BITS
+        vshll.u16 q3, d22, #8
     vld1.32   {d20}, [TMP1], STRIDE
         vmlsl.u16 q3, d22, d31
         vmlal.u16 q3, d23, d31
     vld1.32   {d21}, [TMP1]
     vmull.u8  q8, d20, d28
     vmlal.u8  q8, d21, d29
-        vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-        vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
-        vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d0, q0, #16
+        vshrn.u32 d1, q1, #16
+        vshrn.u32 d4, q2, #16
     vld1.32   {d22}, [TMP2], STRIDE
-        vshrn.u32 d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d5, q3, #16
         vadd.u16  q12, q12, q13
     vld1.32   {d23}, [TMP2]
     vmull.u8  q9, d22, d28
     mov       TMP3, X, asr #16
     add       X, X, UX
     add       TMP3, TOP, TMP3, asl #2
     mov       TMP4, X, asr #16
     add       X, X, UX
     add       TMP4, TOP, TMP4, asl #2
     vmlal.u8  q9, d23, d29
     vld1.32   {d22}, [TMP3], STRIDE
-        vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+        vshr.u16  q15, q12, #8
     vld1.32   {d23}, [TMP3]
     vmull.u8  q10, d22, d28
     vmlal.u8  q10, d23, d29
         vmovn.u16 d8, q0
-    vshll.u16 q0, d16, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d16, #8
         vmovn.u16 d9, q2
     vmlsl.u16 q0, d16, d30
     vmlal.u16 q0, d17, d30
     pld       [TMP4, PF_OFFS]
     vld1.32   {d16}, [TMP4], STRIDE
         vadd.u16  q12, q12, q13
     vld1.32   {d17}, [TMP4]
     pld       [TMP4, PF_OFFS]
     vmull.u8  q11, d16, d28
     vmlal.u8  q11, d17, d29
-    vshll.u16 q1, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q1, d18, #8
     vmlsl.u16 q1, d18, d31
 .endm
 
 .macro bilinear_interpolate_eight_pixels_8888_0565_tail
     vmlal.u16 q1, d19, d31
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-    vshll.u16 q2, d20, #BILINEAR_INTERPOLATION_BITS
+    vshr.u16  q15, q12, #8
+    vshll.u16 q2, d20, #8
     vmlsl.u16 q2, d20, d30
     vmlal.u16 q2, d21, d30
-    vshll.u16 q3, d22, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q3, d22, #8
     vmlsl.u16 q3, d22, d31
     vmlal.u16 q3, d23, d31
     vadd.u16  q12, q12, q13
-    vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
-    vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-    vshrn.u32 d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
+    vshrn.u32 d0, q0, #16
+    vshrn.u32 d1, q1, #16
+    vshrn.u32 d4, q2, #16
+    vshr.u16  q15, q12, #8
+    vshrn.u32 d5, q3, #16
     vmovn.u16 d10, q0
     vmovn.u16 d11, q2
     vadd.u16  q12, q12, q13
 
     vuzp.u8   d8, d9
     vuzp.u8   d10, d11
     vuzp.u8   d9, d11
     vuzp.u8   d8, d10
@@ -3504,122 +3503,122 @@ 3:
 .macro bilinear_interpolate_eight_pixels_8888_0565_tail_head
     mov       TMP1, X, asr #16
     add       X, X, UX
     add       TMP1, TOP, TMP1, asl #2
     mov       TMP2, X, asr #16
     add       X, X, UX
     add       TMP2, TOP, TMP2, asl #2
         vmlal.u16 q1, d19, d31
-        vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+        vshr.u16  q15, q12, #8
             vuzp.u8 d8, d9
-        vshll.u16 q2, d20, #BILINEAR_INTERPOLATION_BITS
+        vshll.u16 q2, d20, #8
         vmlsl.u16 q2, d20, d30
         vmlal.u16 q2, d21, d30
-        vshll.u16 q3, d22, #BILINEAR_INTERPOLATION_BITS
+        vshll.u16 q3, d22, #8
     vld1.32   {d20}, [TMP1], STRIDE
         vmlsl.u16 q3, d22, d31
         vmlal.u16 q3, d23, d31
     vld1.32   {d21}, [TMP1]
     vmull.u8  q8, d20, d28
     vmlal.u8  q8, d21, d29
-        vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
-        vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
-        vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d0, q0, #16
+        vshrn.u32 d1, q1, #16
+        vshrn.u32 d4, q2, #16
     vld1.32   {d22}, [TMP2], STRIDE
-        vshrn.u32 d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d5, q3, #16
         vadd.u16  q12, q12, q13
     vld1.32   {d23}, [TMP2]
     vmull.u8  q9, d22, d28
     mov       TMP3, X, asr #16
     add       X, X, UX
     add       TMP3, TOP, TMP3, asl #2
     mov       TMP4, X, asr #16
     add       X, X, UX
     add       TMP4, TOP, TMP4, asl #2
     vmlal.u8  q9, d23, d29
     vld1.32   {d22}, [TMP3], STRIDE
-        vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+        vshr.u16  q15, q12, #8
     vld1.32   {d23}, [TMP3]
     vmull.u8  q10, d22, d28
     vmlal.u8  q10, d23, d29
         vmovn.u16 d10, q0
-    vshll.u16 q0, d16, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d16, #8
         vmovn.u16 d11, q2
     vmlsl.u16 q0, d16, d30
     vmlal.u16 q0, d17, d30
     pld       [TMP4, PF_OFFS]
     vld1.32   {d16}, [TMP4], STRIDE
         vadd.u16  q12, q12, q13
     vld1.32   {d17}, [TMP4]
     pld       [TMP4, PF_OFFS]
     vmull.u8  q11, d16, d28
     vmlal.u8  q11, d17, d29
             vuzp.u8 d10, d11
-    vshll.u16 q1, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q1, d18, #8
     vmlsl.u16 q1, d18, d31
 
     mov       TMP1, X, asr #16
     add       X, X, UX
     add       TMP1, TOP, TMP1, asl #2
     mov       TMP2, X, asr #16
     add       X, X, UX
     add       TMP2, TOP, TMP2, asl #2
         vmlal.u16 q1, d19, d31
             vuzp.u8 d9, d11
-        vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
-        vshll.u16 q2, d20, #BILINEAR_INTERPOLATION_BITS
+        vshr.u16  q15, q12, #8
+        vshll.u16 q2, d20, #8
             vuzp.u8 d8, d10
         vmlsl.u16 q2, d20, d30
         vmlal.u16 q2, d21, d30
-        vshll.u16 q3, d22, #BILINEAR_INTERPOLATION_BITS
+        vshll.u16 q3, d22, #8
     vld1.32   {d20}, [TMP1], STRIDE
         vmlsl.u16 q3, d22, d31
         vmlal.u16 q3, d23, d31
     vld1.32   {d21}, [TMP1]
     vmull.u8  q8, d20, d28
     vmlal.u8  q8, d21, d29
             vshll.u8  q6, d9, #8
             vshll.u8  q5, d10, #8
             vshll.u8  q7, d8, #8
-        vshrn.u32 d0, q0, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d0, q0, #16
             vsri.u16  q5, q6, #5
-        vshrn.u32 d1, q1, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d1, q1, #16
             vsri.u16  q5, q7, #11
-        vshrn.u32 d4, q2, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d4, q2, #16
     vld1.32   {d22}, [TMP2], STRIDE
-        vshrn.u32 d5, q3, #(2 * BILINEAR_INTERPOLATION_BITS)
+        vshrn.u32 d5, q3, #16
         vadd.u16  q12, q12, q13
     vld1.32   {d23}, [TMP2]
     vmull.u8  q9, d22, d28
     mov       TMP3, X, asr #16
     add       X, X, UX
     add       TMP3, TOP, TMP3, asl #2
     mov       TMP4, X, asr #16
     add       X, X, UX
     add       TMP4, TOP, TMP4, asl #2
     vmlal.u8  q9, d23, d29
     vld1.32   {d22}, [TMP3], STRIDE
-        vshr.u16  q15, q12, #(16 - BILINEAR_INTERPOLATION_BITS)
+        vshr.u16  q15, q12, #8
     vld1.32   {d23}, [TMP3]
     vmull.u8  q10, d22, d28
     vmlal.u8  q10, d23, d29
         vmovn.u16 d8, q0
-    vshll.u16 q0, d16, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q0, d16, #8
         vmovn.u16 d9, q2
     vmlsl.u16 q0, d16, d30
     vmlal.u16 q0, d17, d30
     pld       [TMP4, PF_OFFS]
     vld1.32   {d16}, [TMP4], STRIDE
         vadd.u16  q12, q12, q13
     vld1.32   {d17}, [TMP4]
     pld       [TMP4, PF_OFFS]
     vmull.u8  q11, d16, d28
     vmlal.u8  q11, d17, d29
-    vshll.u16 q1, d18, #BILINEAR_INTERPOLATION_BITS
+    vshll.u16 q1, d18, #8
             vst1.32   {d10, d11}, [OUT, :128]!
     vmlsl.u16 q1, d18, d31
 .endm
 /*****************************************************************************/
 
 generate_bilinear_scanline_func \
     pixman_scaled_bilinear_scanline_8888_8888_SRC_asm_neon, 8888, 8888, \
     2, 2, 28, BILINEAR_FLAG_UNROLL_4
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-arm.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright © 2000 SuSE, Inc.
- * Copyright © 2007 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 SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  SuSE makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "pixman-private.h"
-
-typedef enum
-{
-    ARM_V7		= (1 << 0),
-    ARM_V6		= (1 << 1),
-    ARM_VFP		= (1 << 2),
-    ARM_NEON		= (1 << 3),
-    ARM_IWMMXT		= (1 << 4)
-} arm_cpu_features_t;
-
-#if defined(USE_ARM_SIMD) || defined(USE_ARM_NEON) || defined(USE_ARM_IWMMXT)
-
-#if defined(_MSC_VER)
-
-/* Needed for EXCEPTION_ILLEGAL_INSTRUCTION */
-#include <windows.h>
-
-extern int pixman_msvc_try_arm_neon_op ();
-extern int pixman_msvc_try_arm_simd_op ();
-
-static arm_cpu_features_t
-detect_cpu_features (void)
-{
-    arm_cpu_features_t features = 0;
-
-    __try
-    {
-	pixman_msvc_try_arm_simd_op ();
-	features |= ARM_V6;
-    }
-    __except (GetExceptionCode () == EXCEPTION_ILLEGAL_INSTRUCTION)
-    {
-    }
-
-    __try
-    {
-	pixman_msvc_try_arm_neon_op ();
-	features |= ARM_NEON;
-    }
-    __except (GetExceptionCode () == EXCEPTION_ILLEGAL_INSTRUCTION)
-    {
-    }
-
-    return features;
-}
-
-#elif defined(__APPLE__) && defined(TARGET_OS_IPHONE) /* iOS */
-
-#include "TargetConditionals.h"
-
-static arm_cpu_features_t
-detect_cpu_features (void)
-{
-    arm_cpu_features_t features = 0;
-
-    features |= ARM_V6;
-
-    /* Detection of ARM NEON on iOS is fairly simple because iOS binaries
-     * contain separate executable images for each processor architecture.
-     * So all we have to do is detect the armv7 architecture build. The
-     * operating system automatically runs the armv7 binary for armv7 devices
-     * and the armv6 binary for armv6 devices.
-     */
-#if defined(__ARM_NEON__)
-    features |= ARM_NEON;
-#endif
-
-    return features;
-}
-
-#elif defined(__ANDROID__) || defined(ANDROID) /* Android */
-
-static arm_cpu_features_t
-detect_cpu_features (void)
-{
-    arm_cpu_features_t features = 0;
-    char buf[1024];
-    char* pos;
-    const char* ver_token = "CPU architecture: ";
-    FILE* f = fopen("/proc/cpuinfo", "r");
-    if (!f) {
-	return features;
-    }
-
-    fread(buf, sizeof(char), sizeof(buf), f);
-    fclose(f);
-    pos = strstr(buf, ver_token);
-    if (pos) {
-	char vchar = *(pos + strlen(ver_token));
-	if (vchar >= '0' && vchar <= '9') {
-	    int ver = vchar - '0';
-	    if (ver >= 7)
-		features |= ARM_V7;
-	}
-    }
-    if (strstr(buf, "neon") != NULL)
-	features |= ARM_NEON;
-    if (strstr(buf, "vfp") != NULL)
-	features |= ARM_VFP;
-
-    return features;
-}
-
-#elif defined (__linux__) /* linux ELF */
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <string.h>
-#include <elf.h>
-
-static arm_cpu_features_t
-detect_cpu_features (void)
-{
-    arm_cpu_features_t features = 0;
-    Elf32_auxv_t aux;
-    int fd;
-
-    fd = open ("/proc/self/auxv", O_RDONLY);
-    if (fd >= 0)
-    {
-	while (read (fd, &aux, sizeof(Elf32_auxv_t)) == sizeof(Elf32_auxv_t))
-	{
-	    if (aux.a_type == AT_HWCAP)
-	    {
-		uint32_t hwcap = aux.a_un.a_val;
-
-		/* hardcode these values to avoid depending on specific
-		 * versions of the hwcap header, e.g. HWCAP_NEON
-		 */
-		if ((hwcap & 64) != 0)
-		    features |= ARM_VFP;
-		if ((hwcap & 512) != 0)
-		    features |= ARM_IWMMXT;
-		/* this flag is only present on kernel 2.6.29 */
-		if ((hwcap & 4096) != 0)
-		    features |= ARM_NEON;
-	    }
-	    else if (aux.a_type == AT_PLATFORM)
-	    {
-		const char *plat = (const char*) aux.a_un.a_val;
-
-		if (strncmp (plat, "v7l", 3) == 0)
-		    features |= (ARM_V7 | ARM_V6);
-		else if (strncmp (plat, "v6l", 3) == 0)
-		    features |= ARM_V6;
-	    }
-	}
-	close (fd);
-    }
-
-    return features;
-}
-
-#else /* Unknown */
-
-static arm_cpu_features_t
-detect_cpu_features (void)
-{
-    return 0;
-}
-
-#endif /* Linux elf */
-
-static pixman_bool_t
-have_feature (arm_cpu_features_t feature)
-{
-    static pixman_bool_t initialized;
-    static arm_cpu_features_t features;
-
-    if (!initialized)
-    {
-	features = detect_cpu_features();
-	initialized = TRUE;
-    }
-
-    return (features & feature) == feature;
-}
-
-#endif /* USE_ARM_SIMD || USE_ARM_NEON || USE_ARM_IWMMXT */
-
-pixman_implementation_t *
-_pixman_arm_get_implementations (pixman_implementation_t *imp)
-{
-#ifdef USE_ARM_SIMD
-    if (!_pixman_disabled ("arm-simd") && have_feature (ARM_V6))
-	imp = _pixman_implementation_create_arm_simd (imp);
-#endif
-
-#ifdef USE_ARM_IWMMXT
-    if (!_pixman_disabled ("arm-iwmmxt") && have_feature (ARM_IWMMXT))
-	imp = _pixman_implementation_create_mmx (imp);
-#endif
-
-#ifdef USE_ARM_NEON
-    if (!_pixman_disabled ("arm-neon") && have_feature (ARM_NEON))
-	imp = _pixman_implementation_create_arm_neon (imp);
-#endif
-
-    return imp;
-}
--- a/gfx/cairo/libpixman/src/pixman-bits-image.c
+++ b/gfx/cairo/libpixman/src/pixman-bits-image.c
@@ -37,47 +37,45 @@
 #include "pixman-inlines.h"
 
 /*
  * By default, just evaluate the image at 32bpp and expand.  Individual image
  * types can plug in a better scanline getter if they want to. For example
  * we  could produce smoother gradients by evaluating them at higher color
  * depth, but that's a project for the future.
  */
-static uint32_t *
-_pixman_image_get_scanline_generic_64 (pixman_iter_t * iter,
-                                       const uint32_t *mask)
+static void
+_pixman_image_get_scanline_generic_64 (pixman_image_t * image,
+                                       int              x,
+                                       int              y,
+                                       int              width,
+                                       uint32_t *       buffer,
+                                       const uint32_t * mask)
 {
-    int             width  = iter->width;
-    uint32_t *      buffer = iter->buffer;
-
-    pixman_iter_get_scanline_t fetch_32 = iter->data;
     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));
 	if (!mask8)
-	    return buffer;
+	    return;
 
 	pixman_contract (mask8, (uint64_t *)mask, width);
     }
 
     /* Fetch the source image into the first half of buffer. */
-    fetch_32 (iter, mask8);
+    image->bits.get_scanline_32 (image, x, y, width, (uint32_t*)buffer, mask8);
 
     /* Expand from 32bpp to 64bpp in place. */
     pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, width);
 
     free (mask8);
-
-    return buffer;
 }
 
 /* Fetch functions */
 
 static force_inline uint32_t
 fetch_pixel_no_alpha (bits_image_t *image,
 		      int x, int y, pixman_bool_t check_bounds)
 {
@@ -126,18 +124,18 @@ bits_image_fetch_pixel_bilinear (bits_im
     int height = image->height;
     int x1, y1, x2, y2;
     uint32_t tl, tr, bl, br;
     int32_t distx, disty;
 
     x1 = x - pixman_fixed_1 / 2;
     y1 = y - pixman_fixed_1 / 2;
 
-    distx = pixman_fixed_to_bilinear_weight (x1);
-    disty = pixman_fixed_to_bilinear_weight (y1);
+    distx = interpolation_coord(x1);
+    disty = interpolation_coord(y1);
 
     x1 = pixman_fixed_to_int (x1);
     y1 = pixman_fixed_to_int (y1);
     x2 = x1 + 1;
     y2 = y1 + 1;
 
     if (repeat_mode != PIXMAN_REPEAT_NONE)
     {
@@ -157,27 +155,24 @@ bits_image_fetch_pixel_bilinear (bits_im
 	tr = get_pixel (image, x2, y1, TRUE);
 	bl = get_pixel (image, x1, y2, TRUE);
 	br = get_pixel (image, x2, y2, TRUE);
     }
 
     return bilinear_interpolation (tl, tr, bl, br, distx, disty);
 }
 
-static uint32_t *
-bits_image_fetch_bilinear_no_repeat_8888 (pixman_iter_t *iter,
-					  const uint32_t *mask)
+static void
+bits_image_fetch_bilinear_no_repeat_8888 (pixman_image_t * ima,
+					  int              offset,
+					  int              line,
+					  int              width,
+					  uint32_t *       buffer,
+					  const uint32_t * mask)
 {
-
-    pixman_image_t * ima = iter->image;
-    int              offset = iter->x;
-    int              line = iter->y++;
-    int              width = iter->width;
-    uint32_t *       buffer = iter->buffer;
-
     bits_image_t *bits = &ima->bits;
     pixman_fixed_t x_top, x_bottom, x;
     pixman_fixed_t ux_top, ux_bottom, ux;
     pixman_vector_t v;
     uint32_t top_mask, bottom_mask;
     uint32_t *top_row;
     uint32_t *bottom_row;
     uint32_t *end;
@@ -189,23 +184,23 @@ bits_image_fetch_bilinear_no_repeat_8888
     int w;
 
     /* reference point is the center of the pixel */
     v.vector[0] = pixman_int_to_fixed (offset) + pixman_fixed_1 / 2;
     v.vector[1] = pixman_int_to_fixed (line) + pixman_fixed_1 / 2;
     v.vector[2] = pixman_fixed_1;
 
     if (!pixman_transform_point_3d (bits->common.transform, &v))
-	return iter->buffer;
+	return;
 
     ux = ux_top = ux_bottom = bits->common.transform->matrix[0][0];
     x = x_top = x_bottom = v.vector[0] - pixman_fixed_1/2;
 
     y = v.vector[1] - pixman_fixed_1/2;
-    disty = pixman_fixed_to_bilinear_weight (y);
+    disty = interpolation_coord(y);
 
     /* Load the pointers to the first and second lines from the source
      * image that bilinear code must read.
      *
      * The main trick in this code is about the check if any line are
      * outside of the image;
      *
      * When I realize that a line (any one) is outside, I change
@@ -256,17 +251,17 @@ bits_image_fetch_bilinear_no_repeat_8888
         /* If have a mask, prepare the variables to check it */
         mask_inc = 1;
     }
 
     /* If both are zero, then the whole thing is zero */
     if (top_row == zero && bottom_row == zero)
     {
 	memset (buffer, 0, width * sizeof (uint32_t));
-	return iter->buffer;
+	return;
     }
     else if (bits->format == PIXMAN_x8r8g8b8)
     {
 	if (top_row == zero)
 	{
 	    top_mask = 0;
 	    bottom_mask = 0xff000000;
 	}
@@ -304,17 +299,17 @@ bits_image_fetch_bilinear_no_repeat_8888
     while (buffer < end && x < 0)
     {
 	uint32_t tr, br;
 	int32_t distx;
 
 	tr = top_row[pixman_fixed_to_int (x_top) + 1] | top_mask;
 	br = bottom_row[pixman_fixed_to_int (x_bottom) + 1] | bottom_mask;
 
-	distx = pixman_fixed_to_bilinear_weight (x);
+	distx = interpolation_coord(x);
 
 	*buffer++ = bilinear_interpolation (0, tr, 0, br, distx, disty);
 
 	x += ux;
 	x_top += ux_top;
 	x_bottom += ux_bottom;
 	mask += mask_inc;
     }
@@ -329,17 +324,17 @@ bits_image_fetch_bilinear_no_repeat_8888
 	    uint32_t tl, tr, bl, br;
 	    int32_t distx;
 
 	    tl = top_row [pixman_fixed_to_int (x_top)] | top_mask;
 	    tr = top_row [pixman_fixed_to_int (x_top) + 1] | top_mask;
 	    bl = bottom_row [pixman_fixed_to_int (x_bottom)] | bottom_mask;
 	    br = bottom_row [pixman_fixed_to_int (x_bottom) + 1] | bottom_mask;
 
-	    distx = pixman_fixed_to_bilinear_weight (x);
+	    distx = interpolation_coord(x);
 
 	    *buffer = bilinear_interpolation (tl, tr, bl, br, distx, disty);
 	}
 
 	buffer++;
 	x += ux;
 	x_top += ux_top;
 	x_bottom += ux_bottom;
@@ -353,51 +348,49 @@ bits_image_fetch_bilinear_no_repeat_8888
 	if (*mask)
 	{
 	    uint32_t tl, bl;
 	    int32_t distx;
 
 	    tl = top_row [pixman_fixed_to_int (x_top)] | top_mask;
 	    bl = bottom_row [pixman_fixed_to_int (x_bottom)] | bottom_mask;
 
-	    distx = pixman_fixed_to_bilinear_weight (x);
+	    distx = interpolation_coord(x);
 
 	    *buffer = bilinear_interpolation (tl, 0, bl, 0, distx, disty);
 	}
 
 	buffer++;
 	x += ux;
 	x_top += ux_top;
 	x_bottom += ux_bottom;
 	mask += mask_inc;
     }
 
     /* Zero fill to the left of the image */
     while (buffer < end)
 	*buffer++ = 0;
-
-    return iter->buffer;
 }
 
 static force_inline uint32_t
 bits_image_fetch_pixel_convolution (bits_image_t   *image,
 				    pixman_fixed_t  x,
 				    pixman_fixed_t  y,
 				    get_pixel_t     get_pixel)
 {
     pixman_fixed_t *params = image->common.filter_params;
     int x_off = (params[0] - pixman_fixed_1) >> 1;
     int y_off = (params[1] - pixman_fixed_1) >> 1;
     int32_t cwidth = pixman_fixed_to_int (params[0]);
     int32_t cheight = pixman_fixed_to_int (params[1]);
+    int32_t srtot, sgtot, sbtot, satot;
     int32_t i, j, x1, x2, y1, y2;
     pixman_repeat_t repeat_mode = image->common.repeat;
     int width = image->width;
     int height = image->height;
-    int srtot, sgtot, sbtot, satot;
 
     params += 2;
 
     x1 = pixman_fixed_to_int (x - pixman_fixed_e - x_off);
     y1 = pixman_fixed_to_int (y - pixman_fixed_e - y_off);
     x2 = x1 + cwidth;
     y2 = y1 + cheight;
 
@@ -423,20 +416,20 @@ bits_image_fetch_pixel_convolution (bits
 
 		    pixel = get_pixel (image, rx, ry, FALSE);
 		}
 		else
 		{
 		    pixel = get_pixel (image, rx, ry, TRUE);
 		}
 
-		srtot += (int)RED_8 (pixel) * f;
-		sgtot += (int)GREEN_8 (pixel) * f;
-		sbtot += (int)BLUE_8 (pixel) * f;
-		satot += (int)ALPHA_8 (pixel) * f;
+		srtot += RED_8 (pixel) * f;
+		sgtot += GREEN_8 (pixel) * f;
+		sbtot += BLUE_8 (pixel) * f;
+		satot += ALPHA_8 (pixel) * f;
 	    }
 
 	    params++;
 	}
     }
 
     satot >>= 16;
     srtot >>= 16;
@@ -476,40 +469,38 @@ bits_image_fetch_pixel_filtered (bits_im
 
     default:
         break;
     }
 
     return 0;
 }
 
-static uint32_t *
-bits_image_fetch_affine_no_alpha (pixman_iter_t *  iter,
+static void
+bits_image_fetch_affine_no_alpha (pixman_image_t * image,
+				  int              offset,
+				  int              line,
+				  int              width,
+				  uint32_t *       buffer,
 				  const uint32_t * mask)
 {
-    pixman_image_t *image  = iter->image;
-    int             offset = iter->x;
-    int             line   = iter->y++;
-    int             width  = iter->width;
-    uint32_t *      buffer = iter->buffer;
-
     pixman_fixed_t x, y;
     pixman_fixed_t ux, uy;
     pixman_vector_t v;
     int i;
 
     /* reference point is the center of the pixel */
     v.vector[0] = pixman_int_to_fixed (offset) + pixman_fixed_1 / 2;
     v.vector[1] = pixman_int_to_fixed (line) + pixman_fixed_1 / 2;
     v.vector[2] = pixman_fixed_1;
 
     if (image->common.transform)
     {
 	if (!pixman_transform_point_3d (image->common.transform, &v))
-	    return iter->buffer;
+	    return;
 
 	ux = image->common.transform->matrix[0][0];
 	uy = image->common.transform->matrix[1][0];
     }
     else
     {
 	ux = pixman_fixed_1;
 	uy = 0;
@@ -524,18 +515,16 @@ bits_image_fetch_affine_no_alpha (pixman
 	{
 	    buffer[i] = bits_image_fetch_pixel_filtered (
 		&image->bits, x, y, fetch_pixel_no_alpha);
 	}
 
 	x += ux;
 	y += uy;
     }
-
-    return buffer;
 }
 
 /* General fetcher */
 static force_inline uint32_t
 fetch_pixel_general (bits_image_t *image, int x, int y, pixman_bool_t check_bounds)
 {
     uint32_t pixel;
 
@@ -569,40 +558,38 @@ fetch_pixel_general (bits_image_t *image
 
 	pixel &= 0x00ffffff;
 	pixel |= (pixel_a << 24);
     }
 
     return pixel;
 }
 
-static uint32_t *
-bits_image_fetch_general (pixman_iter_t  *iter,
-			  const uint32_t *mask)
+static void
+bits_image_fetch_general (pixman_image_t * image,
+			  int              offset,
+			  int              line,
+			  int              width,
+			  uint32_t *       buffer,
+			  const uint32_t * mask)
 {
-    pixman_image_t *image  = iter->image;
-    int             offset = iter->x;
-    int             line   = iter->y++;
-    int             width  = iter->width;
-    uint32_t *      buffer = iter->buffer;
-
     pixman_fixed_t x, y, w;
     pixman_fixed_t ux, uy, uw;
     pixman_vector_t v;
     int i;
 
     /* reference point is the center of the pixel */
     v.vector[0] = pixman_int_to_fixed (offset) + pixman_fixed_1 / 2;
     v.vector[1] = pixman_int_to_fixed (line) + pixman_fixed_1 / 2;
     v.vector[2] = pixman_fixed_1;
 
     if (image->common.transform)
     {
 	if (!pixman_transform_point_3d (image->common.transform, &v))
-	    return buffer;
+	    return;
 
 	ux = image->common.transform->matrix[0][0];
 	uy = image->common.transform->matrix[1][0];
 	uw = image->common.transform->matrix[2][0];
     }
     else
     {
 	ux = pixman_fixed_1;
@@ -634,18 +621,16 @@ bits_image_fetch_general (pixman_iter_t 
 	    buffer[i] = bits_image_fetch_pixel_filtered (
 		&image->bits, x0, y0, fetch_pixel_general);
 	}
 
 	x += ux;
 	y += uy;
 	w += uw;
     }
-
-    return buffer;
 }
 
 static const uint8_t zero[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
 
 typedef uint32_t (* convert_pixel_t) (const uint8_t *row, int x);
 
 static force_inline void
 bits_image_fetch_bilinear_affine (pixman_image_t * image,
@@ -690,18 +675,18 @@ bits_image_fetch_bilinear_affine (pixman
 	const uint8_t *row2;
 
 	if (mask && !mask[i])
 	    goto next;
 
 	x1 = x - pixman_fixed_1 / 2;
 	y1 = y - pixman_fixed_1 / 2;
 
-	distx = pixman_fixed_to_bilinear_weight (x1);
-	disty = pixman_fixed_to_bilinear_weight (y1);
+	distx = interpolation_coord(x1);
+	disty = interpolation_coord(y1);
 
 	y1 = pixman_fixed_to_int (y1);
 	y2 = y1 + 1;
 	x1 = pixman_fixed_to_int (x1);
 	x2 = x1 + 1;
 
 	if (repeat_mode != PIXMAN_REPEAT_NONE)
 	{
@@ -892,43 +877,45 @@ convert_a8 (const uint8_t *row, int x)
 
 static force_inline uint32_t
 convert_r5g6b5 (const uint8_t *row, int x)
 {
     return CONVERT_0565_TO_0888 (*((uint16_t *)row + x));
 }
 
 #define MAKE_BILINEAR_FETCHER(name, format, repeat_mode)		\
-    static uint32_t *							\
-    bits_image_fetch_bilinear_affine_ ## name (pixman_iter_t   *iter,	\
+    static void								\
+    bits_image_fetch_bilinear_affine_ ## name (pixman_image_t *image,	\
+					       int              offset,	\
+					       int              line,	\
+					       int              width,	\
+					       uint32_t *       buffer,	\
 					       const uint32_t * mask)	\
     {									\
-	bits_image_fetch_bilinear_affine (iter->image,			\
-					  iter->x, iter->y++,		\
-					  iter->width,			\
-					  iter->buffer, mask,		\
+	bits_image_fetch_bilinear_affine (image, offset, line,		\
+					  width, buffer, mask,		\
 					  convert_ ## format,		\
 					  PIXMAN_ ## format,		\
 					  repeat_mode);			\
-	return iter->buffer;						\
     }
 
 #define MAKE_NEAREST_FETCHER(name, format, repeat_mode)			\
-    static uint32_t *							\
-    bits_image_fetch_nearest_affine_ ## name (pixman_iter_t   *iter,	\
+    static void								\
+    bits_image_fetch_nearest_affine_ ## name (pixman_image_t *image,	\
+					      int              offset,	\
+					      int              line,	\
+					      int              width,	\
+					      uint32_t *       buffer,	\
 					      const uint32_t * mask)	\
     {									\
-	bits_image_fetch_nearest_affine (iter->image,			\
-					 iter->x, iter->y++,		\
-					 iter->width,			\
-					 iter->buffer, mask,		\
+	bits_image_fetch_nearest_affine (image, offset, line,		\
+					 width, buffer, mask,		\
 					 convert_ ## format,		\
 					 PIXMAN_ ## format,		\
 					 repeat_mode);			\
-	return iter->buffer;						\
     }
 
 #define MAKE_FETCHERS(name, format, repeat_mode)			\
     MAKE_NEAREST_FETCHER (name, format, repeat_mode)			\
     MAKE_BILINEAR_FETCHER (name, format, repeat_mode)
 
 MAKE_FETCHERS (pad_a8r8g8b8,     a8r8g8b8, PIXMAN_REPEAT_PAD)
 MAKE_FETCHERS (none_a8r8g8b8,    a8r8g8b8, PIXMAN_REPEAT_NONE)
@@ -1067,77 +1054,62 @@ bits_image_fetch_untransformed_repeat_no
 	    image->fetch_scanline_32 ((pixman_image_t *)image, x, y, w, buffer, NULL);
 
 	buffer += w * (wide? 2 : 1);
 	x += w;
 	width -= w;
     }
 }
 
-static uint32_t *
-bits_image_fetch_untransformed_32 (pixman_iter_t * iter,
-				   const uint32_t *mask)
+static void
+bits_image_fetch_untransformed_32 (pixman_image_t * image,
+                                   int              x,
+                                   int              y,
+                                   int              width,
+                                   uint32_t *       buffer,
+                                   const uint32_t * mask)
 {
-    pixman_image_t *image  = iter->image;
-    int             x      = iter->x;
-    int             y      = iter->y;
-    int             width  = iter->width;
-    uint32_t *      buffer = iter->buffer;
-
     if (image->common.repeat == PIXMAN_REPEAT_NONE)
     {
 	bits_image_fetch_untransformed_repeat_none (
 	    &image->bits, FALSE, x, y, width, buffer);
     }
     else
     {
 	bits_image_fetch_untransformed_repeat_normal (
 	    &image->bits, FALSE, x, y, width, buffer);
     }
-
-    iter->y++;
-    return buffer;
 }
 
-static uint32_t *
-bits_image_fetch_untransformed_64 (pixman_iter_t * iter,
-                                   const uint32_t *mask)
-				   
+static void
+bits_image_fetch_untransformed_64 (pixman_image_t * image,
+                                   int              x,
+                                   int              y,
+                                   int              width,
+                                   uint32_t *       buffer,
+                                   const uint32_t * unused)
 {
-    pixman_image_t *image  = iter->image;
-    int             x      = iter->x;
-    int             y      = iter->y;
-    int             width  = iter->width;
-    uint32_t *      buffer = iter->buffer;
-
     if (image->common.repeat == PIXMAN_REPEAT_NONE)
     {
 	bits_image_fetch_untransformed_repeat_none (
 	    &image->bits, TRUE, x, y, width, buffer);
     }
     else
     {
 	bits_image_fetch_untransformed_repeat_normal (
 	    &image->bits, TRUE, x, y, width, buffer);
     }
-
-    iter->y++;
-    return buffer;
 }
 
-static uint32_t *
-_pixman_image_get_scanline_generic_64 (pixman_iter_t   *iter,
-				       const uint32_t * mask);
-
 typedef struct
 {
     pixman_format_code_t	format;
     uint32_t			flags;
-    pixman_iter_get_scanline_t	get_scanline_32;
-    pixman_iter_get_scanline_t	get_scanline_64;
+    fetch_scanline_t		fetch_32;
+    fetch_scanline_t		fetch_64;
 } fetcher_info_t;
 
 static const fetcher_info_t fetcher_info[] =
 {
     { PIXMAN_any,
       (FAST_PATH_NO_ALPHA_MAP			|
        FAST_PATH_ID_TRANSFORM			|
        FAST_PATH_NO_CONVOLUTION_FILTER		|
@@ -1229,46 +1201,63 @@ static const fetcher_info_t fetcher_info
     { PIXMAN_any, 0, bits_image_fetch_general, _pixman_image_get_scanline_generic_64 },
 
     { PIXMAN_null },
 };
 
 static void
 bits_image_property_changed (pixman_image_t *image)
 {
+    uint32_t flags = image->common.flags;
+    pixman_format_code_t format = image->common.extended_format_code;
+    const fetcher_info_t *info;
+
     _pixman_bits_image_setup_accessors (&image->bits);
+
+    info = fetcher_info;
+    while (info->format != PIXMAN_null)
+    {
+	if ((info->format == format || info->format == PIXMAN_any)	&&
+	    (info->flags & flags) == info->flags)
+	{
+	    image->bits.get_scanline_32 = info->fetch_32;
+	    image->bits.get_scanline_64 = info->fetch_64;
+	    break;
+	}
+
+	info++;
+    }
+}
+
+static uint32_t *
+src_get_scanline_narrow (pixman_iter_t *iter, const uint32_t *mask)
+{
+    iter->image->bits.get_scanline_32 (
+	iter->image, iter->x, iter->y++, iter->width, iter->buffer, mask);
+
+    return iter->buffer;
+}
+
+static uint32_t *
+src_get_scanline_wide (pixman_iter_t *iter, const uint32_t *mask)
+{
+    iter->image->bits.get_scanline_64 (
+	iter->image, iter->x, iter->y++, iter->width, iter->buffer, mask);
+
+    return iter->buffer;
 }
 
 void
 _pixman_bits_image_src_iter_init (pixman_image_t *image, pixman_iter_t *iter)
 {
-    pixman_format_code_t format = image->common.extended_format_code;
-    uint32_t flags = image->common.flags;
-    const fetcher_info_t *info;
+    if (iter->flags & ITER_NARROW)
+	iter->get_scanline = src_get_scanline_narrow;
+    else
+	iter->get_scanline = src_get_scanline_wide;
 
-    for (info = fetcher_info; info->format != PIXMAN_null; ++info)
-    {
-	if ((info->format == format || info->format == PIXMAN_any)	&&
-	    (info->flags & flags) == info->flags)
-	{
-	    if (iter->iter_flags & ITER_NARROW)
-	    {
-		iter->get_scanline = info->get_scanline_32;
-	    }
-	    else
-	    {
-		iter->data = info->get_scanline_32;
-		iter->get_scanline = info->get_scanline_64;
-	    }
-	    return;
-	}
-    }
-
-    /* Just in case we somehow didn't find a scanline function */
-    iter->get_scanline = _pixman_iter_get_scanline_noop;
 }
 
 static uint32_t *
 dest_get_scanline_16 (pixman_iter_t *iter, const uint32_t *mask)
 {
     pixman_image_t *image  = iter->image;
     int             x      = iter->x;
     int             y      = iter->y;
@@ -1415,32 +1404,32 @@ dest_write_back_wide (pixman_iter_t *ite
     }
 
     iter->y++;
 }
 
 void
 _pixman_bits_image_dest_iter_init (pixman_image_t *image, pixman_iter_t *iter)
 {
-    if (iter->iter_flags & ITER_16)
+    if (iter->flags & ITER_16)
     {
-        if ((iter->iter_flags & (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) ==
+        if ((iter->flags & (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) ==
 	    (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA))
 	{
             iter->get_scanline = _pixman_iter_get_scanline_noop;
         }
         else
         {
 	    iter->get_scanline = dest_get_scanline_16;
         }
 	iter->write_back = dest_write_back_16;
     }
-    else if (iter->iter_flags & ITER_NARROW)
+    else if (iter->flags & ITER_NARROW)
     {
-	if ((iter->iter_flags & (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) ==
+	if ((iter->flags & (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA)) ==
 	    (ITER_IGNORE_RGB | ITER_IGNORE_ALPHA))
 	{
 	    iter->get_scanline = _pixman_iter_get_scanline_noop;
 	}
 	else
 	{
 	    iter->get_scanline = dest_get_scanline_narrow;
 	}
--- a/gfx/cairo/libpixman/src/pixman-combine32.c
+++ b/gfx/cairo/libpixman/src/pixman-combine32.c
@@ -436,17 +436,17 @@ combine_saturate_u (pixman_implementatio
  * it has been designed to mirror ISO 32000. Note that at the current point
  * no released draft exists that shows this, as the formulas have not been
  * updated yet after the release of ISO 32000.
  *
  * The default implementation here uses the PDF_SEPARABLE_BLEND_MODE and
  * PDF_NON_SEPARABLE_BLEND_MODE macros, which take the blend function as an
  * argument. Note that this implementation operates on premultiplied colors,
  * while the PDF specification does not. Therefore the code uses the formula
- * Cra = (1 – as) . Dca + (1 – ad) . Sca + B(Dca, ad, Sca, as)
+ * ar.Cra = (1 – as) . Dca + (1 – ad) . Sca + B(Dca, ad, Sca, as)
  */
 
 /*
  * Multiply
  * B(Dca, ad, Sca, as) = Dca.Sca
  */
 
 static void
@@ -521,17 +521,17 @@ combine_multiply_ca (pixman_implementati
 	    uint8_t da = ALPHA_8 (d);					\
 	    uint8_t ida = ~da;						\
 	    uint32_t result;						\
 									\
 	    result = d;							\
 	    UN8x4_MUL_UN8_ADD_UN8x4_MUL_UN8 (result, isa, s, ida);	\
 	    								\
 	    *(dest + i) = result +					\
-		(DIV_ONE_UN8 (sa * (uint32_t)da) << A_SHIFT) +		\
+		(DIV_ONE_UN8 (sa * da) << A_SHIFT) +			\
 		(blend_ ## name (RED_8 (d), da, RED_8 (s), sa) << R_SHIFT) + \
 		(blend_ ## name (GREEN_8 (d), da, GREEN_8 (s), sa) << G_SHIFT) + \
 		(blend_ ## name (BLUE_8 (d), da, BLUE_8 (s), sa));	\
 	}								\
     }									\
     									\
     static void								\
     combine_ ## name ## _ca (pixman_implementation_t *imp,		\
@@ -551,17 +551,17 @@ combine_multiply_ca (pixman_implementati
 	    uint32_t result;						\
             								\
 	    combine_mask_value_ca (&s, &m);				\
             								\
 	    result = d;							\
 	    UN8x4_MUL_UN8x4_ADD_UN8x4_MUL_UN8 (result, ~m, s, ida);     \
             								\
 	    result +=							\
-	        (DIV_ONE_UN8 (ALPHA_8 (m) * (uint32_t)da) << A_SHIFT) +	\
+	        (DIV_ONE_UN8 (ALPHA_8 (m) * da) << A_SHIFT) +		\
 	        (blend_ ## name (RED_8 (d), da, RED_8 (s), RED_8 (m)) << R_SHIFT) + \
 	        (blend_ ## name (GREEN_8 (d), da, GREEN_8 (s), GREEN_8 (m)) << G_SHIFT) + \
 	        (blend_ ## name (BLUE_8 (d), da, BLUE_8 (s), BLUE_8 (m))); \
 	    								\
 	    *(dest + i) = result;					\
 	}								\
     }
 
@@ -848,17 +848,17 @@ PDF_SEPARABLE_BLEND_MODE (exclusion)
  *   = clip_color ( r * C + r × l - r * LUM (C), r * a)
  *
  *   = set_lum ( r * C, r * l, r * a)
  *
  * Finally, set_sat:
  *
  *    r * set_sat (C, s) = set_sat (x * C, r * s)
  *
- * The above holds for all non-zero x, because the x'es in the fraction for
+ * The above holds for all non-zero x, because they x'es in the fraction for
  * C_mid cancel out. Specifically, it holds for x = r:
  *
  *    r * set_sat (C, s) = set_sat (r_c, rs)
  *
  */
 
 /* So, for the non-separable PDF blend modes, we have (using s, d for
  * non-premultiplied colors, and S, D for premultiplied:
@@ -884,17 +884,18 @@ PDF_SEPARABLE_BLEND_MODE (exclusion)
  *   = set_lum (a_s * a_d * set_sat (D/a_d, SAT (S/a_s)),
  *                                        a_s * LUM (D), a_s * a_d)
  *   = set_lum (set_sat (a_s * D, a_d * SAT (S), a_s * LUM (D), a_s * a_d))
  *
  *   Hue:
  *
  *     a_s * a_d * B(s, d)
  *   = a_s * a_d * set_lum (set_sat (S/a_s, SAT (D/a_d)), LUM (D/a_d), 1)
- *   = set_lum (set_sat (a_d * S, a_s * SAT (D)), a_s * LUM (D), a_s * a_d)
+ *   = a_s * a_d * set_lum (set_sat (a_d * S, a_s * SAT (D)),
+ *                                        a_s * LUM (D), a_s * a_d)
  *
  */
 
 #define CH_MIN(c) (c[0] < c[1] ? (c[0] < c[2] ? c[0] : c[2]) : (c[1] < c[2] ? c[1] : c[2]))
 #define CH_MAX(c) (c[0] > c[1] ? (c[0] > c[2] ? c[0] : c[2]) : (c[1] > c[2] ? c[1] : c[2]))
 #define LUM(c) ((c[0] * 30 + c[1] * 59 + c[2] * 11) / 100)
 #define SAT(c) (CH_MAX (c) - CH_MIN (c))
 
@@ -925,17 +926,17 @@ PDF_SEPARABLE_BLEND_MODE (exclusion)
 	    sc[0] = RED_8 (s);						\
 	    dc[1] = GREEN_8 (d);					\
 	    sc[1] = GREEN_8 (s);					\
 	    dc[2] = BLUE_8 (d);						\
 	    sc[2] = BLUE_8 (s);						\
 	    blend_ ## name (c, dc, da, sc, sa);				\
             								\
 	    *(dest + i) = result +					\
-		(DIV_ONE_UN8 (sa * (uint32_t)da) << A_SHIFT) +		\
+		(DIV_ONE_UN8 (sa * da) << A_SHIFT) +			\
 		(DIV_ONE_UN8 (c[0]) << R_SHIFT) +			\
 		(DIV_ONE_UN8 (c[1]) << G_SHIFT) +			\
 		(DIV_ONE_UN8 (c[2]));					\
 	}								\
     }
 
 static void
 set_lum (uint32_t dest[3], uint32_t src[3], uint32_t sa, uint32_t lum)
@@ -1142,17 +1143,19 @@ blend_hsl_luminosity (uint32_t c[3],
 PDF_NON_SEPARABLE_BLEND_MODE (hsl_luminosity)
 
 #undef SAT
 #undef LUM
 #undef CH_MAX
 #undef CH_MIN
 #undef PDF_NON_SEPARABLE_BLEND_MODE
 
-/* All of the disjoint/conjoint composing functions
+/* Overlay
+ *
+ * All of the disjoint composing functions
  *
  * The four entries in the first column indicate what source contributions
  * come from each of the four areas of the picture -- areas covered by neither
  * A nor B, areas covered only by A, areas covered only by B and finally
  * areas covered by both A and B.
  * 
  * Disjoint			Conjoint
  * Fa		Fb		Fa		Fb
@@ -1163,19 +1166,16 @@ PDF_NON_SEPARABLE_BLEND_MODE (hsl_lumino
  * (0,A,B,B)	min((1-b)/a,1)	1		max(1-b/a,0)	1
  * (0,0,0,A)	max(1-(1-b)/a,0) 0		min(1,b/a)	0
  * (0,0,0,B)	0		max(1-(1-a)/b,0) 0		min(a/b,1)
  * (0,A,0,0)	min(1,(1-b)/a)	0		max(1-b/a,0)	0
  * (0,0,B,0)	0		min(1,(1-a)/b)	0		max(1-a/b,0)
  * (0,0,B,A)	max(1-(1-b)/a,0) min(1,(1-a)/b)	 min(1,b/a)	max(1-a/b,0)
  * (0,A,0,B)	min(1,(1-b)/a)	max(1-(1-a)/b,0) max(1-b/a,0)	min(1,a/b)
  * (0,A,B,0)	min(1,(1-b)/a)	min(1,(1-a)/b)	max(1-b/a,0)	max(1-a/b,0)
- *
- * See  http://marc.info/?l=xfree-render&m=99792000027857&w=2  for more
- * information about these operators.
  */
 
 #define COMBINE_A_OUT 1
 #define COMBINE_A_IN  2
 #define COMBINE_B_OUT 4
 #define COMBINE_B_IN  8
 
 #define COMBINE_CLEAR   0
--- a/gfx/cairo/libpixman/src/pixman-combine32.h
+++ b/gfx/cairo/libpixman/src/pixman-combine32.h
@@ -24,20 +24,20 @@
 #define GREEN_8(x) (((x) >> G_SHIFT) & MASK)
 #define BLUE_8(x) ((x) & MASK)
 
 /*
  * Helper macros.
  */
 
 #define MUL_UN8(a, b, t)						\
-    ((t) = (a) * (uint16_t)(b) + ONE_HALF, ((((t) >> G_SHIFT ) + (t) ) >> G_SHIFT ))
+    ((t) = (a) * (b) + ONE_HALF, ((((t) >> G_SHIFT ) + (t) ) >> G_SHIFT ))
 
 #define DIV_UN8(a, b)							\
-    (((uint16_t) (a) * MASK + ((b) / 2)) / (b))
+    (((uint16_t) (a) * MASK) / (b))
 
 #define ADD_UN8(x, y, t)				     \
     ((t) = (x) + (y),					     \
      (uint32_t) (uint8_t) ((t) | (0 - ((t) >> G_SHIFT))))
 
 #define DIV_ONE_UN8(x)							\
     (((x) + ONE_HALF + (((x) + ONE_HALF) >> G_SHIFT)) >> G_SHIFT)
 
--- a/gfx/cairo/libpixman/src/pixman-combine64.c
+++ b/gfx/cairo/libpixman/src/pixman-combine64.c
@@ -436,17 +436,17 @@ combine_saturate_u (pixman_implementatio
  * it has been designed to mirror ISO 32000. Note that at the current point
  * no released draft exists that shows this, as the formulas have not been
  * updated yet after the release of ISO 32000.
  *
  * The default implementation here uses the PDF_SEPARABLE_BLEND_MODE and
  * PDF_NON_SEPARABLE_BLEND_MODE macros, which take the blend function as an
  * argument. Note that this implementation operates on premultiplied colors,
  * while the PDF specification does not. Therefore the code uses the formula
- * Cra = (1 – as) . Dca + (1 – ad) . Sca + B(Dca, ad, Sca, as)
+ * ar.Cra = (1 – as) . Dca + (1 – ad) . Sca + B(Dca, ad, Sca, as)
  */
 
 /*
  * Multiply
  * B(Dca, ad, Sca, as) = Dca.Sca
  */
 
 static void
@@ -521,17 +521,17 @@ combine_multiply_ca (pixman_implementati
 	    uint16_t da = ALPHA_16 (d);					\
 	    uint16_t ida = ~da;						\
 	    uint64_t result;						\
 									\
 	    result = d;							\
 	    UN16x4_MUL_UN16_ADD_UN16x4_MUL_UN16 (result, isa, s, ida);	\
 	    								\
 	    *(dest + i) = result +					\
-		(DIV_ONE_UN16 (sa * (uint64_t)da) << A_SHIFT) +		\
+		(DIV_ONE_UN16 (sa * da) << A_SHIFT) +			\
 		(blend_ ## name (RED_16 (d), da, RED_16 (s), sa) << R_SHIFT) + \
 		(blend_ ## name (GREEN_16 (d), da, GREEN_16 (s), sa) << G_SHIFT) + \
 		(blend_ ## name (BLUE_16 (d), da, BLUE_16 (s), sa));	\
 	}								\
     }									\
     									\
     static void								\
     combine_ ## name ## _ca (pixman_implementation_t *imp,		\
@@ -551,17 +551,17 @@ combine_multiply_ca (pixman_implementati
 	    uint64_t result;						\
             								\
 	    combine_mask_value_ca (&s, &m);				\
             								\
 	    result = d;							\
 	    UN16x4_MUL_UN16x4_ADD_UN16x4_MUL_UN16 (result, ~m, s, ida);     \
             								\
 	    result +=							\
-	        (DIV_ONE_UN16 (ALPHA_16 (m) * (uint64_t)da) << A_SHIFT) +	\
+	        (DIV_ONE_UN16 (ALPHA_16 (m) * da) << A_SHIFT) +		\
 	        (blend_ ## name (RED_16 (d), da, RED_16 (s), RED_16 (m)) << R_SHIFT) + \
 	        (blend_ ## name (GREEN_16 (d), da, GREEN_16 (s), GREEN_16 (m)) << G_SHIFT) + \
 	        (blend_ ## name (BLUE_16 (d), da, BLUE_16 (s), BLUE_16 (m))); \
 	    								\
 	    *(dest + i) = result;					\
 	}								\
     }
 
@@ -848,17 +848,17 @@ PDF_SEPARABLE_BLEND_MODE (exclusion)
  *   = clip_color ( r * C + r × l - r * LUM (C), r * a)
  *
  *   = set_lum ( r * C, r * l, r * a)
  *
  * Finally, set_sat:
  *
  *    r * set_sat (C, s) = set_sat (x * C, r * s)
  *
- * The above holds for all non-zero x, because the x'es in the fraction for
+ * The above holds for all non-zero x, because they x'es in the fraction for
  * C_mid cancel out. Specifically, it holds for x = r:
  *
  *    r * set_sat (C, s) = set_sat (r_c, rs)
  *
  */
 
 /* So, for the non-separable PDF blend modes, we have (using s, d for
  * non-premultiplied colors, and S, D for premultiplied:
@@ -884,17 +884,18 @@ PDF_SEPARABLE_BLEND_MODE (exclusion)
  *   = set_lum (a_s * a_d * set_sat (D/a_d, SAT (S/a_s)),
  *                                        a_s * LUM (D), a_s * a_d)
  *   = set_lum (set_sat (a_s * D, a_d * SAT (S), a_s * LUM (D), a_s * a_d))
  *
  *   Hue:
  *
  *     a_s * a_d * B(s, d)
  *   = a_s * a_d * set_lum (set_sat (S/a_s, SAT (D/a_d)), LUM (D/a_d), 1)
- *   = set_lum (set_sat (a_d * S, a_s * SAT (D)), a_s * LUM (D), a_s * a_d)
+ *   = a_s * a_d * set_lum (set_sat (a_d * S, a_s * SAT (D)),
+ *                                        a_s * LUM (D), a_s * a_d)
  *
  */
 
 #define CH_MIN(c) (c[0] < c[1] ? (c[0] < c[2] ? c[0] : c[2]) : (c[1] < c[2] ? c[1] : c[2]))
 #define CH_MAX(c) (c[0] > c[1] ? (c[0] > c[2] ? c[0] : c[2]) : (c[1] > c[2] ? c[1] : c[2]))
 #define LUM(c) ((c[0] * 30 + c[1] * 59 + c[2] * 11) / 100)
 #define SAT(c) (CH_MAX (c) - CH_MIN (c))
 
@@ -925,17 +926,17 @@ PDF_SEPARABLE_BLEND_MODE (exclusion)
 	    sc[0] = RED_16 (s);						\
 	    dc[1] = GREEN_16 (d);					\
 	    sc[1] = GREEN_16 (s);					\
 	    dc[2] = BLUE_16 (d);						\
 	    sc[2] = BLUE_16 (s);						\
 	    blend_ ## name (c, dc, da, sc, sa);				\
             								\
 	    *(dest + i) = result +					\
-		(DIV_ONE_UN16 (sa * (uint64_t)da) << A_SHIFT) +		\
+		(DIV_ONE_UN16 (sa * da) << A_SHIFT) +			\
 		(DIV_ONE_UN16 (c[0]) << R_SHIFT) +			\
 		(DIV_ONE_UN16 (c[1]) << G_SHIFT) +			\
 		(DIV_ONE_UN16 (c[2]));					\
 	}								\
     }
 
 static void
 set_lum (uint64_t dest[3], uint64_t src[3], uint64_t sa, uint64_t lum)
@@ -1142,17 +1143,19 @@ blend_hsl_luminosity (uint64_t c[3],
 PDF_NON_SEPARABLE_BLEND_MODE (hsl_luminosity)
 
 #undef SAT
 #undef LUM
 #undef CH_MAX
 #undef CH_MIN
 #undef PDF_NON_SEPARABLE_BLEND_MODE
 
-/* All of the disjoint/conjoint composing functions
+/* Overlay
+ *
+ * All of the disjoint composing functions
  *
  * The four entries in the first column indicate what source contributions
  * come from each of the four areas of the picture -- areas covered by neither
  * A nor B, areas covered only by A, areas covered only by B and finally
  * areas covered by both A and B.
  * 
  * Disjoint			Conjoint
  * Fa		Fb		Fa		Fb
@@ -1163,19 +1166,16 @@ PDF_NON_SEPARABLE_BLEND_MODE (hsl_lumino
  * (0,A,B,B)	min((1-b)/a,1)	1		max(1-b/a,0)	1
  * (0,0,0,A)	max(1-(1-b)/a,0) 0		min(1,b/a)	0
  * (0,0,0,B)	0		max(1-(1-a)/b,0) 0		min(a/b,1)
  * (0,A,0,0)	min(1,(1-b)/a)	0		max(1-b/a,0)	0
  * (0,0,B,0)	0		min(1,(1-a)/b)	0		max(1-a/b,0)
  * (0,0,B,A)	max(1-(1-b)/a,0) min(1,(1-a)/b)	 min(1,b/a)	max(1-a/b,0)
  * (0,A,0,B)	min(1,(1-b)/a)	max(1-(1-a)/b,0) max(1-b/a,0)	min(1,a/b)
  * (0,A,B,0)	min(1,(1-b)/a)	min(1,(1-a)/b)	max(1-b/a,0)	max(1-a/b,0)
- *
- * See  http://marc.info/?l=xfree-render&m=99792000027857&w=2  for more
- * information about these operators.
  */
 
 #define COMBINE_A_OUT 1
 #define COMBINE_A_IN  2
 #define COMBINE_B_OUT 4
 #define COMBINE_B_IN  8
 
 #define COMBINE_CLEAR   0
--- a/gfx/cairo/libpixman/src/pixman-combine64.h
+++ b/gfx/cairo/libpixman/src/pixman-combine64.h
@@ -24,20 +24,20 @@
 #define GREEN_16(x) (((x) >> G_SHIFT) & MASK)
 #define BLUE_16(x) ((x) & MASK)
 
 /*
  * Helper macros.
  */
 
 #define MUL_UN16(a, b, t)						\
-    ((t) = (a) * (uint32_t)(b) + ONE_HALF, ((((t) >> G_SHIFT ) + (t) ) >> G_SHIFT ))
+    ((t) = (a) * (b) + ONE_HALF, ((((t) >> G_SHIFT ) + (t) ) >> G_SHIFT ))
 
 #define DIV_UN16(a, b)							\
-    (((uint32_t) (a) * MASK + ((b) / 2)) / (b))
+    (((uint32_t) (a) * MASK) / (b))
 
 #define ADD_UN16(x, y, t)				     \
     ((t) = (x) + (y),					     \
      (uint64_t) (uint16_t) ((t) | (0 - ((t) >> G_SHIFT))))
 
 #define DIV_ONE_UN16(x)							\
     (((x) + ONE_HALF + (((x) + ONE_HALF) >> G_SHIFT)) >> G_SHIFT)
 
--- a/gfx/cairo/libpixman/src/pixman-compiler.h
+++ b/gfx/cairo/libpixman/src/pixman-compiler.h
@@ -91,20 +91,16 @@
 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
 #   define PIXMAN_EXPORT __global
 #else
 #   define PIXMAN_EXPORT
 #endif
 
 #endif
 
-/* member offsets */
-#define CONTAINER_OF(type, member, data)				\
-    ((type *)(((uint8_t *)data) - offsetof (type, member)))
-
 /* TLS */
 #if defined(PIXMAN_NO_TLS)
 
 #   define PIXMAN_DEFINE_THREAD_LOCAL(type, name)			\
     static type name
 #   define PIXMAN_GET_THREAD_LOCAL(name)				\
     (&name)
 
--- a/gfx/cairo/libpixman/src/pixman-conical-gradient.c
+++ b/gfx/cairo/libpixman/src/pixman-conical-gradient.c
@@ -168,17 +168,17 @@ conical_get_scanline_wide (pixman_iter_t
     pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
 
     return buffer;
 }
 
 void
 _pixman_conical_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter)
 {
-    if (iter->iter_flags & ITER_NARROW)
+    if (iter->flags & ITER_NARROW)
 	iter->get_scanline = conical_get_scanline_narrow;
     else
 	iter->get_scanline = conical_get_scanline_wide;
 }
 
 PIXMAN_EXPORT pixman_image_t *
 pixman_image_create_conical_gradient (pixman_point_fixed_t *        center,
                                       pixman_fixed_t                angle,
--- a/gfx/cairo/libpixman/src/pixman-fast-path.c
+++ b/gfx/cairo/libpixman/src/pixman-fast-path.c
@@ -805,58 +805,16 @@ fast_composite_add_8_8 (pixman_implement
 		*dst = s;
 	    }
 	    dst++;
 	}
     }
 }
 
 static void
-fast_composite_add_0565_0565 (pixman_implementation_t *imp,
-                              pixman_composite_info_t *info)
-{
-    PIXMAN_COMPOSITE_ARGS (info);
-    uint16_t    *dst_line, *dst;
-    uint32_t	d;
-    uint16_t    *src_line, *src;
-    uint32_t	s;
-    int dst_stride, src_stride;
-    int32_t w;
-
-    PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint16_t, src_stride, src_line, 1);
-    PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint16_t, dst_stride, dst_line, 1);
-
-    while (height--)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-	src = src_line;
-	src_line += src_stride;
-	w = width;
-
-	while (w--)
-	{
-	    s = *src++;
-	    if (s)
-	    {
-		d = *dst;
-		s = CONVERT_0565_TO_8888 (s);
-		if (d)
-		{
-		    d = CONVERT_0565_TO_8888 (d);
-		    UN8x4_ADD_UN8x4 (s, d);
-		}
-		*dst = CONVERT_8888_TO_0565 (s);
-	    }
-	    dst++;
-	}
-    }
-}
-
-static void
 fast_composite_add_8888_8888 (pixman_implementation_t *imp,
                               pixman_composite_info_t *info)
 {
     PIXMAN_COMPOSITE_ARGS (info);
     uint32_t    *dst_line, *dst;
     uint32_t    *src_line, *src;
     int dst_stride, src_stride;
     int32_t w;
@@ -1252,18 +1210,18 @@ scaled_bilinear_scanline_8888_565_OVER (
 	uint32_t tr = src_top [pixman_fixed_to_int (vx) + 1];
 	uint32_t bl = src_bottom [pixman_fixed_to_int (vx)];
 	uint32_t br = src_bottom [pixman_fixed_to_int (vx) + 1];
 	uint32_t src, result;
 	uint16_t d;
 	d = *dst;
 	src = bilinear_interpolation (tl, tr,
 				      bl, br,
-				      pixman_fixed_to_bilinear_weight(vx),
-				      wb);
+				      interpolation_coord(vx),
+				      wb >> (8 - INTERPOLATION_PRECISION_BITS));
 	vx += unit_x;
 	result = over (src, CONVERT_0565_TO_0888 (d));
 	*dst++ = CONVERT_8888_TO_0565(result);
     }
 }
 
 static force_inline void
 scaled_bilinear_scanline_8888_8888_OVER (uint32_t *       dst,
@@ -1285,18 +1243,18 @@ scaled_bilinear_scanline_8888_8888_OVER 
 	uint32_t bl = src_bottom [pixman_fixed_to_int (vx)];
 	uint32_t br = src_bottom [pixman_fixed_to_int (vx) + 1];
 	uint32_t src;
 	uint32_t d;
 	uint32_t result;
 	d = *dst;
 	src = bilinear_interpolation (tl, tr,
 				      bl, br,
-				      pixman_fixed_to_bilinear_weight(vx),
-				      wb);
+				      interpolation_coord(vx),
+				      wb >> (8 - INTERPOLATION_PRECISION_BITS));
 	vx += unit_x;
 	*dst++ = over (src, d);
     }
 }
 
 #ifndef LOWER_QUALITY_INTERPOLATION
 
 static force_inline void
@@ -1318,18 +1276,18 @@ scaled_bilinear_scanline_565_565_SRC (ui
 	uint16_t tr = src_top [pixman_fixed_to_int (vx) + 1];
 	uint16_t bl = src_bottom [pixman_fixed_to_int (vx)];
 	uint16_t br = src_bottom [pixman_fixed_to_int (vx) + 1];
 	uint32_t d;
 	d = bilinear_interpolation(CONVERT_0565_TO_8888(tl),
 				   CONVERT_0565_TO_8888(tr),
 				   CONVERT_0565_TO_8888(bl),
 				   CONVERT_0565_TO_8888(br),
-				   pixman_fixed_to_bilinear_weight(vx),
-				   wb);
+				   interpolation_coord(vx),
+				   wb >> (8 - INTERPOLATION_PRECISION_BITS));
 	vx += unit_x;
 	*dst++ = CONVERT_8888_TO_0565(d);
     }
 }
 
 #else
 
 /* This is a clever low resolution bilinear interpolation inspired by the code
@@ -1389,19 +1347,17 @@ scaled_bilinear_scanline_565_565_SRC (ui
 {
     while ((w -= 1) >= 0)
     {
 	uint16_t tl = src_top [pixman_fixed_to_int (vx)];
 	uint16_t tr = src_top [pixman_fixed_to_int (vx) + 1];
 	uint16_t bl = src_bottom [pixman_fixed_to_int (vx)];
 	uint16_t br = src_bottom [pixman_fixed_to_int (vx) + 1];
 
-        uint16_t d = bilinear_interpolation_565 (tl, tr, bl, br,
-						 pixman_fixed_to_bilinear_weight(vx),
-						 wb);
+        uint16_t d = bilinear_interpolation_565 (tl, tr, bl, br, (vx >> 12) & 0xf, wb >> 4);
         vx += unit_x;
         *dst++ = d;
     }
 }
 
 #endif
 
 FAST_BILINEAR_MAINLOOP_COMMON (565_565_cover_SRC,
@@ -1497,19 +1453,18 @@ fast_composite_tiled_repeat (pixman_impl
 	pixman_bool_t need_src_extension;
 	uint32_t *src_line;
 	int32_t src_stride;
 	int32_t src_bpp;
 	pixman_composite_info_t info2 = *info;
 
 	src_bpp = PIXMAN_FORMAT_BPP (src_image->bits.format);
 
-	if (src_image->bits.width < REPEAT_MIN_WIDTH		&&
-	    (src_bpp == 32 || src_bpp == 16 || src_bpp == 8)	&&
-	    !src_image->bits.indexed)
+	if (src_image->bits.width < REPEAT_MIN_WIDTH &&
+	    (src_bpp == 32 || src_bpp == 16 || src_bpp == 8))
 	{
 	    sx = src_x;
 	    sx = MOD (sx, src_image->bits.width);
 	    sx += width;
 	    src_width = 0;
 
 	    while (src_width < REPEAT_MIN_WIDTH && src_width <= sx)
 		src_width += src_image->bits.width;
@@ -2096,18 +2051,16 @@ static const pixman_fast_path_t c_fast_p
     PIXMAN_STD_FAST_PATH (OVER, x8b8g8r8, a8, x8b8g8r8, fast_composite_over_x888_8_8888),
     PIXMAN_STD_FAST_PATH (OVER, x8b8g8r8, a8, a8b8g8r8, fast_composite_over_x888_8_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, a8r8g8b8, fast_composite_over_8888_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, x8r8g8b8, fast_composite_over_8888_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8r8g8b8, null, r5g6b5, fast_composite_over_8888_0565),
     PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, a8b8g8r8, fast_composite_over_8888_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, x8b8g8r8, fast_composite_over_8888_8888),
     PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, b5g6r5, fast_composite_over_8888_0565),
-    PIXMAN_STD_FAST_PATH (ADD, r5g6b5, null, r5g6b5, fast_composite_add_0565_0565),
-    PIXMAN_STD_FAST_PATH (ADD, b5g6r5, null, b5g6r5, fast_composite_add_0565_0565),
     PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, a8r8g8b8, fast_composite_add_8888_8888),
     PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, a8b8g8r8, fast_composite_add_8888_8888),
     PIXMAN_STD_FAST_PATH (ADD, a8, null, a8, fast_composite_add_8_8),
     PIXMAN_STD_FAST_PATH (ADD, a1, null, a1, fast_composite_add_1_1),
     PIXMAN_STD_FAST_PATH_CA (ADD, solid, a8r8g8b8, a8r8g8b8, fast_composite_add_n_8888_8888_ca),
     PIXMAN_STD_FAST_PATH (ADD, solid, a8, a8, fast_composite_add_n_8_8),
     PIXMAN_STD_FAST_PATH (SRC, solid, null, a8r8g8b8, fast_composite_solid_fill),
     PIXMAN_STD_FAST_PATH (SRC, solid, null, x8r8g8b8, fast_composite_solid_fill),
--- a/gfx/cairo/libpixman/src/pixman-general.c
+++ b/gfx/cairo/libpixman/src/pixman-general.c
@@ -105,17 +105,17 @@ general_composite_rect  (pixman_implemen
 {
     PIXMAN_COMPOSITE_ARGS (info);
     uint64_t stack_scanline_buffer[(SCANLINE_BUFFER_LENGTH * 3 + 7) / 8];
     uint8_t *scanline_buffer = (uint8_t *) stack_scanline_buffer;
     uint8_t *src_buffer, *mask_buffer, *dest_buffer;
     pixman_iter_t src_iter, mask_iter, dest_iter;
     pixman_combine_32_func_t compose;
     pixman_bool_t component_alpha;
-    iter_flags_t narrow, src_iter_flags;
+    iter_flags_t narrow, src_flags;
     iter_flags_t rgb16;
     int Bpp;
     int i;
 
     if ((src_image->common.flags & FAST_PATH_NARROW_FORMAT)		    &&
 	(!mask_image || mask_image->common.flags & FAST_PATH_NARROW_FORMAT) &&
 	(dest_image->common.flags & FAST_PATH_NARROW_FORMAT))
     {
@@ -150,46 +150,46 @@ general_composite_rect  (pixman_implemen
 	    return;
     }
 
     src_buffer = scanline_buffer;
     mask_buffer = src_buffer + width * Bpp;
     dest_buffer = mask_buffer + width * Bpp;
 
     /* src iter */
-    src_iter_flags = narrow | op_flags[op].src | rgb16;
+    src_flags = narrow | op_flags[op].src | rgb16;
 
     _pixman_implementation_src_iter_init (imp->toplevel, &src_iter, src_image,
 					  src_x, src_y, width, height,
-					  src_buffer, src_iter_flags, info->src_flags);
+					  src_buffer, src_flags);
 
     /* mask iter */
-    if ((src_iter_flags & (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) ==
+    if ((src_flags & (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) ==
 	(ITER_IGNORE_ALPHA | ITER_IGNORE_RGB))
     {
 	/* If it doesn't matter what the source is, then it doesn't matter
 	 * what the mask is
 	 */
 	mask_image = NULL;
     }
 
     component_alpha =
         mask_image			      &&
         mask_image->common.type == BITS       &&
         mask_image->common.component_alpha    &&
         PIXMAN_FORMAT_RGB (mask_image->bits.format);
 
     _pixman_implementation_src_iter_init (
 	imp->toplevel, &mask_iter, mask_image, mask_x, mask_y, width, height,
-	mask_buffer, narrow | (component_alpha? 0 : ITER_IGNORE_RGB), info->mask_flags);
+	mask_buffer, narrow | (component_alpha? 0 : ITER_IGNORE_RGB));
 
     /* dest iter */
     _pixman_implementation_dest_iter_init (
 	imp->toplevel, &dest_iter, dest_image, dest_x, dest_y, width, height,
-	dest_buffer, narrow | op_flags[op].dst | rgb16, info->dest_flags);
+	dest_buffer, narrow | op_flags[op].dst | rgb16);
 
     compose = _pixman_implementation_lookup_combiner (
 	imp->toplevel, op, component_alpha, narrow, !!rgb16);
 
     if (!compose)
 	return;
 
     for (i = 0; i < height; ++i)
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-glyph.c
+++ /dev/null
@@ -1,676 +0,0 @@
-/*
- * Copyright 2010, 2012, Soren Sandmann <sandmann@cs.au.dk>
- * Copyright 2010, 2011, 2012, 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 (including the next
- * paragraph) 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: Soren Sandmann <sandmann@cs.au.dk>
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "pixman-private.h"
-
-#include <stdlib.h>
-
-typedef struct glyph_metrics_t glyph_metrics_t;
-typedef struct glyph_t glyph_t;
-
-#define TOMBSTONE ((glyph_t *)0x1)
-
-/* XXX: These numbers are arbitrary---we've never done any measurements.
- */
-#define N_GLYPHS_HIGH_WATER  (16384)
-#define N_GLYPHS_LOW_WATER   (8192)
-#define HASH_SIZE (2 * N_GLYPHS_HIGH_WATER)
-#define HASH_MASK (HASH_SIZE - 1)
-
-struct glyph_t
-{
-    void *		font_key;
-    void *		glyph_key;
-    int			origin_x;
-    int			origin_y;
-    pixman_image_t *	image;
-    pixman_link_t	mru_link;
-};
-
-struct pixman_glyph_cache_t
-{
-    int			n_glyphs;
-    int			n_tombstones;
-    int			freeze_count;
-    pixman_list_t	mru;
-    glyph_t *		glyphs[HASH_SIZE];
-};
-
-static void
-free_glyph (glyph_t *glyph)
-{
-    pixman_list_unlink (&glyph->mru_link);
-    pixman_image_unref (glyph->image);
-    free (glyph);
-}
-
-static unsigned int
-hash (const void *font_key, const void *glyph_key)
-{
-    size_t key = (size_t)font_key + (size_t)glyph_key;
-
-    /* This hash function is based on one found on Thomas Wang's
-     * web page at
-     *
-     *    http://www.concentric.net/~Ttwang/tech/inthash.htm
-     *
-     */
-    key = (key << 15) - key - 1;
-    key = key ^ (key >> 12);
-    key = key + (key << 2);
-    key = key ^ (key >> 4);
-    key = key + (key << 3) + (key << 11);
-    key = key ^ (key >> 16);
-
-    return key;
-}
-
-static glyph_t *
-lookup_glyph (pixman_glyph_cache_t *cache,
-	      void                 *font_key,
-	      void                 *glyph_key)
-{
-    unsigned idx;
-    glyph_t *g;
-
-    idx = hash (font_key, glyph_key);
-    while ((g = cache->glyphs[idx++ & HASH_MASK]))
-    {
-	if (g != TOMBSTONE			&&
-	    g->font_key == font_key		&&
-	    g->glyph_key == glyph_key)
-	{
-	    return g;
-	}
-    }
-
-    return NULL;
-}
-
-static void
-insert_glyph (pixman_glyph_cache_t *cache,
-	      glyph_t              *glyph)
-{
-    unsigned idx;
-    glyph_t **loc;
-
-    idx = hash (glyph->font_key, glyph->glyph_key);
-
-    /* Note: we assume that there is room in the table. If there isn't,
-     * this will be an infinite loop.
-     */
-    do
-    {
-	loc = &cache->glyphs[idx++ & HASH_MASK];
-    } while (*loc && *loc != TOMBSTONE);
-
-    if (*loc == TOMBSTONE)
-	cache->n_tombstones--;
-    cache->n_glyphs++;
-
-    *loc = glyph;
-}
-
-static void
-remove_glyph (pixman_glyph_cache_t *cache,
-	      glyph_t              *glyph)
-{
-    unsigned idx;
-
-    idx = hash (glyph->font_key, glyph->glyph_key);
-    while (cache->glyphs[idx & HASH_MASK] != glyph)
-	idx++;
-
-    cache->glyphs[idx & HASH_MASK] = TOMBSTONE;
-    cache->n_tombstones++;
-    cache->n_glyphs--;
-
-    /* Eliminate tombstones if possible */
-    if (cache->glyphs[(idx + 1) & HASH_MASK] == NULL)
-    {
-	while (cache->glyphs[idx & HASH_MASK] == TOMBSTONE)
-	{
-	    cache->glyphs[idx & HASH_MASK] = NULL;
-	    cache->n_tombstones--;
-	    idx--;
-	}
-    }
-}
-
-static void
-clear_table (pixman_glyph_cache_t *cache)
-{
-    int i;
-
-    for (i = 0; i < HASH_SIZE; ++i)
-    {
-	glyph_t *glyph = cache->glyphs[i];
-
-	if (glyph && glyph != TOMBSTONE)
-	    free_glyph (glyph);
-
-	cache->glyphs[i] = NULL;
-    }
-
-    cache->n_glyphs = 0;
-    cache->n_tombstones = 0;
-}
-
-PIXMAN_EXPORT pixman_glyph_cache_t *
-pixman_glyph_cache_create (void)
-{
-    pixman_glyph_cache_t *cache;
-
-    if (!(cache = malloc (sizeof *cache)))
-	return NULL;
-
-    memset (cache->glyphs, 0, sizeof (cache->glyphs));
-    cache->n_glyphs = 0;
-    cache->n_tombstones = 0;
-    cache->freeze_count = 0;
-
-    pixman_list_init (&cache->mru);
-
-    return cache;
-}
-
-PIXMAN_EXPORT void
-pixman_glyph_cache_destroy (pixman_glyph_cache_t *cache)
-{
-    return_if_fail (cache->freeze_count == 0);
-
-    clear_table (cache);
-
-    free (cache);
-}
-
-PIXMAN_EXPORT void
-pixman_glyph_cache_freeze (pixman_glyph_cache_t  *cache)
-{
-    cache->freeze_count++;
-}
-
-PIXMAN_EXPORT void
-pixman_glyph_cache_thaw (pixman_glyph_cache_t  *cache)
-{
-    if (--cache->freeze_count == 0					&&
-	cache->n_glyphs + cache->n_tombstones > N_GLYPHS_HIGH_WATER)
-    {
-	if (cache->n_tombstones > N_GLYPHS_HIGH_WATER)
-	{
-	    /* More than half the entries are
-	     * tombstones. Just dump the whole table.
-	     */
-	    clear_table (cache);
-	}
-
-	while (cache->n_glyphs > N_GLYPHS_LOW_WATER)
-	{
-	    glyph_t *glyph = CONTAINER_OF (glyph_t, mru_link, cache->mru.tail);
-
-	    remove_glyph (cache, glyph);
-	    free_glyph (glyph);
-	}
-    }
-}
-
-PIXMAN_EXPORT const void *
-pixman_glyph_cache_lookup (pixman_glyph_cache_t  *cache,
-			   void                  *font_key,
-			   void                  *glyph_key)
-{
-    return lookup_glyph (cache, font_key, glyph_key);
-}
-
-PIXMAN_EXPORT const void *
-pixman_glyph_cache_insert (pixman_glyph_cache_t  *cache,
-			   void                  *font_key,
-			   void                  *glyph_key,
-			   int			  origin_x,
-			   int                    origin_y,
-			   pixman_image_t        *image)
-{
-    glyph_t *glyph;
-    int32_t width, height;
-
-    return_val_if_fail (cache->freeze_count > 0, NULL);
-    return_val_if_fail (image->type == BITS, NULL);
-
-    width = image->bits.width;
-    height = image->bits.height;
-
-    if (cache->n_glyphs >= HASH_SIZE)
-	return NULL;
-
-    if (!(glyph = malloc (sizeof *glyph)))
-	return NULL;
-
-    glyph->font_key = font_key;
-    glyph->glyph_key = glyph_key;
-    glyph->origin_x = origin_x;
-    glyph->origin_y = origin_y;
-
-    if (!(glyph->image = pixman_image_create_bits (
-	      image->bits.format, width, height, NULL, -1)))
-    {
-	free (glyph);
-	return NULL;
-    }
-
-    pixman_image_composite32 (PIXMAN_OP_SRC,
-			      image, NULL, glyph->image, 0, 0, 0, 0, 0, 0,
-			      width, height);
-
-    if (PIXMAN_FORMAT_A   (glyph->image->bits.format) != 0	&&
-	PIXMAN_FORMAT_RGB (glyph->image->bits.format) != 0)
-    {
-	pixman_image_set_component_alpha (glyph->image, TRUE);
-    }
-
-    pixman_list_prepend (&cache->mru, &glyph->mru_link);
-
-    _pixman_image_validate (glyph->image);
-    insert_glyph (cache, glyph);
-
-    return glyph;
-}
-
-PIXMAN_EXPORT void
-pixman_glyph_cache_remove (pixman_glyph_cache_t  *cache,
-			   void                  *font_key,
-			   void                  *glyph_key)
-{
-    glyph_t *glyph;
-
-    if ((glyph = lookup_glyph (cache, font_key, glyph_key)))
-    {
-	remove_glyph (cache, glyph);
-
-	free_glyph (glyph);
-    }
-}
-
-PIXMAN_EXPORT void
-pixman_glyph_get_extents (pixman_glyph_cache_t *cache,
-			  int                   n_glyphs,
-			  pixman_glyph_t       *glyphs,
-			  pixman_box32_t       *extents)
-{
-    int i;
-
-    extents->x1 = extents->y1 = INT32_MAX;
-    extents->x2 = extents->y2 = INT32_MIN;
-
-    for (i = 0; i < n_glyphs; ++i)
-    {
-	glyph_t *glyph = (glyph_t *)glyphs[i].glyph;
-	int x1, y1, x2, y2;
-
-	x1 = glyphs[i].x - glyph->origin_x;
-	y1 = glyphs[i].y - glyph->origin_y;
-	x2 = glyphs[i].x - glyph->origin_x + glyph->image->bits.width;
-	y2 = glyphs[i].y - glyph->origin_y + glyph->image->bits.height;
-
-	if (x1 < extents->x1)
-	    extents->x1 = x1;
-	if (y1 < extents->y1)
-	    extents->y1 = y1;
-	if (x2 > extents->x2)
-	    extents->x2 = x2;
-	if (y2 > extents->y2)
-	    extents->y2 = y2;
-    }
-}
-
-/* This function returns a format that is suitable for use as a mask for the
- * set of glyphs in question.
- */
-PIXMAN_EXPORT pixman_format_code_t
-pixman_glyph_get_mask_format (pixman_glyph_cache_t *cache,
-			      int		    n_glyphs,
-			      pixman_glyph_t *      glyphs)
-{
-    pixman_format_code_t format = PIXMAN_a1;
-    int i;
-
-    for (i = 0; i < n_glyphs; ++i)
-    {
-	const glyph_t *glyph = glyphs[i].glyph;
-	pixman_format_code_t glyph_format = glyph->image->bits.format;
-
-	if (PIXMAN_FORMAT_TYPE (glyph_format) == PIXMAN_TYPE_A)
-	{
-	    if (PIXMAN_FORMAT_A (glyph_format) > PIXMAN_FORMAT_A (format))
-		format = glyph_format;
-	}
-	else
-	{
-	    return PIXMAN_a8r8g8b8;
-	}
-    }
-
-    return format;
-}
-
-static pixman_bool_t
-box32_intersect (pixman_box32_t *dest,
-		 const pixman_box32_t *box1,
-		 const pixman_box32_t *box2)
-{
-    dest->x1 = MAX (box1->x1, box2->x1);
-    dest->y1 = MAX (box1->y1, box2->y1);
-    dest->x2 = MIN (box1->x2, box2->x2);
-    dest->y2 = MIN (box1->y2, box2->y2);
-
-    return dest->x2 > dest->x1 && dest->y2 > dest->y1;
-}
-
-PIXMAN_EXPORT void
-pixman_composite_glyphs_no_mask (pixman_op_t            op,
-				 pixman_image_t        *src,
-				 pixman_image_t        *dest,
-				 int32_t                src_x,
-				 int32_t                src_y,
-				 int32_t                dest_x,
-				 int32_t                dest_y,
-				 pixman_glyph_cache_t  *cache,
-				 int                    n_glyphs,
-				 pixman_glyph_t        *glyphs)
-{
-    pixman_region32_t region;
-    pixman_format_code_t glyph_format = PIXMAN_null;
-    uint32_t glyph_flags = 0;
-    pixman_format_code_t dest_format;
-    uint32_t dest_flags;
-    pixman_composite_func_t func = NULL;
-    pixman_implementation_t *implementation = NULL;
-    pixman_composite_info_t info;
-    int i;
-
-    _pixman_image_validate (src);
-    _pixman_image_validate (dest);
-    
-    dest_format = dest->common.extended_format_code;
-    dest_flags = dest->common.flags;
-    
-    pixman_region32_init (&region);
-    if (!_pixman_compute_composite_region32 (
-	    &region,
-	    src, NULL, dest,
-	    src_x - dest_x, src_y - dest_y, 0, 0, 0, 0,
-	    dest->bits.width, dest->bits.height))
-    {
-	goto out;
-    }
-
-    info.op = op;
-    info.src_image = src;
-    info.dest_image = dest;
-    info.src_flags = src->common.flags;
-    info.dest_flags = dest->common.flags;
-
-    for (i = 0; i < n_glyphs; ++i)
-    {
-	glyph_t *glyph = (glyph_t *)glyphs[i].glyph;
-	pixman_image_t *glyph_img = glyph->image;
-	pixman_box32_t glyph_box;
-	pixman_box32_t *pbox;
-	uint32_t extra = FAST_PATH_SAMPLES_COVER_CLIP_NEAREST;
-	pixman_box32_t composite_box;
-	int n;
-
-	glyph_box.x1 = dest_x + glyphs[i].x - glyph->origin_x;
-	glyph_box.y1 = dest_y + glyphs[i].y - glyph->origin_y;
-	glyph_box.x2 = glyph_box.x1 + glyph->image->bits.width;
-	glyph_box.y2 = glyph_box.y1 + glyph->image->bits.height;
-	
-	pbox = pixman_region32_rectangles (&region, &n);
-	
-	info.mask_image = glyph_img;
-
-	while (n--)
-	{
-	    if (box32_intersect (&composite_box, pbox, &glyph_box))
-	    {
-		if (glyph_img->common.extended_format_code != glyph_format	||
-		    glyph_img->common.flags != glyph_flags)
-		{
-		    glyph_format = glyph_img->common.extended_format_code;
-		    glyph_flags = glyph_img->common.flags;
-		    
-		    _pixman_lookup_composite_function (
-			get_implementation(), op,
-			src->common.extended_format_code, src->common.flags,
-			glyph_format, glyph_flags | extra,
-			dest_format, dest_flags,
-			&implementation, &func);
-
-		    if (!func)
-			goto out;
-		}
-
-		info.src_x = src_x + composite_box.x1 - dest_x;
-		info.src_y = src_y + composite_box.y1 - dest_y;
-		info.mask_x = composite_box.x1 - (dest_x + glyphs[i].x - glyph->origin_x);
-		info.mask_y = composite_box.y1 - (dest_y + glyphs[i].y - glyph->origin_y);
-		info.dest_x = composite_box.x1;
-		info.dest_y = composite_box.y1;
-		info.width = composite_box.x2 - composite_box.x1;
-		info.height = composite_box.y2 - composite_box.y1;
-
-		info.mask_flags = glyph_flags;
-
-		func (implementation, &info);
-	    }
-
-	    pbox++;
-	}
-	pixman_list_move_to_front (&cache->mru, &glyph->mru_link);
-    }
-
-out:
-    pixman_region32_fini (&region);
-}
-
-static void
-add_glyphs (pixman_glyph_cache_t *cache,
-	    pixman_image_t *dest,
-	    int off_x, int off_y,
-	    int n_glyphs, pixman_glyph_t *glyphs)
-{
-    pixman_format_code_t glyph_format = PIXMAN_null;
-    uint32_t glyph_flags = 0;
-    pixman_composite_func_t func = NULL;
-    pixman_implementation_t *implementation = NULL;
-    uint32_t dest_format;
-    uint32_t dest_flags;
-    pixman_box32_t dest_box;
-    pixman_composite_info_t info;
-    pixman_image_t *white_img = NULL;
-    pixman_bool_t white_src = FALSE;
-    int i;
-
-    _pixman_image_validate (dest);
-
-    dest_format = dest->common.extended_format_code;
-    dest_flags = dest->common.flags;
-
-    info.op = PIXMAN_OP_ADD;
-    info.dest_image = dest;
-    info.src_x = 0;
-    info.src_y = 0;
-    info.dest_flags = dest_flags;
-
-    dest_box.x1 = 0;
-    dest_box.y1 = 0;
-    dest_box.x2 = dest->bits.width;
-    dest_box.y2 = dest->bits.height;
-
-    for (i = 0; i < n_glyphs; ++i)
-    {
-	glyph_t *glyph = (glyph_t *)glyphs[i].glyph;
-	pixman_image_t *glyph_img = glyph->image;
-	pixman_box32_t glyph_box;
-	pixman_box32_t composite_box;
-
-	if (glyph_img->common.extended_format_code != glyph_format	||
-	    glyph_img->common.flags != glyph_flags)
-	{
-	    pixman_format_code_t src_format, mask_format;
-
-	    glyph_format = glyph_img->common.extended_format_code;
-	    glyph_flags = glyph_img->common.flags;
-
-	    if (glyph_format == dest->bits.format)
-	    {
-		src_format = glyph_format;
-		mask_format = PIXMAN_null;
-		info.src_flags = glyph_flags | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST;
-		info.mask_flags = FAST_PATH_IS_OPAQUE;
-		info.mask_image = NULL;
-		white_src = FALSE;
-	    }
-	    else
-	    {
-		if (!white_img)
-		{
-		    pixman_color_t white = { 0xffff, 0xffff, 0xffff, 0xffff };
-
-		    if (!(white_img = pixman_image_create_solid_fill (&white)))
-			goto out;
-
-		    _pixman_image_validate (white_img);
-		}
-
-		src_format = PIXMAN_solid;
-		mask_format = glyph_format;
-		info.src_flags = white_img->common.flags;
-		info.mask_flags = glyph_flags | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST;
-		info.src_image = white_img;
-		white_src = TRUE;
-	    }
-
-	    _pixman_lookup_composite_function (
-		get_implementation(), PIXMAN_OP_ADD,
-		src_format, info.src_flags,
-		mask_format, info.mask_flags,
-		dest_format, dest_flags,
-		&implementation, &func);
-
-	    if (!func)
-		goto out;
-	}
-
-	glyph_box.x1 = glyphs[i].x - glyph->origin_x + off_x;
-	glyph_box.y1 = glyphs[i].y - glyph->origin_y + off_y;
-	glyph_box.x2 = glyph_box.x1 + glyph->image->bits.width;
-	glyph_box.y2 = glyph_box.y1 + glyph->image->bits.height;
-	
-	if (box32_intersect (&composite_box, &glyph_box, &dest_box))
-	{
-	    int src_x = composite_box.x1 - glyph_box.x1;
-	    int src_y = composite_box.y1 - glyph_box.y1;
-
-	    if (white_src)
-		info.mask_image = glyph_img;
-	    else
-		info.src_image = glyph_img;
-
-	    info.mask_x = info.src_x = src_x;
-	    info.mask_y = info.src_y = src_y;
-	    info.dest_x = composite_box.x1;
-	    info.dest_y = composite_box.y1;
-	    info.width = composite_box.x2 - composite_box.x1;
-	    info.height = composite_box.y2 - composite_box.y1;
-
-	    func (implementation, &info);
-
-	    pixman_list_move_to_front (&cache->mru, &glyph->mru_link);
-	}
-    }
-
-out:
-    if (white_img)
-	pixman_image_unref (white_img);
-}
-
-/* Conceptually, for each glyph, (white IN glyph) is PIXMAN_OP_ADDed to an
- * infinitely big mask image at the position such that the glyph origin point
- * is positioned at the (glyphs[i].x, glyphs[i].y) point.
- *
- * Then (mask_x, mask_y) in the infinite mask and (src_x, src_y) in the source
- * image are both aligned with (dest_x, dest_y) in the destination image. Then
- * these three images are composited within the 
- *
- *       (dest_x, dest_y, dst_x + width, dst_y + height)
- *
- * rectangle.
- *
- * TODO:
- *   - Trim the mask to the destination clip/image?
- *   - Trim composite region based on sources, when the op ignores 0s.
- */
-PIXMAN_EXPORT void
-pixman_composite_glyphs (pixman_op_t            op,
-			 pixman_image_t        *src,
-			 pixman_image_t        *dest,
-			 pixman_format_code_t   mask_format,
-			 int32_t                src_x,
-			 int32_t                src_y,
-			 int32_t		mask_x,
-			 int32_t		mask_y,
-			 int32_t                dest_x,
-			 int32_t                dest_y,
-			 int32_t                width,
-			 int32_t                height,
-			 pixman_glyph_cache_t  *cache,
-			 int			n_glyphs,
-			 pixman_glyph_t        *glyphs)
-{
-    pixman_image_t *mask;
-
-    if (!(mask = pixman_image_create_bits (mask_format, width, height, NULL, -1)))
-	return;
-
-    if (PIXMAN_FORMAT_A   (mask_format) != 0 &&
-	PIXMAN_FORMAT_RGB (mask_format) != 0)
-    {
-	pixman_image_set_component_alpha (mask, TRUE);
-    }
-
-    add_glyphs (cache, mask, - mask_x, - mask_y, n_glyphs, glyphs);
-
-    pixman_image_composite32 (op, src, mask, dest,
-			      src_x, src_y,
-			      0, 0,
-			      dest_x, dest_y,
-			      width, height);
-
-    pixman_image_unref (mask);
-}
--- a/gfx/cairo/libpixman/src/pixman-image.c
+++ b/gfx/cairo/libpixman/src/pixman-image.c
@@ -878,48 +878,26 @@ pixman_image_get_format (pixman_image_t 
 }
 
 uint32_t
 _pixman_image_get_solid (pixman_implementation_t *imp,
 			 pixman_image_t *         image,
                          pixman_format_code_t     format)
 {
     uint32_t result;
+    pixman_iter_t iter;
 
-    if (image->type == SOLID)
-    {
-	result = image->solid.color_32;
-    }
-    else if (image->type == BITS)
-    {
-	if (image->bits.format == PIXMAN_a8r8g8b8)
-	    result = image->bits.bits[0];
-	else if (image->bits.format == PIXMAN_x8r8g8b8)
-	    result = image->bits.bits[0] | 0xff000000;
-	else if (image->bits.format == PIXMAN_a8)
-	    result = (*(uint8_t *)image->bits.bits) << 24;
-	else
-	    goto otherwise;
-    }
-    else
-    {
-	pixman_iter_t iter;
+    _pixman_implementation_src_iter_init (
+	imp, &iter, image, 0, 0, 1, 1,
+	(uint8_t *)&result, ITER_NARROW);
 
-    otherwise:
-	_pixman_implementation_src_iter_init (
-	    imp, &iter, image, 0, 0, 1, 1,
-	    (uint8_t *)&result,
-	    ITER_NARROW, image->common.flags);
-	
-	result = *iter.get_scanline (&iter, NULL);
-    }
+    result = *iter.get_scanline (&iter, NULL);
 
     /* If necessary, convert RGB <--> BGR. */
-    if (PIXMAN_FORMAT_TYPE (format) != PIXMAN_TYPE_ARGB
-	&& PIXMAN_FORMAT_TYPE (format) != PIXMAN_TYPE_ARGB_SRGB)
+    if (PIXMAN_FORMAT_TYPE (format) != PIXMAN_TYPE_ARGB)
     {
 	result = (((result & 0xff000000) >>  0) |
 	          ((result & 0x00ff0000) >> 16) |
 	          ((result & 0x0000ff00) >>  0) |
 	          ((result & 0x000000ff) << 16));
     }
 
     return result;
--- a/gfx/cairo/libpixman/src/pixman-implementation.c
+++ b/gfx/cairo/libpixman/src/pixman-implementation.c
@@ -186,97 +186,42 @@ void
 _pixman_implementation_src_iter_init (pixman_implementation_t	*imp,
 				      pixman_iter_t             *iter,
 				      pixman_image_t		*image,
 				      int			 x,
 				      int			 y,
 				      int			 width,
 				      int			 height,
 				      uint8_t			*buffer,
-				      iter_flags_t		 iter_flags,
-				      uint32_t                   image_flags)
+				      iter_flags_t		 flags)
 {
     iter->image = image;
     iter->buffer = (uint32_t *)buffer;
     iter->x = x;
     iter->y = y;
     iter->width = width;
     iter->height = height;
-    iter->iter_flags = iter_flags;
-    iter->image_flags = image_flags;
+    iter->flags = flags;
 
     (*imp->src_iter_init) (imp, iter);
 }
 
 void
 _pixman_implementation_dest_iter_init (pixman_implementation_t	*imp,
 				       pixman_iter_t            *iter,
 				       pixman_image_t		*image,
 				       int			 x,
 				       int			 y,
 				       int			 width,
 				       int			 height,
 				       uint8_t			*buffer,
-				       iter_flags_t		 iter_flags,
-				       uint32_t                  image_flags)
+				       iter_flags_t		 flags)
 {
     iter->image = image;
     iter->buffer = (uint32_t *)buffer;
     iter->x = x;
     iter->y = y;
     iter->width = width;
     iter->height = height;
-    iter->iter_flags = iter_flags;
-    iter->image_flags = image_flags;
+    iter->flags = flags;
 
     (*imp->dest_iter_init) (imp, iter);
 }
-
-pixman_bool_t
-_pixman_disabled (const char *name)
-{
-    const char *env;
-
-    if ((env = getenv ("PIXMAN_DISABLE")))
-    {
-	do
-	{
-	    const char *end;
-	    int len;
-
-	    if ((end = strchr (env, ' ')))
-		len = end - env;
-	    else
-		len = strlen (env);
-
-	    if (strlen (name) == len && strncmp (name, env, len) == 0)
-	    {
-		printf ("pixman: Disabled %s implementation\n", name);
-		return TRUE;
-	    }
-
-	    env += len;
-	}
-	while (*env++);
-    }
-
-    return FALSE;
-}
-
-pixman_implementation_t *
-_pixman_choose_implementation (void)
-{
-    pixman_implementation_t *imp;
-
-    imp = _pixman_implementation_create_general();
-
-    if (!_pixman_disabled ("fast"))
-	imp = _pixman_implementation_create_fast_path (imp);
-
-    imp = _pixman_x86_get_implementations (imp);
-    imp = _pixman_arm_get_implementations (imp);
-    imp = _pixman_ppc_get_implementations (imp);
-    imp = _pixman_mips_get_implementations (imp);
-
-    imp = _pixman_implementation_create_noop (imp);
-
-    return imp;
-}
--- a/gfx/cairo/libpixman/src/pixman-inlines.h
+++ b/gfx/cairo/libpixman/src/pixman-inlines.h
@@ -76,37 +76,48 @@ repeat (pixman_repeat_t repeat, int *c, 
     {
 	*c = MOD (*c, size * 2);
 	if (*c >= size)
 	    *c = size * 2 - *c - 1;
     }
     return TRUE;
 }
 
-static force_inline int
-pixman_fixed_to_bilinear_weight (pixman_fixed_t x)
+#ifdef MOZ_GFX_OPTIMIZE_MOBILE
+#define LOW_QUALITY_INTERPOLATION
+#define LOWER_QUALITY_INTERPOLATION
+#endif
+
+#ifdef LOW_QUALITY_INTERPOLATION
+#define INTERPOLATION_PRECISION_BITS 4
+#else
+#define INTERPOLATION_PRECISION_BITS 8
+#endif
+static force_inline int32_t
+interpolation_coord(pixman_fixed_t t)
 {
-    return (x >> (16 - BILINEAR_INTERPOLATION_BITS)) &
-	   ((1 << BILINEAR_INTERPOLATION_BITS) - 1);
+#ifdef LOW_QUALITY_INTERPOLATION
+    return (t >> 12) & 0xf;
+#else
+    return (t >> 8) & 0xff;
+#endif
 }
 
+
 #if SIZEOF_LONG > 4
 
 static force_inline uint32_t
 bilinear_interpolation (uint32_t tl, uint32_t tr,
 			uint32_t bl, uint32_t br,
 			int distx, int disty)
 {
     uint64_t distxy, distxiy, distixy, distixiy;
     uint64_t tl64, tr64, bl64, br64;
     uint64_t f, r;
 
-    distx <<= (8 - BILINEAR_INTERPOLATION_BITS);
-    disty <<= (8 - BILINEAR_INTERPOLATION_BITS);
-
     distxy = distx * disty;
     distxiy = distx * (256 - disty);
     distixy = (256 - distx) * disty;
     distixiy = (256 - distx) * (256 - disty);
 
     /* Alpha and Blue */
     tl64 = tl & 0xff0000ff;
     tr64 = tr & 0xff0000ff;
@@ -168,19 +179,16 @@ bilinear_interpolation(uint32_t a00, uin
 static force_inline uint32_t
 bilinear_interpolation (uint32_t tl, uint32_t tr,
 			uint32_t bl, uint32_t br,
 			int distx, int disty)
 {
     int distxy, distxiy, distixy, distixiy;
     uint32_t f, r;
 
-    distx <<= (8 - BILINEAR_INTERPOLATION_BITS);
-    disty <<= (8 - BILINEAR_INTERPOLATION_BITS);
-
     distxy = distx * disty;
     distxiy = (distx << 8) - distxy;	/* distx * (256 - disty) */
     distixy = (disty << 8) - distxy;	/* disty * (256 - distx) */
     distixiy =
 	256 * 256 - (disty << 8) -
 	(distx << 8) + distxy;		/* (256 - distx) * (256 - disty) */
 
     /* Blue */
@@ -801,24 +809,22 @@ bilinear_pad_repeat_get_scanline_bounds 
  *  unit_x              - position increment needed to move to the next pair
  *                        of pixels
  *  max_vx              - image size as a fixed point value, can be used for
  *                        implementing NORMAL repeat (when it is supported)
  *  zero_src            - boolean hint variable, which is set to TRUE when
  *                        all source pixels are fetched from zero padding
  *                        zone for NONE repeat
  *
- * Note: normally the sum of 'weight_top' and 'weight_bottom' is equal to
- *       BILINEAR_INTERPOLATION_RANGE, but sometimes it may be less than that
- *       for NONE repeat when handling fuzzy antialiased top or bottom image
- *       edges. Also both top and bottom weight variables are guaranteed to
- *       have value, which is less than BILINEAR_INTERPOLATION_RANGE.
- *       For example, the weights can fit into unsigned byte or be used
- *       with 8-bit SIMD multiplication instructions for 8-bit interpolation
- *       precision.
+ * Note: normally the sum of 'weight_top' and 'weight_bottom' is equal to 256,
+ *       but sometimes it may be less than that for NONE repeat when handling
+ *       fuzzy antialiased top or bottom image edges. Also both top and
+ *       bottom weight variables are guaranteed to have value in 0-255
+ *       range and can fit into unsigned byte or be used with 8-bit SIMD
+ *       multiplication instructions.
  */
 
 /* Replace a single "scanline_func" with "fetch_func" & "op_func" to allow optional
  * two stage processing (bilinear fetch to a temp buffer, followed by unscaled
  * combine), "op_func" may be NULL, in this case we keep old behavior.
  * This is ugly and gcc issues some warnings, but works.
  *
  * An advice: clang has much better error reporting than gcc for deeply nested macros.
@@ -963,28 +969,28 @@ fast_composite_scaled_bilinear ## scale_
 	vx = v.vector[0];									\
 	if (flags & FLAG_HAVE_NON_SOLID_MASK)							\
 	{											\
 	    mask = mask_line;									\
 	    mask_line += mask_stride;								\
 	}											\
 												\
 	y1 = pixman_fixed_to_int (vy);								\
-	weight2 = pixman_fixed_to_bilinear_weight (vy);						\
+	weight2 = (vy >> 8) & 0xff;								\
 	if (weight2)										\
 	{											\
-	    /* both weight1 and weight2 are smaller than BILINEAR_INTERPOLATION_RANGE */	\
+	    /* normal case, both row weights are in 0-255 range and fit unsigned byte */	\
 	    y2 = y1 + 1;									\
-	    weight1 = BILINEAR_INTERPOLATION_RANGE - weight2;					\
+	    weight1 = 256 - weight2;								\
 	}											\
 	else											\
 	{											\
-	    /* set both top and bottom row to the same scanline and tweak weights */		\
+	    /* set both top and bottom row to the same scanline, and weights to 128+128 */	\
 	    y2 = y1;										\
-	    weight1 = weight2 = BILINEAR_INTERPOLATION_RANGE / 2;				\
+	    weight1 = weight2 = 128;								\
 	}											\
 	vy += unit_y;										\
 	if (PIXMAN_REPEAT_ ## repeat_mode == PIXMAN_REPEAT_PAD)					\
 	{											\
 	    src_type_t *src1, *src2;								\
 	    src_type_t buf1[2];									\
 	    src_type_t buf2[2];									\
 	    repeat (PIXMAN_REPEAT_PAD, &y1, src_image->bits.height);				\
--- a/gfx/cairo/libpixman/src/pixman-linear-gradient.c
+++ b/gfx/cairo/libpixman/src/pixman-linear-gradient.c
@@ -393,30 +393,30 @@ linear_get_scanline_wide (pixman_iter_t 
 
 void
 _pixman_linear_gradient_iter_init (pixman_image_t *image, pixman_iter_t  *iter)
 {
     // XXX: we can't use this optimization when dithering
     if (0 && linear_gradient_is_horizontal (
 	    iter->image, iter->x, iter->y, iter->width, iter->height))
     {
-	if (iter->iter_flags & ITER_16)
+	if (iter->flags & ITER_16)
 	    linear_get_scanline_16 (iter, NULL);
-	else if (iter->iter_flags & ITER_NARROW)
+	else if (iter->flags & ITER_NARROW)
 	    linear_get_scanline_narrow (iter, NULL);
 	else
 	    linear_get_scanline_wide (iter, NULL);
 
 	iter->get_scanline = _pixman_iter_get_scanline_noop;
     }
     else
     {
-	if (iter->iter_flags & ITER_16)
+	if (iter->flags & ITER_16)
 	    iter->get_scanline = linear_get_scanline_16;
-	else if (iter->iter_flags & ITER_NARROW)
+	else if (iter->flags & ITER_NARROW)
 	    iter->get_scanline = linear_get_scanline_narrow;
 	else
 	    iter->get_scanline = linear_get_scanline_wide;
     }
 }
 
 PIXMAN_EXPORT pixman_image_t *
 pixman_image_create_linear_gradient (pixman_point_fixed_t *        p1,
--- a/gfx/cairo/libpixman/src/pixman-matrix.c
+++ b/gfx/cairo/libpixman/src/pixman-matrix.c
@@ -20,17 +20,17 @@
  * OF THIS SOFTWARE.
  */
 
 /*
  * Matrix interfaces
  */
 
 #ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
 #endif
 
 #include <math.h>
 #include <string.h>
 #include "pixman-private.h"
 
 #define F(x)    pixman_int_to_fixed (x)
 
@@ -466,18 +466,18 @@ pixman_transform_from_pixman_f_transform
 }
 
 PIXMAN_EXPORT pixman_bool_t
 pixman_f_transform_invert (struct pixman_f_transform *      dst,
                            const struct pixman_f_transform *src)
 {
     double det;
     int i, j;
-    static const int a[3] = { 2, 2, 1 };
-    static const int b[3] = { 1, 0, 0 };
+    static int a[3] = { 2, 2, 1 };
+    static int b[3] = { 1, 0, 0 };
 
     det = 0;
     for (i = 0; i < 3; i++)
     {
 	double p;
 	int ai = a[i];
 	int bi = b[i];
 	p = src->m[i][0] * (src->m[ai][2] * src->m[bi][1] -
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-mips-dspr2-asm.S
+++ /dev/null
@@ -1,1521 +0,0 @@
-/*
- * Copyright (c) 2012
- *      MIPS Technologies, Inc., California.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
- *    contributors may be used to endorse or promote products derived from
- *    this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Author:  Nemanja Lukic (nlukic@mips.com)
- */
-
-#include "pixman-private.h"
-#include "pixman-mips-dspr2-asm.h"
-
-LEAF_MIPS_DSPR2(pixman_fill_buff16_mips)
-/*
- * a0 - *dest
- * a1 - count (bytes)
- * a2 - value to fill buffer with
- */
-
-    beqz     a1, 3f
-     andi    t1, a0, 0x0002
-    beqz     t1, 0f          /* check if address is 4-byte aligned */
-     nop
-    sh       a2, 0(a0)
-    addiu    a0, a0, 2
-    addiu    a1, a1, -2
-0:
-    srl      t1, a1, 5       /* t1 how many multiples of 32 bytes */
-    replv.ph a2, a2          /* replicate fill value (16bit) in a2 */
-    beqz     t1, 2f
-     nop
-1:
-    addiu    t1, t1, -1
-    beqz     t1, 11f
-     addiu   a1, a1, -32
-    pref     30, 32(a0)
-    sw       a2, 0(a0)
-    sw       a2, 4(a0)
-    sw       a2, 8(a0)
-    sw       a2, 12(a0)
-    sw       a2, 16(a0)
-    sw       a2, 20(a0)
-    sw       a2, 24(a0)
-    sw       a2, 28(a0)
-    b        1b
-     addiu   a0, a0, 32
-11:
-    sw       a2, 0(a0)
-    sw       a2, 4(a0)
-    sw       a2, 8(a0)
-    sw       a2, 12(a0)
-    sw       a2, 16(a0)
-    sw       a2, 20(a0)
-    sw       a2, 24(a0)
-    sw       a2, 28(a0)
-    addiu    a0, a0, 32
-2:
-    blez     a1, 3f
-     addiu   a1, a1, -2
-    sh       a2, 0(a0)
-    b        2b
-     addiu   a0, a0, 2
-3:
-    jr       ra
-     nop
-
-END(pixman_fill_buff16_mips)
-
-LEAF_MIPS32R2(pixman_fill_buff32_mips)
-/*
- * a0 - *dest
- * a1 - count (bytes)
- * a2 - value to fill buffer with
- */
-
-    beqz     a1, 3f
-     nop
-    srl      t1, a1, 5 /* t1 how many multiples of 32 bytes */
-    beqz     t1, 2f
-     nop
-1:
-    addiu    t1, t1, -1
-    beqz     t1, 11f
-     addiu   a1, a1, -32
-    pref     30, 32(a0)
-    sw       a2, 0(a0)
-    sw       a2, 4(a0)
-    sw       a2, 8(a0)
-    sw       a2, 12(a0)
-    sw       a2, 16(a0)
-    sw       a2, 20(a0)
-    sw       a2, 24(a0)
-    sw       a2, 28(a0)
-    b        1b
-     addiu   a0, a0, 32
-11:
-    sw       a2, 0(a0)
-    sw       a2, 4(a0)
-    sw       a2, 8(a0)
-    sw       a2, 12(a0)
-    sw       a2, 16(a0)
-    sw       a2, 20(a0)
-    sw       a2, 24(a0)
-    sw       a2, 28(a0)
-    addiu    a0, a0, 32
-2:
-    blez     a1, 3f
-     addiu   a1, a1, -4
-    sw       a2, 0(a0)
-    b        2b
-     addiu   a0, a0, 4
-3:
-    jr       ra
-     nop
-
-END(pixman_fill_buff32_mips)
-
-LEAF_MIPS_DSPR2(pixman_composite_src_8888_0565_asm_mips)
-/*
- * a0 - dst (r5g6b5)
- * a1 - src (a8r8g8b8)
- * a2 - w
- */
-
-    beqz     a2, 3f
-     nop
-    addiu    t1, a2, -1
-    beqz     t1, 2f
-     nop
-    li       t4, 0xf800f800
-    li       t5, 0x07e007e0
-    li       t6, 0x001f001f
-1:
-    lw       t0, 0(a1)
-    lw       t1, 4(a1)
-    addiu    a1, a1, 8
-    addiu    a2, a2, -2
-
-    CONVERT_2x8888_TO_2x0565 t0, t1, t2, t3, t4, t5, t6, t7, t8
-
-    sh       t2, 0(a0)
-    sh       t3, 2(a0)
-
-    addiu    t2, a2, -1
-    bgtz     t2, 1b
-     addiu   a0, a0, 4
-2:
-    beqz     a2, 3f
-     nop
-    lw       t0, 0(a1)
-
-    CONVERT_1x8888_TO_1x0565 t0, t1, t2, t3
-
-    sh       t1, 0(a0)
-3:
-    j        ra
-     nop
-
-END(pixman_composite_src_8888_0565_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_composite_src_0565_8888_asm_mips)
-/*
- * a0 - dst (a8r8g8b8)
- * a1 - src (r5g6b5)
- * a2 - w
- */
-
-    beqz     a2, 3f
-     nop
-    addiu    t1, a2, -1
-    beqz     t1, 2f
-     nop
-    li       t4, 0x07e007e0
-    li       t5, 0x001F001F
-1:
-    lhu      t0, 0(a1)
-    lhu      t1, 2(a1)
-    addiu    a1, a1, 4
-    addiu    a2, a2, -2
-
-    CONVERT_2x0565_TO_2x8888 t0, t1, t2, t3, t4, t5, t6, t7, t8, t9
-
-    sw       t2, 0(a0)
-    sw       t3, 4(a0)
-
-    addiu    t2, a2, -1
-    bgtz     t2, 1b
-     addiu   a0, a0, 8
-2:
-    beqz     a2, 3f
-     nop
-    lhu      t0, 0(a1)
-
-    CONVERT_1x0565_TO_1x8888 t0, t1, t2, t3
-
-    sw       t1, 0(a0)
-3:
-    j        ra
-     nop
-
-END(pixman_composite_src_0565_8888_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_composite_src_x888_8888_asm_mips)
-/*
- * a0 - dst (a8r8g8b8)
- * a1 - src (x8r8g8b8)
- * a2 - w
- */
-
-    beqz     a2, 4f
-     nop
-    li       t9, 0xff000000
-    srl      t8, a2, 3    /* t1 = how many multiples of 8 src pixels */
-    beqz     t8, 3f       /* branch if less than 8 src pixels */
-     nop
-1:
-    addiu    t8, t8, -1
-    beqz     t8, 2f
-     addiu   a2, a2, -8
-    pref     0, 32(a1)
-    lw       t0, 0(a1)
-    lw       t1, 4(a1)
-    lw       t2, 8(a1)
-    lw       t3, 12(a1)
-    lw       t4, 16(a1)
-    lw       t5, 20(a1)
-    lw       t6, 24(a1)
-    lw       t7, 28(a1)
-    addiu    a1, a1, 32
-    or       t0, t0, t9
-    or       t1, t1, t9
-    or       t2, t2, t9
-    or       t3, t3, t9
-    or       t4, t4, t9
-    or       t5, t5, t9
-    or       t6, t6, t9
-    or       t7, t7, t9
-    pref     30, 32(a0)
-    sw       t0, 0(a0)
-    sw       t1, 4(a0)
-    sw       t2, 8(a0)
-    sw       t3, 12(a0)
-    sw       t4, 16(a0)
-    sw       t5, 20(a0)
-    sw       t6, 24(a0)
-    sw       t7, 28(a0)
-    b        1b
-     addiu   a0, a0, 32
-2:
-    lw       t0, 0(a1)
-    lw       t1, 4(a1)
-    lw       t2, 8(a1)
-    lw       t3, 12(a1)
-    lw       t4, 16(a1)
-    lw       t5, 20(a1)
-    lw       t6, 24(a1)
-    lw       t7, 28(a1)
-    addiu    a1, a1, 32
-    or       t0, t0, t9
-    or       t1, t1, t9
-    or       t2, t2, t9
-    or       t3, t3, t9
-    or       t4, t4, t9
-    or       t5, t5, t9
-    or       t6, t6, t9
-    or       t7, t7, t9
-    sw       t0, 0(a0)
-    sw       t1, 4(a0)
-    sw       t2, 8(a0)
-    sw       t3, 12(a0)
-    sw       t4, 16(a0)
-    sw       t5, 20(a0)
-    sw       t6, 24(a0)
-    sw       t7, 28(a0)
-    beqz     a2, 4f
-     addiu   a0, a0, 32
-3:
-    lw       t0, 0(a1)
-    addiu    a1, a1, 4
-    addiu    a2, a2, -1
-    or       t1, t0, t9
-    sw       t1, 0(a0)
-    bnez     a2, 3b
-     addiu   a0, a0, 4
-4:
-    jr       ra
-     nop
-
-END(pixman_composite_src_x888_8888_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_composite_over_n_8888_8888_ca_asm_mips)
-/*
- * a0 - dst  (a8r8g8b8)
- * a1 - src  (32bit constant)
- * a2 - mask (a8r8g8b8)
- * a3 - w
- */
-
-    SAVE_REGS_ON_STACK 8, s0, s1, s2, s3, s4, s5
-    beqz         a3, 4f
-     nop
-    li           t6, 0xff
-    addiu        t7, zero, -1 /* t7 = 0xffffffff */
-    srl          t8, a1, 24   /* t8 = srca */
-    li           t9, 0x00ff00ff
-    addiu        t1, a3, -1
-    beqz         t1, 3f       /* last pixel */
-     nop
-    beq          t8, t6, 2f   /* if (srca == 0xff) */
-     nop
-1:
-                              /* a1 = src */
-    lw           t0, 0(a2)    /* t0 = mask */
-    lw           t1, 4(a2)    /* t1 = mask */
-    or           t2, t0, t1
-    beqz         t2, 12f      /* if (t0 == 0) && (t1 == 0) */
-     addiu       a2, a2, 8
-    and          t3, t0, t1
-    move         t4, a1       /* t4 = src */
-    move         t5, a1       /* t5 = src */
-    lw           t2, 0(a0)    /* t2 = dst */
-    beq          t3, t7, 11f  /* if (t0 == 0xffffffff) && (t1 == 0xffffffff) */
-     lw          t3, 4(a0)    /* t3 = dst */
-    MIPS_2xUN8x4_MUL_2xUN8x4 a1, a1, t0, t1, t4, t5, t9, s0, s1, s2, s3, s4, s5
-    MIPS_2xUN8x4_MUL_2xUN8   t0, t1, t8, t8, t0, t1, t9, s0, s1, s2, s3, s4, s5
-11:
-    not          t0, t0
-    not          t1, t1
-    MIPS_2xUN8x4_MUL_2xUN8x4 t2, t3, t0, t1, t2, t3, t9, s0, s1, s2, s3, s4, s5
-    addu_s.qb    t2, t4, t2
-    addu_s.qb    t3, t5, t3
-    sw           t2, 0(a0)
-    sw           t3, 4(a0)
-12:
-    addiu        a3, a3, -2
-    addiu        t1, a3, -1
-    bgtz         t1, 1b
-     addiu       a0, a0, 8
-    b            3f
-     nop
-2:
-                              /* a1 = src */
-    lw           t0, 0(a2)    /* t0 = mask */
-    lw           t1, 4(a2)    /* t1 = mask */
-    or           t2, t0, t1
-    beqz         t2, 22f      /* if (t0 == 0) & (t1 == 0) */
-     addiu       a2, a2, 8
-    and          t2, t0, t1
-    move         t4, a1
-    beq          t2, t7, 21f  /* if (t0 == 0xffffffff) && (t1 == 0xffffffff) */
-     move        t5, a1
-    lw           t2, 0(a0)    /* t2 = dst */
-    lw           t3, 4(a0)    /* t3 = dst */
-    MIPS_2xUN8x4_MUL_2xUN8x4 a1, a1, t0, t1, t4, t5, t9, s0, s1, s2, s3, s4, s5
-    not          t0, t0
-    not          t1, t1
-    MIPS_2xUN8x4_MUL_2xUN8x4 t2, t3, t0, t1, t2, t3, t9, s0, s1, s2, s3, s4, s5
-    addu_s.qb    t4, t4, t2
-    addu_s.qb    t5, t5, t3
-21:
-    sw           t4, 0(a0)
-    sw           t5, 4(a0)
-22:
-    addiu        a3, a3, -2
-    addiu        t1, a3, -1
-    bgtz         t1, 2b
-     addiu       a0, a0, 8
-3:
-    blez         a3, 4f
-     nop
-                              /* a1 = src */
-    lw           t1, 0(a2)    /* t1 = mask */
-    beqz         t1, 4f
-     nop
-    move         t2, a1       /* t2 = src */
-    beq          t1, t7, 31f
-     lw          t0, 0(a0)    /* t0 = dst */
-
-    MIPS_UN8x4_MUL_UN8x4  a1, t1, t2, t9, t3, t4, t5, t6
-    MIPS_UN8x4_MUL_UN8    t1, t8, t1, t9, t3, t4, t5
-31:
-    not          t1, t1
-    MIPS_UN8x4_MUL_UN8x4  t0, t1, t0, t9, t3, t4, t5, t6
-    addu_s.qb    t0, t2, t0
-    sw           t0, 0(a0)
-4:
-    RESTORE_REGS_FROM_STACK 8, s0, s1, s2, s3, s4, s5
-    j            ra
-     nop
-
-END(pixman_composite_over_n_8888_8888_ca_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_composite_over_n_8888_0565_ca_asm_mips)
-/*
- * a0 - dst  (r5g6b5)
- * a1 - src  (32bit constant)
- * a2 - mask (a8r8g8b8)
- * a3 - w
- */
-
-    SAVE_REGS_ON_STACK 20, s0, s1, s2, s3, s4, s5, s6, s7, s8
-    beqz         a3, 4f
-     nop
-    li           t5, 0xf800f800
-    li           t6, 0x07e007e0
-    li           t7, 0x001F001F
-    li           t9, 0x00ff00ff
-
-    srl          t8, a1, 24   /* t8 = srca */
-    addiu        t1, a3, -1
-    beqz         t1, 3f       /* last pixel */
-     nop
-    li           s0, 0xff     /* s0 = 0xff */
-    addiu        s1, zero, -1 /* s1 = 0xffffffff */
-
-    beq          t8, s0, 2f   /* if (srca == 0xff) */
-     nop
-1:
-                              /* a1 = src */
-    lw           t0, 0(a2)    /* t0 = mask */
-    lw           t1, 4(a2)    /* t1 = mask */
-    or           t2, t0, t1
-    beqz         t2, 12f      /* if (t0 == 0) && (t1 == 0) */
-     addiu       a2, a2, 8
-    and          t3, t0, t1
-    move         s2, a1       /* s2 = src */
-    move         s3, a1       /* s3 = src */
-    lhu          t2, 0(a0)    /* t2 = dst */
-    beq          t3, s1, 11f  /* if (t0 == 0xffffffff) && (t1 == 0xffffffff) */
-     lhu         t3, 2(a0)    /* t3 = dst */
-    MIPS_2xUN8x4_MUL_2xUN8x4 a1, a1, t0, t1, s2, s3, t9, t4, s4, s5, s6, s7, s8
-    MIPS_2xUN8x4_MUL_2xUN8   t0, t1, t8, t8, t0, t1, t9, t4, s4, s5, s6, s7, s8
-11:
-    not          t0, t0
-    not          t1, t1
-    CONVERT_2x0565_TO_2x8888 t2, t3, s4, s5, t6, t7, t4, s6, s7, s8
-    MIPS_2xUN8x4_MUL_2xUN8x4 s4, s5, t0, t1, s4, s5, t9, t4, s6, s7, s8, t0, t1
-    addu_s.qb    s2, s2, s4
-    addu_s.qb    s3, s3, s5
-    CONVERT_2x8888_TO_2x0565 s2, s3, t2, t3, t5, t6, t7, s4, s5
-    sh           t2, 0(a0)
-    sh           t3, 2(a0)
-12:
-    addiu        a3, a3, -2
-    addiu        t1, a3, -1
-    bgtz         t1, 1b
-     addiu       a0, a0, 4
-    b            3f
-     nop
-2:
-                              /* a1 = src */
-    lw           t0, 0(a2)    /* t0 = mask */
-    lw           t1, 4(a2)    /* t1 = mask */
-    or           t2, t0, t1
-    beqz         t2, 22f      /* if (t0 == 0) & (t1 == 0) */
-     addiu       a2, a2, 8
-    and          t3, t0, t1
-    move         t2, a1
-    beq          t3, s1, 21f  /* if (t0 == 0xffffffff) && (t1 == 0xffffffff) */
-     move        t3, a1
-    lhu          t2, 0(a0)    /* t2 = dst */
-    lhu          t3, 2(a0)    /* t3 = dst */
-    MIPS_2xUN8x4_MUL_2xUN8x4 a1, a1, t0, t1, s2, s3, t9, t4, s4, s5, s6, s7, s8
-    not          t0, t0
-    not          t1, t1
-    CONVERT_2x0565_TO_2x8888 t2, t3, s4, s5, t6, t7, t4, s6, s7, s8
-    MIPS_2xUN8x4_MUL_2xUN8x4 s4, s5, t0, t1, s4, s5, t9, t4, s6, s7, s8, t2, t3
-    addu_s.qb    t2, s2, s4
-    addu_s.qb    t3, s3, s5
-21:
-    CONVERT_2x8888_TO_2x0565 t2, t3, t0, t1, t5, t6, t7, s2, s3
-    sh           t0, 0(a0)
-    sh           t1, 2(a0)
-22:
-    addiu        a3, a3, -2
-    addiu        t1, a3, -1
-    bgtz         t1, 2b
-     addiu       a0, a0, 4
-3:
-    blez         a3, 4f
-     nop
-                              /* a1 = src */
-    lw           t1, 0(a2)    /* t1 = mask */
-    beqz         t1, 4f
-     nop
-    move         t2, a1       /* t2 = src */
-    beq          t1, t7, 31f
-     lhu         t0, 0(a0)    /* t0 = dst */
-
-    MIPS_UN8x4_MUL_UN8x4     a1, t1, t2, t9, t3, t4, t5, t6
-    MIPS_UN8x4_MUL_UN8       t1, t8, t1, t9, t3, t4, t5
-31:
-    not          t1, t1
-    CONVERT_1x0565_TO_1x8888 t0, s1, s2, s3
-    MIPS_UN8x4_MUL_UN8x4     s1, t1, t3, t9, t4, t5, t6, t7
-    addu_s.qb    t0, t2, t3
-    CONVERT_1x8888_TO_1x0565 t0, s1, s2, s3
-    sh           s1, 0(a0)
-4:
-    RESTORE_REGS_FROM_STACK  20, s0, s1, s2, s3, s4, s5, s6, s7, s8
-    j            ra
-     nop
-
-END(pixman_composite_over_n_8888_0565_ca_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_composite_over_n_8_8888_asm_mips)
-/*
- * a0 - dst  (a8r8g8b8)
- * a1 - src  (32bit constant)
- * a2 - mask (a8)
- * a3 - w
- */
-
-    SAVE_REGS_ON_STACK 4, s0, s1, s2, s3, s4
-    beqz      a3, 4f
-     nop
-    li        t4, 0x00ff00ff
-    li        t5, 0xff
-    addiu     t0, a3, -1
-    beqz      t0, 3f         /* last pixel */
-     srl      t6, a1, 24     /* t6 = srca */
-    not       s4, a1
-    beq       t5, t6, 2f     /* if (srca == 0xff) */
-     srl      s4, s4, 24
-1:
-                             /* a1 = src */
-    lbu       t0, 0(a2)      /* t0 = mask */
-    lbu       t1, 1(a2)      /* t1 = mask */
-    or        t2, t0, t1
-    beqz      t2, 111f       /* if (t0 == 0) && (t1 == 0) */
-     addiu    a2, a2, 2
-    and       t3, t0, t1
-
-    lw        t2, 0(a0)      /* t2 = dst */
-    beq       t3, t5, 11f    /* if (t0 == 0xff) && (t1 == 0xff) */
-     lw       t3, 4(a0)      /* t3 = dst */
-
-    MIPS_2xUN8x4_MUL_2xUN8 a1, a1, t0, t1, s0, s1, t4, t6, t7, t8, t9, s2, s3
-    not       s2, s0
-    not       s3, s1
-    srl       s2, s2, 24
-    srl       s3, s3, 24
-    MIPS_2xUN8x4_MUL_2xUN8 t2, t3, s2, s3, t2, t3, t4, t0, t1, t6, t7, t8, t9
-    addu_s.qb s2, t2, s0
-    addu_s.qb s3, t3, s1
-    sw        s2, 0(a0)
-    b         111f
-     sw       s3, 4(a0)
-11:
-    MIPS_2xUN8x4_MUL_2xUN8 t2, t3, s4, s4, t2, t3, t4, t0, t1, t6, t7, t8, t9
-    addu_s.qb s2, t2, a1
-    addu_s.qb s3, t3, a1
-    sw        s2, 0(a0)
-    sw        s3, 4(a0)
-
-111:
-    addiu     a3, a3, -2
-    addiu     t0, a3, -1
-    bgtz      t0, 1b
-     addiu    a0, a0, 8
-    b         3f
-     nop
-2:
-                             /* a1 = src */
-    lbu       t0, 0(a2)      /* t0 = mask */
-    lbu       t1, 1(a2)      /* t1 = mask */
-    or        t2, t0, t1
-    beqz      t2, 222f       /* if (t0 == 0) && (t1 == 0) */
-     addiu    a2, a2, 2
-    and       t3, t0, t1
-    beq       t3, t5, 22f    /* if (t0 == 0xff) && (t1 == 0xff) */
-     nop
-    lw        t2, 0(a0)      /* t2 = dst */
-    lw        t3, 4(a0)      /* t3 = dst */
-
-    OVER_2x8888_2x8_2x8888 a1, a1, t0, t1, t2, t3, \
-                           t6, t7, t4, t8, t9, s0, s1, s2, s3
-    sw        t6, 0(a0)
-    b         222f
-     sw        t7, 4(a0)
-22:
-    sw        a1, 0(a0)
-    sw        a1, 4(a0)
-222:
-    addiu     a3, a3, -2
-    addiu     t0, a3, -1
-    bgtz      t0, 2b
-     addiu    a0, a0, 8
-3:
-    blez      a3, 4f
-     nop
-                             /* a1 = src */
-    lbu       t0, 0(a2)      /* t0 = mask */
-    beqz      t0, 4f         /* if (t0 == 0) */
-     addiu    a2, a2, 1
-    move      t3, a1
-    beq       t0, t5, 31f    /* if (t0 == 0xff) */
-     lw       t1, 0(a0)      /* t1 = dst */
-
-    MIPS_UN8x4_MUL_UN8 a1, t0, t3, t4, t6, t7, t8
-31:
-    not       t2, t3
-    srl       t2, t2, 24
-    MIPS_UN8x4_MUL_UN8 t1, t2, t1, t4, t6, t7, t8
-    addu_s.qb t2, t1, t3
-    sw        t2, 0(a0)
-4:
-    RESTORE_REGS_FROM_STACK 4, s0, s1, s2, s3, s4
-    j         ra
-     nop
-
-END(pixman_composite_over_n_8_8888_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_composite_over_n_8_0565_asm_mips)
-/*
- * a0 - dst  (r5g6b5)
- * a1 - src  (32bit constant)
- * a2 - mask (a8)
- * a3 - w
- */
-    SAVE_REGS_ON_STACK 24, v0, s0, s1, s2, s3, s4, s5, s6, s7, s8
-    beqz     a3, 4f
-     nop
-    li       t4, 0x00ff00ff
-    li       t5, 0xff
-    li       t6, 0xf800f800
-    li       t7, 0x07e007e0
-    li       t8, 0x001F001F
-    addiu    t1, a3, -1
-    beqz     t1, 3f         /* last pixel */
-     srl     t0, a1, 24     /* t0 = srca */
-    not      v0, a1
-    beq      t0, t5, 2f     /* if (srca == 0xff) */
-     srl     v0, v0, 24
-1:
-                            /* a1 = src */
-    lbu      t0, 0(a2)      /* t0 = mask */
-    lbu      t1, 1(a2)      /* t1 = mask */
-    or       t2, t0, t1
-    beqz     t2, 111f       /* if (t0 == 0) && (t1 == 0) */
-     addiu   a2, a2, 2
-    lhu      t2, 0(a0)      /* t2 = dst */
-    lhu      t3, 2(a0)      /* t3 = dst */
-    CONVERT_2x0565_TO_2x8888 t2, t3, s0, s1, t7, t8, t9, s2, s3, s4
-    and      t9, t0, t1
-    beq      t9, t5, 11f    /* if (t0 == 0xff) && (t1 == 0xff) */
-     nop
-
-    MIPS_2xUN8x4_MUL_2xUN8   a1, a1, t0, t1, s2, s3, t4, t9, s4, s5, s6, s7, s8
-    not      s4, s2
-    not      s5, s3
-    srl      s4, s4, 24
-    srl      s5, s5, 24
-    MIPS_2xUN8x4_MUL_2xUN8   s0, s1, s4, s5, s0, s1, t4, t9, t0, t1, s6, s7, s8
-    addu_s.qb                s4, s2, s0
-    addu_s.qb                s5, s3, s1
-    CONVERT_2x8888_TO_2x0565 s4, s5, t2, t3, t6, t7, t8, s0, s1
-    sh       t2, 0(a0)
-    b        111f
-     sh      t3, 2(a0)
-11:
-    MIPS_2xUN8x4_MUL_2xUN8   s0, s1, v0, v0, s0, s1, t4, t9, t0, t1, s6, s7, s8
-    addu_s.qb                s4, a1, s0
-    addu_s.qb                s5, a1, s1
-    CONVERT_2x8888_TO_2x0565 s4, s5, t2, t3, t6, t7, t8, s0, s1
-    sh       t2, 0(a0)
-    sh       t3, 2(a0)
-111:
-    addiu    a3, a3, -2
-    addiu    t0, a3, -1
-    bgtz     t0, 1b
-     addiu   a0, a0, 4
-    b        3f
-     nop
-2:
-    CONVERT_1x8888_TO_1x0565 a1, s0, s1, s2
-21:
-                            /* a1 = src */
-    lbu      t0, 0(a2)      /* t0 = mask */
-    lbu      t1, 1(a2)      /* t1 = mask */
-    or       t2, t0, t1
-    beqz     t2, 222f       /* if (t0 == 0) && (t1 == 0) */
-     addiu   a2, a2, 2
-    and      t9, t0, t1
-    move     s2, s0
-    beq      t9, t5, 22f    /* if (t0 == 0xff) && (t2 == 0xff) */
-     move    s3, s0
-    lhu      t2, 0(a0)      /* t2 = dst */
-    lhu      t3, 2(a0)      /* t3 = dst */
-
-    CONVERT_2x0565_TO_2x8888 t2, t3, s2, s3, t7, t8, s4, s5, s6, s7
-    OVER_2x8888_2x8_2x8888   a1, a1, t0, t1, s2, s3, \
-                             t2, t3, t4, t9, s4, s5, s6, s7, s8
-    CONVERT_2x8888_TO_2x0565 t2, t3, s2, s3, t6, t7, t8, s4, s5
-22:
-    sh       s2, 0(a0)
-    sh       s3, 2(a0)
-222:
-    addiu    a3, a3, -2
-    addiu    t0, a3, -1
-    bgtz     t0, 21b
-     addiu   a0, a0, 4
-3:
-    blez      a3, 4f
-     nop
-                            /* a1 = src */
-    lbu      t0, 0(a2)      /* t0 = mask */
-    beqz     t0, 4f         /* if (t0 == 0) */
-     nop
-    lhu      t1, 0(a0)      /* t1 = dst */
-    CONVERT_1x0565_TO_1x8888 t1, t2, t3, t7
-    beq      t0, t5, 31f    /* if (t0 == 0xff) */
-     move    t3, a1
-
-    MIPS_UN8x4_MUL_UN8       a1, t0, t3, t4, t7, t8, t9
-31:
-    not      t6, t3
-    srl      t6, t6, 24
-    MIPS_UN8x4_MUL_UN8       t2, t6, t2, t4, t7, t8, t9
-    addu_s.qb                t1, t2, t3
-    CONVERT_1x8888_TO_1x0565 t1, t2, t3, t7
-    sh       t2, 0(a0)
-4:
-    RESTORE_REGS_FROM_STACK  24, v0, s0, s1, s2, s3, s4, s5, s6, s7, s8
-    j        ra
-     nop
-
-END(pixman_composite_over_n_8_0565_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_8888_8888_SRC_asm_mips)
-/*
- * a0     - *dst
- * a1     - *src_top
- * a2     - *src_bottom
- * a3     - w
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- */
-
-    beqz     a3, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 20, v0, s0, s1, s2, s3, s4, s5, s6, s7
-
-    lw       s0, 36(sp)     /* s0 = wt */
-    lw       s1, 40(sp)     /* s1 = wb */
-    lw       s2, 44(sp)     /* s2 = vx */
-    lw       s3, 48(sp)     /* s3 = unit_x */
-    li       v0, BILINEAR_INTERPOLATION_RANGE
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu     t5, v0, t4     /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5     /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4     /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5     /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4     /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 2
-    addiu    t8, t9, 4
-    lwx      t0, t9(a1)     /* t0 = tl */
-    lwx      t1, t8(a1)     /* t1 = tr */
-    addiu    a3, a3, -1
-    lwx      t2, t9(a2)     /* t2 = bl */
-    lwx      t3, t8(a2)     /* t3 = br */
-
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-
-    addu     s2, s2, s3     /* vx += unit_x; */
-    sw       t0, 0(a0)
-    bnez     a3, 0b
-     addiu   a0, a0, 4
-
-    RESTORE_REGS_FROM_STACK 20, v0, s0, s1, s2, s3, s4, s5, s6, s7
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_8888_8888_SRC_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_8888_0565_SRC_asm_mips)
-/*
- * a0     - *dst
- * a1     - *src_top
- * a2     - *src_bottom
- * a3     - w
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- */
-
-    beqz     a3, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 20, v0, s0, s1, s2, s3, s4, s5, s6, s7
-
-    lw       s0, 36(sp)     /* s0 = wt */
-    lw       s1, 40(sp)     /* s1 = wb */
-    lw       s2, 44(sp)     /* s2 = vx */
-    lw       s3, 48(sp)     /* s3 = unit_x */
-    li       v0, BILINEAR_INTERPOLATION_RANGE
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu     t5, v0, t4     /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5     /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4     /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5     /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4     /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 2
-    addiu    t8, t9, 4
-    lwx      t0, t9(a1)     /* t0 = tl */
-    lwx      t1, t8(a1)     /* t1 = tr */
-    addiu    a3, a3, -1
-    lwx      t2, t9(a2)     /* t2 = bl */
-    lwx      t3, t8(a2)     /* t3 = br */
-
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    CONVERT_1x8888_TO_1x0565 t0, t1, t2, t3
-
-    addu     s2, s2, s3     /* vx += unit_x; */
-    sh       t1, 0(a0)
-    bnez     a3, 0b
-     addiu   a0, a0, 2
-
-    RESTORE_REGS_FROM_STACK 20, v0, s0, s1, s2, s3, s4, s5, s6, s7
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_8888_0565_SRC_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_0565_8888_SRC_asm_mips)
-/*
- * a0     - *dst
- * a1     - *src_top
- * a2     - *src_bottom
- * a3     - w
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- */
-
-    beqz     a3, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-
-    lw       s0, 44(sp)     /* s0 = wt */
-    lw       s1, 48(sp)     /* s1 = wb */
-    lw       s2, 52(sp)     /* s2 = vx */
-    lw       s3, 56(sp)     /* s3 = unit_x */
-    li       v0, BILINEAR_INTERPOLATION_RANGE
-    li       v1, 0x07e007e0
-    li       s8, 0x001f001f
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu     t5, v0, t4     /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5     /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4     /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5     /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4     /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 1
-    addiu    t8, t9, 2
-    lhx      t0, t9(a1)     /* t0 = tl */
-    lhx      t1, t8(a1)     /* t1 = tr */
-    andi     t1, t1, 0xffff
-    addiu    a3, a3, -1
-    lhx      t2, t9(a2)     /* t2 = bl */
-    lhx      t3, t8(a2)     /* t3 = br */
-    andi     t3, t3, 0xffff
-
-    CONVERT_2x0565_TO_2x8888 t0, t1, t0, t1, v1, s8, t4, t5, t6, t7
-    CONVERT_2x0565_TO_2x8888 t2, t3, t2, t3, v1, s8, t4, t5, t6, t7
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-
-    addu     s2, s2, s3     /* vx += unit_x; */
-    sw       t0, 0(a0)
-    bnez     a3, 0b
-     addiu   a0, a0, 4
-
-    RESTORE_REGS_FROM_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_0565_8888_SRC_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_0565_0565_SRC_asm_mips)
-/*
- * a0     - *dst
- * a1     - *src_top
- * a2     - *src_bottom
- * a3     - w
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- */
-
-    beqz     a3, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-
-    lw       s0, 44(sp)     /* s0 = wt */
-    lw       s1, 48(sp)     /* s1 = wb */
-    lw       s2, 52(sp)     /* s2 = vx */
-    lw       s3, 56(sp)     /* s3 = unit_x */
-    li       v0, BILINEAR_INTERPOLATION_RANGE
-    li       v1, 0x07e007e0
-    li       s8, 0x001f001f
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu     t5, v0, t4     /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5     /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4     /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5     /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4     /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 1
-    addiu    t8, t9, 2
-    lhx      t0, t9(a1)     /* t0 = tl */
-    lhx      t1, t8(a1)     /* t1 = tr */
-    andi     t1, t1, 0xffff
-    addiu    a3, a3, -1
-    lhx      t2, t9(a2)     /* t2 = bl */
-    lhx      t3, t8(a2)     /* t3 = br */
-    andi     t3, t3, 0xffff
-
-    CONVERT_2x0565_TO_2x8888 t0, t1, t0, t1, v1, s8, t4, t5, t6, t7
-    CONVERT_2x0565_TO_2x8888 t2, t3, t2, t3, v1, s8, t4, t5, t6, t7
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    CONVERT_1x8888_TO_1x0565 t0, t1, t2, t3
-
-    addu     s2, s2, s3     /* vx += unit_x; */
-    sh       t1, 0(a0)
-    bnez     a3, 0b
-     addiu   a0, a0, 2
-
-    RESTORE_REGS_FROM_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_0565_0565_SRC_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_8888_8888_OVER_asm_mips)
-/*
- * a0     - *dst
- * a1     - *src_top
- * a2     - *src_bottom
- * a3     - w
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- */
-
-    beqz     a3, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 24, v0, s0, s1, s2, s3, s4, s5, s6, s7, s8
-
-    lw       s0, 40(sp)     /* s0 = wt */
-    lw       s1, 44(sp)     /* s1 = wb */
-    lw       s2, 48(sp)     /* s2 = vx */
-    lw       s3, 52(sp)     /* s3 = unit_x */
-    li       v0, BILINEAR_INTERPOLATION_RANGE
-    li       s8, 0x00ff00ff
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu     t5, v0, t4     /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5     /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4     /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5     /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4     /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 2
-    addiu    t8, t9, 4
-    lwx      t0, t9(a1)     /* t0 = tl */
-    lwx      t1, t8(a1)     /* t1 = tr */
-    addiu    a3, a3, -1
-    lwx      t2, t9(a2)     /* t2 = bl */
-    lwx      t3, t8(a2)     /* t3 = br */
-
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    lw       t1, 0(a0)      /* t1 = dest */
-    OVER_8888_8888 t0, t1, t2, s8, t3, t4, t5, t6
-
-    addu     s2, s2, s3     /* vx += unit_x; */
-    sw       t2, 0(a0)
-    bnez     a3, 0b
-     addiu   a0, a0, 4
-
-    RESTORE_REGS_FROM_STACK 24, v0, s0, s1, s2, s3, s4, s5, s6, s7, s8
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_8888_8888_OVER_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_8888_8888_ADD_asm_mips)
-/*
- * a0     - *dst
- * a1     - *src_top
- * a2     - *src_bottom
- * a3     - w
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- */
-
-    beqz         a3, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 20, v0, s0, s1, s2, s3, s4, s5, s6, s7
-
-    lw           s0, 36(sp)     /* s0 = wt */
-    lw           s1, 40(sp)     /* s1 = wb */
-    lw           s2, 44(sp)     /* s2 = vx */
-    lw           s3, 48(sp)     /* s3 = unit_x */
-    li           v0, BILINEAR_INTERPOLATION_RANGE
-
-    sll          s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll          s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi         t4, s2, 0xffff /* t4 = (short)vx */
-    srl          t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu         t5, v0, t4     /* t5 = ( 256 - (vx>>8)) */
-
-    mul          s4, s0, t5     /* s4 = wt*(256-(vx>>8)) */
-    mul          s5, s0, t4     /* s5 = wt*(vx>>8) */
-    mul          s6, s1, t5     /* s6 = wb*(256-(vx>>8)) */
-    mul          s7, s1, t4     /* s7 = wb*(vx>>8) */
-
-    sra          t9, s2, 16
-    sll          t9, t9, 2
-    addiu        t8, t9, 4
-    lwx          t0, t9(a1)     /* t0 = tl */
-    lwx          t1, t8(a1)     /* t1 = tr */
-    addiu        a3, a3, -1
-    lwx          t2, t9(a2)     /* t2 = bl */
-    lwx          t3, t8(a2)     /* t3 = br */
-
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    lw           t1, 0(a0)
-    addu_s.qb    t2, t0, t1
-
-    addu         s2, s2, s3     /* vx += unit_x; */
-    sw           t2, 0(a0)
-    bnez         a3, 0b
-     addiu       a0, a0, 4
-
-    RESTORE_REGS_FROM_STACK 20, v0, s0, s1, s2, s3, s4, s5, s6, s7
-1:
-    j            ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_8888_8888_ADD_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_8888_8_8888_SRC_asm_mips)
-/*
- * a0     - *dst
- * a1     - *mask
- * a2     - *src_top
- * a3     - *src_bottom
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- * 32(sp) - w
- */
-
-    lw       v1, 32(sp)
-    beqz     v1, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-
-    lw       s0, 44(sp)        /* s0 = wt */
-    lw       s1, 48(sp)        /* s1 = wb */
-    lw       s2, 52(sp)        /* s2 = vx */
-    lw       s3, 56(sp)        /* s3 = unit_x */
-    li       v0, BILINEAR_INTERPOLATION_RANGE
-    li       s8, 0x00ff00ff
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff    /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu     t5, v0, t4        /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5        /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4        /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5        /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4        /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 2
-    addiu    t8, t9, 4
-    lwx      t0, t9(a2)        /* t0 = tl */
-    lwx      t1, t8(a2)        /* t1 = tr */
-    addiu    v1, v1, -1
-    lwx      t2, t9(a3)        /* t2 = bl */
-    lwx      t3, t8(a3)        /* t3 = br */
-
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    lbu      t1, 0(a1)         /* t1 = mask */
-    addiu    a1, a1, 1
-    MIPS_UN8x4_MUL_UN8 t0, t1, t0, s8, t2, t3, t4
-
-    addu     s2, s2, s3        /* vx += unit_x; */
-    sw       t0, 0(a0)
-    bnez     v1, 0b
-     addiu   a0, a0, 4
-
-    RESTORE_REGS_FROM_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_8888_8_8888_SRC_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_8888_8_0565_SRC_asm_mips)
-/*
- * a0     - *dst
- * a1     - *mask
- * a2     - *src_top
- * a3     - *src_bottom
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- * 32(sp) - w
- */
-
-    lw       v1, 32(sp)
-    beqz     v1, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-
-    lw       s0, 44(sp)        /* s0 = wt */
-    lw       s1, 48(sp)        /* s1 = wb */
-    lw       s2, 52(sp)        /* s2 = vx */
-    lw       s3, 56(sp)        /* s3 = unit_x */
-    li       v0, BILINEAR_INTERPOLATION_RANGE
-    li       s8, 0x00ff00ff
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff    /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu     t5, v0, t4        /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5        /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4        /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5        /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4        /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 2
-    addiu    t8, t9, 4
-    lwx      t0, t9(a2)        /* t0 = tl */
-    lwx      t1, t8(a2)        /* t1 = tr */
-    addiu    v1, v1, -1
-    lwx      t2, t9(a3)        /* t2 = bl */
-    lwx      t3, t8(a3)        /* t3 = br */
-
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    lbu      t1, 0(a1)         /* t1 = mask */
-    addiu    a1, a1, 1
-    MIPS_UN8x4_MUL_UN8 t0, t1, t0, s8, t2, t3, t4
-    CONVERT_1x8888_TO_1x0565 t0, t1, t2, t3
-
-    addu     s2, s2, s3        /* vx += unit_x; */
-    sh       t1, 0(a0)
-    bnez     v1, 0b
-     addiu   a0, a0, 2
-
-    RESTORE_REGS_FROM_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_8888_8_0565_SRC_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_0565_8_x888_SRC_asm_mips)
-/*
- * a0     - *dst
- * a1     - *mask
- * a2     - *src_top
- * a3     - *src_bottom
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- * 32(sp) - w
- */
-
-    lw       t0, 32(sp)
-    beqz     t0, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 32, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8, ra
-
-    lw       s0, 48(sp)        /* s0 = wt */
-    lw       s1, 52(sp)        /* s1 = wb */
-    lw       s2, 56(sp)        /* s2 = vx */
-    lw       s3, 60(sp)        /* s3 = unit_x */
-    lw       ra, 64(sp)        /* ra = w */
-    li       v0, 0x00ff00ff
-    li       v1, 0x07e007e0
-    li       s8, 0x001f001f
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff    /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    li       t5, BILINEAR_INTERPOLATION_RANGE
-    subu     t5, t5, t4        /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5        /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4        /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5        /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4        /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 1
-    addiu    t8, t9, 2
-    lhx      t0, t9(a2)        /* t0 = tl */
-    lhx      t1, t8(a2)        /* t1 = tr */
-    andi     t1, t1, 0xffff
-    addiu    ra, ra, -1
-    lhx      t2, t9(a3)        /* t2 = bl */
-    lhx      t3, t8(a3)        /* t3 = br */
-    andi     t3, t3, 0xffff
-
-    CONVERT_2x0565_TO_2x8888 t0, t1, t0, t1, v1, s8, t4, t5, t6, t7
-    CONVERT_2x0565_TO_2x8888 t2, t3, t2, t3, v1, s8, t4, t5, t6, t7
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    lbu      t1, 0(a1)         /* t1 = mask */
-    addiu    a1, a1, 1
-    MIPS_UN8x4_MUL_UN8 t0, t1, t0, v0, t2, t3, t4
-
-    addu     s2, s2, s3        /* vx += unit_x; */
-    sw       t0, 0(a0)
-    bnez     ra, 0b
-     addiu   a0, a0, 4
-
-    RESTORE_REGS_FROM_STACK 32, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8, ra
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_0565_8_x888_SRC_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_0565_8_0565_SRC_asm_mips)
-/*
- * a0     - *dst
- * a1     - *mask
- * a2     - *src_top
- * a3     - *src_bottom
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- * 32(sp) - w
- */
-
-    lw       t0, 32(sp)
-    beqz     t0, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 32, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8, ra
-
-    lw       s0, 48(sp)        /* s0 = wt */
-    lw       s1, 52(sp)        /* s1 = wb */
-    lw       s2, 56(sp)        /* s2 = vx */
-    lw       s3, 60(sp)        /* s3 = unit_x */
-    lw       ra, 64(sp)        /* ra = w */
-    li       v0, 0x00ff00ff
-    li       v1, 0x07e007e0
-    li       s8, 0x001f001f
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff    /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    li       t5, BILINEAR_INTERPOLATION_RANGE
-    subu     t5, t5, t4        /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5        /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4        /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5        /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4        /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 1
-    addiu    t8, t9, 2
-    lhx      t0, t9(a2)        /* t0 = tl */
-    lhx      t1, t8(a2)        /* t1 = tr */
-    andi     t1, t1, 0xffff
-    addiu    ra, ra, -1
-    lhx      t2, t9(a3)        /* t2 = bl */
-    lhx      t3, t8(a3)        /* t3 = br */
-    andi     t3, t3, 0xffff
-
-    CONVERT_2x0565_TO_2x8888 t0, t1, t0, t1, v1, s8, t4, t5, t6, t7
-    CONVERT_2x0565_TO_2x8888 t2, t3, t2, t3, v1, s8, t4, t5, t6, t7
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    lbu      t1, 0(a1)         /* t1 = mask */
-    addiu    a1, a1, 1
-    MIPS_UN8x4_MUL_UN8 t0, t1, t0, v0, t2, t3, t4
-    CONVERT_1x8888_TO_1x0565 t0, t1, t2, t3
-
-    addu     s2, s2, s3        /* vx += unit_x; */
-    sh       t1, 0(a0)
-    bnez     ra, 0b
-     addiu   a0, a0, 2
-
-    RESTORE_REGS_FROM_STACK 32, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8, ra
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_0565_8_0565_SRC_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_8888_8_8888_OVER_asm_mips)
-/*
- * a0     - dst        (a8r8g8b8)
- * a1     - mask       (a8)
- * a2     - src_top    (a8r8g8b8)
- * a3     - src_bottom (a8r8g8b8)
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- * 32(sp) - w
- */
-
-    SAVE_REGS_ON_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-
-    lw       v1, 60(sp)        /* v1 = w(sp + 32 + 28 save regs stack offset)*/
-    beqz     v1, 1f
-     nop
-
-    lw       s0, 44(sp)        /* s0 = wt */
-    lw       s1, 48(sp)        /* s1 = wb */
-    lw       s2, 52(sp)        /* s2 = vx */
-    lw       s3, 56(sp)        /* s3 = unit_x */
-    li       v0, BILINEAR_INTERPOLATION_RANGE
-    li       s8, 0x00ff00ff
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-
-0:
-    andi     t4, s2, 0xffff    /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu     t5, v0, t4        /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5        /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4        /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5        /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4        /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 2
-    addiu    t8, t9, 4
-    lwx      t0, t9(a2)        /* t0 = tl */
-    lwx      t1, t8(a2)        /* t1 = tr */
-    addiu    v1, v1, -1
-    lwx      t2, t9(a3)        /* t2 = bl */
-    lwx      t3, t8(a3)        /* t3 = br */
-
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, \
-                                      t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    lbu      t1, 0(a1)         /* t1 = mask */
-    lw       t2, 0(a0)         /* t2 = dst */
-    addiu    a1, a1, 1
-    OVER_8888_8_8888 t0, t1, t2, t0, s8, t3, t4, t5, t6
-
-    addu     s2, s2, s3        /* vx += unit_x; */
-    sw       t0, 0(a0)
-    bnez     v1, 0b
-     addiu   a0, a0, 4
-
-1:
-    RESTORE_REGS_FROM_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_8888_8_8888_OVER_asm_mips)
-
-LEAF_MIPS_DSPR2(pixman_scaled_bilinear_scanline_8888_8_8888_ADD_asm_mips)
-/*
- * a0     - *dst
- * a1     - *mask
- * a2     - *src_top
- * a3     - *src_bottom
- * 16(sp) - wt
- * 20(sp) - wb
- * 24(sp) - vx
- * 28(sp) - unit_x
- * 32(sp) - w
- */
-
-    lw       v1, 32(sp)
-    beqz     v1, 1f
-     nop
-
-    SAVE_REGS_ON_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-
-    lw       s0, 44(sp)        /* s0 = wt */
-    lw       s1, 48(sp)        /* s1 = wb */
-    lw       s2, 52(sp)        /* s2 = vx */
-    lw       s3, 56(sp)        /* s3 = unit_x */
-    li       v0, BILINEAR_INTERPOLATION_RANGE
-    li       s8, 0x00ff00ff
-
-    sll      s0, s0, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-    sll      s1, s1, (2 * (8 - BILINEAR_INTERPOLATION_BITS))
-0:
-    andi     t4, s2, 0xffff    /* t4 = (short)vx */
-    srl      t4, t4, (16 - BILINEAR_INTERPOLATION_BITS) /* t4 = vx >> 8 */
-    subu     t5, v0, t4        /* t5 = ( 256 - (vx>>8)) */
-
-    mul      s4, s0, t5        /* s4 = wt*(256-(vx>>8)) */
-    mul      s5, s0, t4        /* s5 = wt*(vx>>8) */
-    mul      s6, s1, t5        /* s6 = wb*(256-(vx>>8)) */
-    mul      s7, s1, t4        /* s7 = wb*(vx>>8) */
-
-    sra      t9, s2, 16
-    sll      t9, t9, 2
-    addiu    t8, t9, 4
-    lwx      t0, t9(a2)        /* t0 = tl */
-    lwx      t1, t8(a2)        /* t1 = tr */
-    addiu    v1, v1, -1
-    lwx      t2, t9(a3)        /* t2 = bl */
-    lwx      t3, t8(a3)        /* t3 = br */
-
-    BILINEAR_INTERPOLATE_SINGLE_PIXEL t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, s4, s5, s6, s7
-    lbu      t1, 0(a1)         /* t1 = mask */
-    lw       t2, 0(a0)         /* t2 = dst */
-    addiu    a1, a1, 1
-    MIPS_UN8x4_MUL_UN8_ADD_UN8x4 t0, t1, t2, t0, s8, t3, t4, t5
-
-    addu     s2, s2, s3        /* vx += unit_x; */
-    sw       t0, 0(a0)
-    bnez     v1, 0b
-     addiu   a0, a0, 4
-
-    RESTORE_REGS_FROM_STACK 28, v0, v1, s0, s1, s2, s3, s4, s5, s6, s7, s8
-1:
-    j        ra
-     nop
-
-END(pixman_scaled_bilinear_scanline_8888_8_8888_ADD_asm_mips)
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-mips-dspr2-asm.h
+++ /dev/null
@@ -1,659 +0,0 @@
-/*
- * Copyright (c) 2012
- *      MIPS Technologies, Inc., California.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
- *    contributors may be used to endorse or promote products derived from
- *    this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Author:  Nemanja Lukic (nlukic@mips.com)
- */
-
-#ifndef PIXMAN_MIPS_DSPR2_ASM_H
-#define PIXMAN_MIPS_DSPR2_ASM_H
-
-#define zero $0
-#define AT   $1
-#define v0   $2
-#define v1   $3
-#define a0   $4
-#define a1   $5
-#define a2   $6
-#define a3   $7
-#define t0   $8
-#define t1   $9
-#define t2   $10
-#define t3   $11
-#define t4   $12
-#define t5   $13
-#define t6   $14
-#define t7   $15
-#define s0   $16
-#define s1   $17
-#define s2   $18
-#define s3   $19
-#define s4   $20
-#define s5   $21
-#define s6   $22
-#define s7   $23
-#define t8   $24
-#define t9   $25
-#define k0   $26
-#define k1   $27
-#define gp   $28
-#define sp   $29
-#define fp   $30
-#define s8   $30
-#define ra   $31
-
-/*
- * LEAF_MIPS32R2 - declare leaf routine for MIPS32r2
- */
-#define LEAF_MIPS32R2(symbol)                           \
-                .globl  symbol;                         \
-                .align  2;                              \
-                .type   symbol, @function;              \
-                .ent    symbol, 0;                      \
-symbol:         .frame  sp, 0, ra;                      \
-                .set    push;                           \
-                .set    arch=mips32r2;                  \
-                .set    noreorder;                      \
-                .set    noat;
-
-/*
- * LEAF_MIPS32R2 - declare leaf routine for MIPS DSPr2
- */
-#define LEAF_MIPS_DSPR2(symbol)                         \
-LEAF_MIPS32R2(symbol)                                   \
-                .set    dspr2;
-
-/*
- * END - mark end of function
- */
-#define END(function)                                   \
-                .set    pop;                            \
-                .end    function;                       \
-                .size   function,.-function
-
-/*
- * Checks if stack offset is big enough for storing/restoring regs_num
- * number of register to/from stack. Stack offset must be greater than
- * or equal to the number of bytes needed for storing registers (regs_num*4).
- * Since MIPS ABI allows usage of first 16 bytes of stack frame (this is
- * preserved for input arguments of the functions, already stored in a0-a3),
- * stack size can be further optimized by utilizing this space.
- */
-.macro CHECK_STACK_OFFSET regs_num, stack_offset
-.if \stack_offset < \regs_num * 4 - 16
-.error "Stack offset too small."
-.endif
-.endm
-
-/*
- * Saves set of registers on stack. Maximum number of registers that
- * can be saved on stack is limitted to 14 (a0-a3, v0-v1 and s0-s7).
- * Stack offset is number of bytes that are added to stack pointer (sp)
- * before registers are pushed in order to provide enough space on stack
- * (offset must be multiple of 4, and must be big enough, as described by
- * CHECK_STACK_OFFSET macro). This macro is intended to be used in
- * combination with RESTORE_REGS_FROM_STACK macro. Example:
- *  SAVE_REGS_ON_STACK      4, v0, v1, s0, s1
- *  RESTORE_REGS_FROM_STACK 4, v0, v1, s0, s1
- */
-.macro SAVE_REGS_ON_STACK stack_offset = 0, r1, \
-                          r2  = 0, r3  = 0, r4  = 0, \
-                          r5  = 0, r6  = 0, r7  = 0, \
-                          r8  = 0, r9  = 0, r10 = 0, \
-                          r11 = 0, r12 = 0, r13 = 0, \
-                          r14 = 0
-    .if (\stack_offset < 0) || (\stack_offset - (\stack_offset / 4) * 4)
-    .error "Stack offset must be pozitive and multiple of 4."
-    .endif
-    .if \stack_offset != 0
-    addiu           sp, sp, -\stack_offset
-    .endif
-    sw              \r1, 0(sp)
-    .if \r2 != 0
-    sw              \r2, 4(sp)
-    .endif
-    .if \r3 != 0
-    sw              \r3, 8(sp)
-    .endif
-    .if \r4 != 0
-    sw              \r4, 12(sp)
-    .endif
-    .if \r5 != 0
-    CHECK_STACK_OFFSET 5, \stack_offset
-    sw              \r5, 16(sp)
-    .endif
-    .if \r6 != 0
-    CHECK_STACK_OFFSET 6, \stack_offset
-    sw              \r6, 20(sp)
-    .endif
-    .if \r7 != 0
-    CHECK_STACK_OFFSET 7, \stack_offset
-    sw              \r7, 24(sp)
-    .endif
-    .if \r8 != 0
-    CHECK_STACK_OFFSET 8, \stack_offset
-    sw              \r8, 28(sp)
-    .endif
-    .if \r9 != 0
-    CHECK_STACK_OFFSET 9, \stack_offset
-    sw              \r9, 32(sp)
-    .endif
-    .if \r10 != 0
-    CHECK_STACK_OFFSET 10, \stack_offset
-    sw              \r10, 36(sp)
-    .endif
-    .if \r11 != 0
-    CHECK_STACK_OFFSET 11, \stack_offset
-    sw              \r11, 40(sp)
-    .endif
-    .if \r12 != 0
-    CHECK_STACK_OFFSET 12, \stack_offset
-    sw              \r12, 44(sp)
-    .endif
-    .if \r13 != 0
-    CHECK_STACK_OFFSET 13, \stack_offset
-    sw              \r13, 48(sp)
-    .endif
-    .if \r14 != 0
-    CHECK_STACK_OFFSET 14, \stack_offset
-    sw              \r14, 52(sp)
-    .endif
-.endm
-
-/*
- * Restores set of registers from stack. Maximum number of registers that
- * can be restored from stack is limitted to 14 (a0-a3, v0-v1 and s0-s7).
- * Stack offset is number of bytes that are added to stack pointer (sp)
- * after registers are restored (offset must be multiple of 4, and must
- * be big enough, as described by CHECK_STACK_OFFSET macro). This macro is
- * intended to be used in combination with RESTORE_REGS_FROM_STACK macro.
- * Example:
- *  SAVE_REGS_ON_STACK      4, v0, v1, s0, s1
- *  RESTORE_REGS_FROM_STACK 4, v0, v1, s0, s1
- */
-.macro RESTORE_REGS_FROM_STACK stack_offset = 0, r1, \
-                               r2  = 0, r3  = 0, r4  = 0, \
-                               r5  = 0, r6  = 0, r7  = 0, \
-                               r8  = 0, r9  = 0, r10 = 0, \
-                               r11 = 0, r12 = 0, r13 = 0, \
-                               r14 = 0
-    .if (\stack_offset < 0) || (\stack_offset - (\stack_offset/4)*4)
-    .error "Stack offset must be pozitive and multiple of 4."
-    .endif
-    lw              \r1, 0(sp)
-    .if \r2 != 0
-    lw              \r2, 4(sp)
-    .endif
-    .if \r3 != 0
-    lw              \r3, 8(sp)
-    .endif
-    .if \r4 != 0
-    lw              \r4, 12(sp)
-    .endif
-    .if \r5 != 0
-    CHECK_STACK_OFFSET 5, \stack_offset
-    lw              \r5, 16(sp)
-    .endif
-    .if \r6 != 0
-    CHECK_STACK_OFFSET 6, \stack_offset
-    lw              \r6, 20(sp)
-    .endif
-    .if \r7 != 0
-    CHECK_STACK_OFFSET 7, \stack_offset
-    lw              \r7, 24(sp)
-    .endif
-    .if \r8 != 0
-    CHECK_STACK_OFFSET 8, \stack_offset
-    lw              \r8, 28(sp)
-    .endif
-    .if \r9 != 0
-    CHECK_STACK_OFFSET 9, \stack_offset
-    lw              \r9, 32(sp)
-    .endif
-    .if \r10 != 0
-    CHECK_STACK_OFFSET 10, \stack_offset
-    lw              \r10, 36(sp)
-    .endif
-    .if \r11 != 0
-    CHECK_STACK_OFFSET 11, \stack_offset
-    lw              \r11, 40(sp)
-    .endif
-    .if \r12 != 0
-    CHECK_STACK_OFFSET 12, \stack_offset
-    lw              \r12, 44(sp)
-    .endif
-    .if \r13 != 0
-    CHECK_STACK_OFFSET 13, \stack_offset
-    lw              \r13, 48(sp)
-    .endif
-    .if \r14 != 0
-    CHECK_STACK_OFFSET 14, \stack_offset
-    lw              \r14, 52(sp)
-    .endif
-    .if \stack_offset != 0
-    addiu           sp, sp, \stack_offset
-    .endif
-.endm
-
-/*
- * Conversion of single r5g6b5 pixel (in_565) to single a8r8g8b8 pixel
- * returned in (out_8888) register. Requires two temporary registers
- * (scratch1 and scratch2).
- */
-.macro CONVERT_1x0565_TO_1x8888 in_565,   \
-                                out_8888, \
-                                scratch1, scratch2
-    lui     \out_8888, 0xff00
-    sll     \scratch1, \in_565,   0x3
-    andi    \scratch2, \scratch1, 0xff
-    ext     \scratch1, \in_565,   0x2, 0x3
-    or      \scratch1, \scratch2, \scratch1
-    or      \out_8888, \out_8888, \scratch1
-
-    sll     \scratch1, \in_565,   0x5
-    andi    \scratch1, \scratch1, 0xfc00
-    srl     \scratch2, \in_565,   0x1
-    andi    \scratch2, \scratch2, 0x300
-    or      \scratch2, \scratch1, \scratch2
-    or      \out_8888, \out_8888, \scratch2
-
-    andi    \scratch1, \in_565,   0xf800
-    srl     \scratch2, \scratch1, 0x5
-    andi    \scratch2, \scratch2, 0xff00
-    or      \scratch1, \scratch1, \scratch2
-    sll     \scratch1, \scratch1, 0x8
-    or      \out_8888, \out_8888, \scratch1
-.endm
-
-/*
- * Conversion of two r5g6b5 pixels (in1_565 and in2_565) to two a8r8g8b8 pixels
- * returned in (out1_8888 and out2_8888) registers. Requires four scratch
- * registers (scratch1 ... scratch4). It also requires maskG and maskB for
- * color component extractions. These masks must have following values:
- *   li       maskG, 0x07e007e0
- *   li       maskB, 0x001F001F
- */
-.macro CONVERT_2x0565_TO_2x8888 in1_565, in2_565,     \
-                                out1_8888, out2_8888, \
-                                maskG, maskB,         \
-                                scratch1, scratch2, scratch3, scratch4
-    sll               \scratch1,  \in1_565,   16
-    or                \scratch1,  \scratch1,  \in2_565
-    lui               \out2_8888, 0xff00
-    ori               \out2_8888, \out2_8888, 0xff00
-    shrl.ph           \scratch2,  \scratch1,  11
-    and               \scratch3,  \scratch1,  \maskG
-    shra.ph           \scratch4,  \scratch2,  2
-    shll.ph           \scratch2,  \scratch2,  3
-    shll.ph           \scratch3,  \scratch3,  5
-    or                \scratch2,  \scratch2,  \scratch4
-    shrl.qb           \scratch4,  \scratch3,  6
-    or                \out2_8888, \out2_8888, \scratch2
-    or                \scratch3,  \scratch3,  \scratch4
-    and               \scratch1,  \scratch1,  \maskB
-    shll.ph           \scratch2,  \scratch1,  3
-    shra.ph           \scratch4,  \scratch1,  2
-    or                \scratch2,  \scratch2,  \scratch4
-    or                \scratch3,  \scratch2,  \scratch3
-    precrq.ph.w       \out1_8888, \out2_8888, \scratch3
-    precr_sra.ph.w    \out2_8888, \scratch3,  0
-.endm
-
-/*
- * Conversion of single a8r8g8b8 pixel (in_8888) to single r5g6b5 pixel
- * returned in (out_565) register. Requires two temporary registers
- * (scratch1 and scratch2).
- */
-.macro CONVERT_1x8888_TO_1x0565 in_8888, \
-                                out_565, \
-                                scratch1, scratch2
-    ext     \out_565,  \in_8888,  0x3, 0x5
-    srl     \scratch1, \in_8888,  0x5
-    andi    \scratch1, \scratch1, 0x07e0
-    srl     \scratch2, \in_8888,  0x8
-    andi    \scratch2, \scratch2, 0xf800
-    or      \out_565,  \out_565,  \scratch1
-    or      \out_565,  \out_565,  \scratch2
-.endm
-
-/*
- * Conversion of two a8r8g8b8 pixels (in1_8888 and in2_8888) to two r5g6b5
- * pixels returned in (out1_565 and out2_565) registers. Requires two temporary
- * registers (scratch1 and scratch2). It also requires maskR, maskG and maskB
- * for color component extractions. These masks must have following values:
- *   li       maskR, 0xf800f800
- *   li       maskG, 0x07e007e0
- *   li       maskB, 0x001F001F
- * Value of input register in2_8888 is lost.
- */
-.macro CONVERT_2x8888_TO_2x0565 in1_8888, in2_8888,  \
-                                out1_565, out2_565,  \
-                                maskR, maskG, maskB, \
-                                scratch1, scratch2
-    precrq.ph.w       \scratch1, \in2_8888, \in1_8888
-    precr_sra.ph.w    \in2_8888, \in1_8888, 0
-    shll.ph           \scratch1, \scratch1, 8
-    srl               \in2_8888, \in2_8888, 3
-    and               \scratch2, \in2_8888, \maskB
-    and               \scratch1, \scratch1, \maskR
-    srl               \in2_8888, \in2_8888, 2
-    and               \out2_565, \in2_8888, \maskG
-    or                \out2_565, \out2_565, \scratch2
-    or                \out1_565, \out2_565, \scratch1
-    srl               \out2_565, \out1_565, 16
-.endm
-
-/*
- * Multiply pixel (a8) with single pixel (a8r8g8b8). It requires maskLSR needed
- * for rounding process. maskLSR must have following value:
- *   li       maskLSR, 0x00ff00ff
- */
-.macro MIPS_UN8x4_MUL_UN8 s_8888,  \
-                          m_8,     \
-                          d_8888,  \
-                          maskLSR, \
-                          scratch1, scratch2, scratch3
-    replv.ph          \m_8,      \m_8                 /*   0 | M | 0 | M */
-    muleu_s.ph.qbl    \scratch1, \s_8888,   \m_8      /*    A*M  |  R*M */
-    muleu_s.ph.qbr    \scratch2, \s_8888,   \m_8      /*    G*M  |  B*M */
-    shra_r.ph         \scratch3, \scratch1, 8
-    shra_r.ph         \d_8888,   \scratch2, 8
-    and               \scratch3, \scratch3, \maskLSR  /*   0 |A*M| 0 |R*M */
-    and               \d_8888,   \d_8888,   \maskLSR  /*   0 |G*M| 0 |B*M */
-    addq.ph           \scratch1, \scratch1, \scratch3 /* A*M+A*M | R*M+R*M */
-    addq.ph           \scratch2, \scratch2, \d_8888   /* G*M+G*M | B*M+B*M */
-    shra_r.ph         \scratch1, \scratch1, 8
-    shra_r.ph         \scratch2, \scratch2, 8
-    precr.qb.ph       \d_8888,   \scratch1, \scratch2
-.endm
-
-/*
- * Multiply two pixels (a8) with two pixels (a8r8g8b8). It requires maskLSR
- * needed for rounding process. maskLSR must have following value:
- *   li       maskLSR, 0x00ff00ff
- */
-.macro MIPS_2xUN8x4_MUL_2xUN8 s1_8888, \
-                              s2_8888, \
-                              m1_8,    \
-                              m2_8,    \
-                              d1_8888, \
-                              d2_8888, \
-                              maskLSR, \
-                              scratch1, scratch2, scratch3, \
-                              scratch4, scratch5, scratch6
-    replv.ph          \m1_8,     \m1_8                /*  0 | M1 | 0 | M1 */
-    replv.ph          \m2_8,     \m2_8                /*  0 | M2 | 0 | M2 */
-    muleu_s.ph.qbl    \scratch1, \s1_8888,  \m1_8     /*  A1*M1  |  R1*M1 */
-    muleu_s.ph.qbr    \scratch2, \s1_8888,  \m1_8     /*  G1*M1  |  B1*M1 */
-    muleu_s.ph.qbl    \scratch3, \s2_8888,  \m2_8     /*  A2*M2  |  R2*M2 */
-    muleu_s.ph.qbr    \scratch4, \s2_8888,  \m2_8     /*  G2*M2  |  B2*M2 */
-    shra_r.ph         \scratch5, \scratch1, 8
-    shra_r.ph         \d1_8888,  \scratch2, 8
-    shra_r.ph         \scratch6, \scratch3, 8
-    shra_r.ph         \d2_8888,  \scratch4, 8
-    and               \scratch5, \scratch5, \maskLSR  /* 0 |A1*M1| 0 |R1*M1 */
-    and               \d1_8888,  \d1_8888,  \maskLSR  /* 0 |G1*M1| 0 |B1*M1 */
-    and               \scratch6, \scratch6, \maskLSR  /* 0 |A2*M2| 0 |R2*M2 */
-    and               \d2_8888,  \d2_8888,  \maskLSR  /* 0 |G2*M2| 0 |B2*M2 */
-    addq.ph           \scratch1, \scratch1, \scratch5
-    addq.ph           \scratch2, \scratch2, \d1_8888
-    addq.ph           \scratch3, \scratch3, \scratch6
-    addq.ph           \scratch4, \scratch4, \d2_8888
-    shra_r.ph         \scratch1, \scratch1, 8
-    shra_r.ph         \scratch2, \scratch2, 8
-    shra_r.ph         \scratch3, \scratch3, 8
-    shra_r.ph         \scratch4, \scratch4, 8
-    precr.qb.ph       \d1_8888,  \scratch1, \scratch2
-    precr.qb.ph       \d2_8888,  \scratch3, \scratch4
-.endm
-
-/*
- * Multiply pixel (a8r8g8b8) with single pixel (a8r8g8b8). It requires maskLSR
- * needed for rounding process. maskLSR must have following value:
- *   li       maskLSR, 0x00ff00ff
- */
-.macro MIPS_UN8x4_MUL_UN8x4 s_8888,  \
-                            m_8888,  \
-                            d_8888,  \
-                            maskLSR, \
-                            scratch1, scratch2, scratch3, scratch4
-    preceu.ph.qbl     \scratch1, \m_8888              /*   0 | A | 0 | R */
-    preceu.ph.qbr     \scratch2, \m_8888              /*   0 | G | 0 | B */
-    muleu_s.ph.qbl    \scratch3, \s_8888,   \scratch1 /*    A*A  |  R*R */
-    muleu_s.ph.qbr    \scratch4, \s_8888,   \scratch2 /*    G*G  |  B*B */
-    shra_r.ph         \scratch1, \scratch3, 8
-    shra_r.ph         \scratch2, \scratch4, 8
-    and               \scratch1, \scratch1, \maskLSR  /*   0 |A*A| 0 |R*R */
-    and               \scratch2, \scratch2, \maskLSR  /*   0 |G*G| 0 |B*B */
-    addq.ph           \scratch1, \scratch1, \scratch3
-    addq.ph           \scratch2, \scratch2, \scratch4
-    shra_r.ph         \scratch1, \scratch1, 8
-    shra_r.ph         \scratch2, \scratch2, 8
-    precr.qb.ph       \d_8888,   \scratch1, \scratch2
-.endm
-
-/*
- * Multiply two pixels (a8r8g8b8) with two pixels (a8r8g8b8). It requires
- * maskLSR needed for rounding process. maskLSR must have following value:
- *   li       maskLSR, 0x00ff00ff
- */
-
-.macro MIPS_2xUN8x4_MUL_2xUN8x4 s1_8888,  \
-                                s2_8888,  \
-                                m1_8888,  \
-                                m2_8888,  \
-                                d1_8888,  \
-                                d2_8888,  \
-                                maskLSR,  \
-                                scratch1, scratch2, scratch3, \
-                                scratch4, scratch5, scratch6
-    preceu.ph.qbl     \scratch1, \m1_8888             /*   0 | A | 0 | R */
-    preceu.ph.qbr     \scratch2, \m1_8888             /*   0 | G | 0 | B */
-    preceu.ph.qbl     \scratch3, \m2_8888             /*   0 | A | 0 | R */
-    preceu.ph.qbr     \scratch4, \m2_8888             /*   0 | G | 0 | B */
-    muleu_s.ph.qbl    \scratch5, \s1_8888,  \scratch1 /*    A*A  |  R*R */
-    muleu_s.ph.qbr    \scratch6, \s1_8888,  \scratch2 /*    G*G  |  B*B */
-    muleu_s.ph.qbl    \scratch1, \s2_8888,  \scratch3 /*    A*A  |  R*R */
-    muleu_s.ph.qbr    \scratch2, \s2_8888,  \scratch4 /*    G*G  |  B*B */
-    shra_r.ph         \scratch3, \scratch5, 8
-    shra_r.ph         \scratch4, \scratch6, 8
-    shra_r.ph         \d1_8888,  \scratch1, 8
-    shra_r.ph         \d2_8888,  \scratch2, 8
-    and               \scratch3, \scratch3, \maskLSR  /*   0 |A*A| 0 |R*R */
-    and               \scratch4, \scratch4, \maskLSR  /*   0 |G*G| 0 |B*B */
-    and               \d1_8888,  \d1_8888,  \maskLSR  /*   0 |A*A| 0 |R*R */
-    and               \d2_8888,  \d2_8888,  \maskLSR  /*   0 |G*G| 0 |B*B */
-    addq.ph           \scratch3, \scratch3, \scratch5
-    addq.ph           \scratch4, \scratch4, \scratch6
-    addq.ph           \d1_8888,  \d1_8888,  \scratch1
-    addq.ph           \d2_8888,  \d2_8888,  \scratch2
-    shra_r.ph         \scratch3, \scratch3, 8
-    shra_r.ph         \scratch4, \scratch4, 8
-    shra_r.ph         \scratch5, \d1_8888,  8
-    shra_r.ph         \scratch6, \d2_8888,  8
-    precr.qb.ph       \d1_8888,  \scratch3, \scratch4
-    precr.qb.ph       \d2_8888,  \scratch5, \scratch6
-.endm
-
-/*
- * OVER operation on single a8r8g8b8 source pixel (s_8888) and single a8r8g8b8
- * destination pixel (d_8888) using a8 mask (m_8). It also requires maskLSR
- * needed for rounding process. maskLSR must have following value:
- *   li       maskLSR, 0x00ff00ff
- */
-.macro OVER_8888_8_8888 s_8888,   \
-                        m_8,      \
-                        d_8888,   \
-                        out_8888, \
-                        maskLSR,  \
-                        scratch1, scratch2, scratch3, scratch4
-    MIPS_UN8x4_MUL_UN8 \s_8888,   \m_8, \
-                       \scratch1, \maskLSR, \
-                       \scratch2, \scratch3, \scratch4
-
-    not                \scratch2, \scratch1
-    srl                \scratch2, \scratch2, 24
-
-    MIPS_UN8x4_MUL_UN8 \d_8888,   \scratch2, \
-                       \d_8888,   \maskLSR,  \
-                       \scratch3, \scratch4, \out_8888
-
-    addu_s.qb          \out_8888, \d_8888,   \scratch1
-.endm
-
-/*
- * OVER operation on two a8r8g8b8 source pixels (s1_8888 and s2_8888) and two
- * a8r8g8b8 destination pixels (d1_8888 and d2_8888) using a8 masks (m1_8 and
- * m2_8). It also requires maskLSR needed for rounding process. maskLSR must
- * have following value:
- *   li       maskLSR, 0x00ff00ff
- */
-.macro OVER_2x8888_2x8_2x8888 s1_8888,   \
-                              s2_8888,   \
-                              m1_8,      \
-                              m2_8,      \
-                              d1_8888,   \
-                              d2_8888,   \
-                              out1_8888, \
-                              out2_8888, \
-                              maskLSR,   \
-                              scratch1, scratch2, scratch3, \
-                              scratch4, scratch5, scratch6
-    MIPS_2xUN8x4_MUL_2xUN8 \s1_8888,   \s2_8888, \
-                           \m1_8,      \m2_8, \
-                           \scratch1,  \scratch2, \
-                           \maskLSR, \
-                           \scratch3,  \scratch4, \out1_8888, \
-                           \out2_8888, \scratch5, \scratch6
-
-    not                    \scratch3,  \scratch1
-    srl                    \scratch3,  \scratch3, 24
-    not                    \scratch4,  \scratch2
-    srl                    \scratch4,  \scratch4, 24
-
-    MIPS_2xUN8x4_MUL_2xUN8 \d1_8888,   \d2_8888, \
-                           \scratch3,  \scratch4, \
-                           \d1_8888,   \d2_8888, \
-                           \maskLSR, \
-                           \scratch5,  \scratch6, \out1_8888, \
-                           \out2_8888, \scratch3, \scratch4
-
-    addu_s.qb              \out1_8888, \d1_8888,  \scratch1
-    addu_s.qb              \out2_8888, \d2_8888,  \scratch2
-.endm
-
-/*
- * OVER operation on single a8r8g8b8 source pixel (s_8888) and single a8r8g8b8
- * destination pixel (d_8888). It also requires maskLSR needed for rounding
- * process. maskLSR must have following value:
- *   li       maskLSR, 0x00ff00ff
- */
-.macro OVER_8888_8888 s_8888,   \
-                      d_8888,   \
-                      out_8888, \
-                      maskLSR,  \
-                      scratch1, scratch2, scratch3, scratch4
-    not                \scratch1, \s_8888
-    srl                \scratch1, \scratch1, 24
-
-    MIPS_UN8x4_MUL_UN8 \d_8888,   \scratch1, \
-                       \out_8888, \maskLSR, \
-                       \scratch2, \scratch3, \scratch4
-
-    addu_s.qb          \out_8888, \out_8888, \s_8888
-.endm
-
-.macro MIPS_UN8x4_MUL_UN8_ADD_UN8x4 s_8888,   \
-                                    m_8,      \
-                                    d_8888,   \
-                                    out_8888, \
-                                    maskLSR,  \
-                                    scratch1, scratch2, scratch3
-    MIPS_UN8x4_MUL_UN8 \s_8888, \m_8, \
-                       \out_8888, \maskLSR, \
-                       \scratch1, \scratch2, \scratch3
-
-    addu_s.qb          \out_8888, \out_8888, \d_8888
-.endm
-
-.macro BILINEAR_INTERPOLATE_SINGLE_PIXEL tl, tr, bl, br,         \
-                                         scratch1, scratch2,     \
-                                         alpha, red, green, blue \
-                                         wt1, wt2, wb1, wb2
-    andi            \scratch1, \tl,  0xff
-    andi            \scratch2, \tr,  0xff
-    andi            \alpha,    \bl,  0xff
-    andi            \red,      \br,  0xff
-
-    multu           $ac0,      \wt1, \scratch1
-    maddu           $ac0,      \wt2, \scratch2
-    maddu           $ac0,      \wb1, \alpha
-    maddu           $ac0,      \wb2, \red
-
-    ext             \scratch1, \tl,  8, 8
-    ext             \scratch2, \tr,  8, 8
-    ext             \alpha,    \bl,  8, 8
-    ext             \red,      \br,  8, 8
-
-    multu           $ac1,      \wt1, \scratch1
-    maddu           $ac1,      \wt2, \scratch2
-    maddu           $ac1,      \wb1, \alpha
-    maddu           $ac1,      \wb2, \red
-
-    ext             \scratch1, \tl,  16, 8
-    ext             \scratch2, \tr,  16, 8
-    ext             \alpha,    \bl,  16, 8
-    ext             \red,      \br,  16, 8
-
-    mflo            \blue,     $ac0
-
-    multu           $ac2,      \wt1, \scratch1
-    maddu           $ac2,      \wt2, \scratch2
-    maddu           $ac2,      \wb1, \alpha
-    maddu           $ac2,      \wb2, \red
-
-    ext             \scratch1, \tl,  24, 8
-    ext             \scratch2, \tr,  24, 8
-    ext             \alpha,    \bl,  24, 8
-    ext             \red,      \br,  24, 8
-
-    mflo            \green,    $ac1
-
-    multu           $ac3,      \wt1, \scratch1
-    maddu           $ac3,      \wt2, \scratch2
-    maddu           $ac3,      \wb1, \alpha
-    maddu           $ac3,      \wb2, \red
-
-    mflo            \red,      $ac2
-    mflo            \alpha,    $ac3
-
-    precr.qb.ph     \alpha,    \alpha, \red
-    precr.qb.ph     \scratch1, \green, \blue
-    precrq.qb.ph    \tl,       \alpha, \scratch1
-.endm
-
-#endif //PIXMAN_MIPS_DSPR2_ASM_H
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-mips-dspr2.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- * Copyright (c) 2012
- *      MIPS Technologies, Inc., California.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
- *    contributors may be used to endorse or promote products derived from
- *    this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Author:  Nemanja Lukic (nlukic@mips.com)
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "pixman-private.h"
-#include "pixman-mips-dspr2.h"
-
-PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (0, src_x888_8888,
-                                    uint32_t, 1, uint32_t, 1)
-PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (0, src_8888_0565,
-                                    uint32_t, 1, uint16_t, 1)
-PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (0, src_0565_8888,
-                                    uint16_t, 1, uint32_t, 1)
-PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (DO_FAST_MEMCPY, src_0565_0565,
-                                    uint16_t, 1, uint16_t, 1)
-PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (DO_FAST_MEMCPY, src_8888_8888,
-                                    uint32_t, 1, uint32_t, 1)
-PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST (DO_FAST_MEMCPY, src_0888_0888,
-                                    uint8_t, 3, uint8_t, 3)
-
-PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, over_n_8888_8888_ca,
-                                       uint32_t, 1, uint32_t, 1)
-PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, over_n_8888_0565_ca,
-                                       uint32_t, 1, uint16_t, 1)
-PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, over_n_8_8888,
-                                       uint8_t, 1, uint32_t, 1)
-PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST (SKIP_ZERO_SRC, over_n_8_0565,
-                                       uint8_t, 1, uint16_t, 1)
-
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_DST (0, 8888_8888, SRC,
-                                          uint32_t, uint32_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_DST (0, 8888_0565, SRC,
-                                          uint32_t, uint16_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_DST (0, 0565_8888, SRC,
-                                          uint16_t, uint32_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_DST (0, 0565_0565, SRC,
-                                          uint16_t, uint16_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_DST (SKIP_ZERO_SRC, 8888_8888, OVER,
-                                          uint32_t, uint32_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_DST (SKIP_ZERO_SRC, 8888_8888, ADD,
-                                          uint32_t, uint32_t)
-
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_A8_DST (0, 8888_8_8888, SRC,
-                                             uint32_t, uint32_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_A8_DST (0, 8888_8_0565, SRC,
-                                             uint32_t, uint16_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_A8_DST (0, 0565_8_x888, SRC,
-                                             uint16_t, uint32_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_A8_DST (0, 0565_8_0565, SRC,
-                                             uint16_t, uint16_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_A8_DST (SKIP_ZERO_SRC, 8888_8_8888, OVER,
-                                             uint32_t, uint32_t)
-PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_A8_DST (SKIP_ZERO_SRC, 8888_8_8888, ADD,
-                                             uint32_t, uint32_t)
-
-static pixman_bool_t
-pixman_fill_mips (uint32_t *bits,
-                  int       stride,
-                  int       bpp,
-                  int       x,
-                  int       y,
-                  int       width,
-                  int       height,
-                  uint32_t  _xor)
-{
-    uint8_t *byte_line;
-    uint32_t byte_width;
-    switch (bpp)
-    {
-    case 16:
-        stride = stride * (int) sizeof (uint32_t) / 2;
-        byte_line = (uint8_t *)(((uint16_t *)bits) + stride * y + x);
-        byte_width = width * 2;
-        stride *= 2;
-
-        while (height--)
-        {
-            uint8_t *dst = byte_line;
-            byte_line += stride;
-            pixman_fill_buff16_mips (dst, byte_width, _xor & 0xffff);
-        }
-        return TRUE;
-    case 32:
-        stride = stride * (int) sizeof (uint32_t) / 4;
-        byte_line = (uint8_t *)(((uint32_t *)bits) + stride * y + x);
-        byte_width = width * 4;
-        stride *= 4;
-
-        while (height--)
-        {
-            uint8_t *dst = byte_line;
-            byte_line += stride;
-            pixman_fill_buff32_mips (dst, byte_width, _xor);
-        }
-        return TRUE;
-    default:
-        return FALSE;
-    }
-}
-
-static pixman_bool_t
-pixman_blt_mips (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       dest_x,
-                 int       dest_y,
-                 int       width,
-                 int       height)
-{
-    if (src_bpp != dst_bpp)
-        return FALSE;
-
-    uint8_t *src_bytes;
-    uint8_t *dst_bytes;
-    uint32_t byte_width;
-
-    switch (src_bpp)
-    {
-    case 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 * (dest_y) + (dest_x));
-        byte_width = width * 2;
-        src_stride *= 2;
-        dst_stride *= 2;
-
-        while (height--)
-        {
-            uint8_t *src = src_bytes;
-            uint8_t *dst = dst_bytes;
-            src_bytes += src_stride;
-            dst_bytes += dst_stride;
-            pixman_mips_fast_memcpy (dst, src, byte_width);
-        }
-        return TRUE;
-    case 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 * (dest_y) + (dest_x));
-        byte_width = width * 4;
-        src_stride *= 4;
-        dst_stride *= 4;
-
-        while (height--)
-        {
-            uint8_t *src = src_bytes;
-            uint8_t *dst = dst_bytes;
-            src_bytes += src_stride;
-            dst_bytes += dst_stride;
-            pixman_mips_fast_memcpy (dst, src, byte_width);
-        }
-        return TRUE;
-    default:
-        return FALSE;
-    }
-}
-
-static const pixman_fast_path_t mips_dspr2_fast_paths[] =
-{
-    PIXMAN_STD_FAST_PATH (SRC, r5g6b5,   null, r5g6b5,   mips_composite_src_0565_0565),
-    PIXMAN_STD_FAST_PATH (SRC, b5g6r5,   null, b5g6r5,   mips_composite_src_0565_0565),
-    PIXMAN_STD_FAST_PATH (SRC, a8r8g8b8, null, r5g6b5,   mips_composite_src_8888_0565),
-    PIXMAN_STD_FAST_PATH (SRC, x8r8g8b8, null, r5g6b5,   mips_composite_src_8888_0565),
-    PIXMAN_STD_FAST_PATH (SRC, a8b8g8r8, null, b5g6r5,   mips_composite_src_8888_0565),
-    PIXMAN_STD_FAST_PATH (SRC, x8b8g8r8, null, b5g6r5,   mips_composite_src_8888_0565),
-    PIXMAN_STD_FAST_PATH (SRC, r5g6b5,   null, a8r8g8b8, mips_composite_src_0565_8888),
-    PIXMAN_STD_FAST_PATH (SRC, r5g6b5,   null, x8r8g8b8, mips_composite_src_0565_8888),
-    PIXMAN_STD_FAST_PATH (SRC, b5g6r5,   null, a8b8g8r8, mips_composite_src_0565_8888),
-    PIXMAN_STD_FAST_PATH (SRC, b5g6r5,   null, x8b8g8r8, mips_composite_src_0565_8888),
-    PIXMAN_STD_FAST_PATH (SRC, a8r8g8b8, null, x8r8g8b8, mips_composite_src_8888_8888),
-    PIXMAN_STD_FAST_PATH (SRC, x8r8g8b8, null, x8r8g8b8, mips_composite_src_8888_8888),
-    PIXMAN_STD_FAST_PATH (SRC, a8b8g8r8, null, x8b8g8r8, mips_composite_src_8888_8888),
-    PIXMAN_STD_FAST_PATH (SRC, x8b8g8r8, null, x8b8g8r8, mips_composite_src_8888_8888),
-    PIXMAN_STD_FAST_PATH (SRC, a8r8g8b8, null, a8r8g8b8, mips_composite_src_8888_8888),
-    PIXMAN_STD_FAST_PATH (SRC, a8b8g8r8, null, a8b8g8r8, mips_composite_src_8888_8888),
-    PIXMAN_STD_FAST_PATH (SRC, x8r8g8b8, null, a8r8g8b8, mips_composite_src_x888_8888),
-    PIXMAN_STD_FAST_PATH (SRC, x8b8g8r8, null, a8b8g8r8, mips_composite_src_x888_8888),
-    PIXMAN_STD_FAST_PATH (SRC, r8g8b8,   null, r8g8b8,   mips_composite_src_0888_0888),
-
-    PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8r8g8b8, a8r8g8b8, mips_composite_over_n_8888_8888_ca),
-    PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8r8g8b8, x8r8g8b8, mips_composite_over_n_8888_8888_ca),
-    PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8b8g8r8, a8b8g8r8, mips_composite_over_n_8888_8888_ca),
-    PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8b8g8r8, x8b8g8r8, mips_composite_over_n_8888_8888_ca),
-    PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8r8g8b8, r5g6b5,   mips_composite_over_n_8888_0565_ca),
-    PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8b8g8r8, b5g6r5,   mips_composite_over_n_8888_0565_ca),
-    PIXMAN_STD_FAST_PATH (OVER, solid,    a8,       a8r8g8b8, mips_composite_over_n_8_8888),
-    PIXMAN_STD_FAST_PATH (OVER, solid,    a8,       x8r8g8b8, mips_composite_over_n_8_8888),
-    PIXMAN_STD_FAST_PATH (OVER, solid,    a8,       a8b8g8r8, mips_composite_over_n_8_8888),
-    PIXMAN_STD_FAST_PATH (OVER, solid,    a8,       x8b8g8r8, mips_composite_over_n_8_8888),
-    PIXMAN_STD_FAST_PATH (OVER, solid,    a8,       r5g6b5,   mips_composite_over_n_8_0565),
-    PIXMAN_STD_FAST_PATH (OVER, solid,    a8,       b5g6r5,   mips_composite_over_n_8_0565),
-
-    SIMPLE_BILINEAR_FAST_PATH (SRC, a8r8g8b8, a8r8g8b8, mips_8888_8888),
-    SIMPLE_BILINEAR_FAST_PATH (SRC, a8r8g8b8, x8r8g8b8, mips_8888_8888),
-    SIMPLE_BILINEAR_FAST_PATH (SRC, x8r8g8b8, x8r8g8b8, mips_8888_8888),
-
-    SIMPLE_BILINEAR_FAST_PATH (SRC, a8r8g8b8, r5g6b5, mips_8888_0565),
-    SIMPLE_BILINEAR_FAST_PATH (SRC, x8r8g8b8, r5g6b5, mips_8888_0565),
-
-    SIMPLE_BILINEAR_FAST_PATH (SRC, r5g6b5, x8r8g8b8, mips_0565_8888),
-    SIMPLE_BILINEAR_FAST_PATH (SRC, r5g6b5, r5g6b5, mips_0565_0565),
-
-    SIMPLE_BILINEAR_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, mips_8888_8888),
-    SIMPLE_BILINEAR_FAST_PATH (OVER, a8r8g8b8, x8r8g8b8, mips_8888_8888),
-
-    SIMPLE_BILINEAR_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, mips_8888_8888),
-    SIMPLE_BILINEAR_FAST_PATH (ADD, a8r8g8b8, x8r8g8b8, mips_8888_8888),
-
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, a8r8g8b8, a8r8g8b8, mips_8888_8_8888),
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, a8r8g8b8, x8r8g8b8, mips_8888_8_8888),
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, x8r8g8b8, x8r8g8b8, mips_8888_8_8888),
-
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, a8r8g8b8, r5g6b5, mips_8888_8_0565),
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, x8r8g8b8, r5g6b5, mips_8888_8_0565),
-
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, r5g6b5, x8r8g8b8, mips_0565_8_x888),
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (SRC, r5g6b5, r5g6b5, mips_0565_8_0565),
-
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, mips_8888_8_8888),
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8r8g8b8, x8r8g8b8, mips_8888_8_8888),
-
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, a8r8g8b8, a8r8g8b8, mips_8888_8_8888),
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (ADD, a8r8g8b8, x8r8g8b8, mips_8888_8_8888),
-    { PIXMAN_OP_NONE },
-};
-
-static pixman_bool_t
-mips_dspr2_blt (pixman_implementation_t *imp,
-                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                      dest_x,
-                int                      dest_y,
-                int                      width,
-                int                      height)
-{
-    if (!pixman_blt_mips (
-            src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
-            src_x, src_y, dest_x, dest_y, width, height))
-
-    {
-        return _pixman_implementation_blt (
-            imp->delegate,
-            src_bits, dst_bits, src_stride, dst_stride, src_bpp, dst_bpp,
-            src_x, src_y, dest_x, dest_y, width, height);
-    }
-
-    return TRUE;
-}
-
-static pixman_bool_t
-mips_dspr2_fill (pixman_implementation_t *imp,
-                 uint32_t *               bits,
-                 int                      stride,
-                 int                      bpp,
-                 int                      x,
-                 int                      y,
-                 int                      width,
-                 int                      height,
-                 uint32_t xor)
-{
-    if (pixman_fill_mips (bits, stride, bpp, x, y, width, height, xor))
-        return TRUE;
-
-    return _pixman_implementation_fill (
-        imp->delegate, bits, stride, bpp, x, y, width, height, xor);
-}
-
-pixman_implementation_t *
-_pixman_implementation_create_mips_dspr2 (pixman_implementation_t *fallback)
-{
-    pixman_implementation_t *imp =
-        _pixman_implementation_create (fallback, mips_dspr2_fast_paths);
-
-    imp->blt = mips_dspr2_blt;
-    imp->fill = mips_dspr2_fill;
-
-    return imp;
-}
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-mips-dspr2.h
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (c) 2012
- *      MIPS Technologies, Inc., California.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
- *    contributors may be used to endorse or promote products derived from
- *    this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Author:  Nemanja Lukic (nlukic@mips.com)
- */
-
-#ifndef PIXMAN_MIPS_DSPR2_H
-#define PIXMAN_MIPS_DSPR2_H
-
-#include "pixman-private.h"
-#include "pixman-inlines.h"
-
-#define SKIP_ZERO_SRC  1
-#define SKIP_ZERO_MASK 2
-#define DO_FAST_MEMCPY 3
-
-void
-pixman_mips_fast_memcpy (void *dst, void *src, uint32_t n_bytes);
-void
-pixman_fill_buff16_mips (void *dst, uint32_t n_bytes, uint16_t value);
-void
-pixman_fill_buff32_mips (void *dst, uint32_t n_bytes, uint32_t value);
-
-/****************************************************************/
-
-#define PIXMAN_MIPS_BIND_FAST_PATH_SRC_DST(flags, name,          \
-                                           src_type, src_cnt,    \
-                                           dst_type, dst_cnt)    \
-void                                                             \
-pixman_composite_##name##_asm_mips (dst_type *dst,               \
-                                    src_type *src,               \
-                                    int32_t   w);                \
-                                                                 \
-static void                                                      \
-mips_composite_##name (pixman_implementation_t *imp,             \
-                       pixman_composite_info_t *info)            \
-{                                                                \
-    PIXMAN_COMPOSITE_ARGS (info);                                \
-    dst_type *dst_line, *dst;                                    \
-    src_type *src_line, *src;                                    \
-    int32_t dst_stride, src_stride;                              \
-    int bpp = PIXMAN_FORMAT_BPP (dest_image->bits.format) / 8;   \
-                                                                 \
-    PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, src_type,    \
-                           src_stride, src_line, src_cnt);       \
-    PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, dst_type, \
-                           dst_stride, dst_line, dst_cnt);       \
-                                                                 \
-    while (height--)                                             \
-    {                                                            \
-      dst = dst_line;                                            \
-      dst_line += dst_stride;                                    \
-      src = src_line;                                            \
-      src_line += src_stride;                                    \
-                                                                 \
-      if (flags == DO_FAST_MEMCPY)                               \
-        pixman_mips_fast_memcpy (dst, src, width * bpp);         \
-      else                                                       \
-        pixman_composite_##name##_asm_mips (dst, src, width);    \
-    }                                                            \
-}
-
-/*******************************************************************/
-
-#define PIXMAN_MIPS_BIND_FAST_PATH_N_MASK_DST(flags, name,          \
-                                              mask_type, mask_cnt,  \
-                                              dst_type, dst_cnt)    \
-void                                                                \
-pixman_composite_##name##_asm_mips (dst_type  *dst,                 \
-                                    uint32_t  src,                  \
-                                    mask_type *mask,                \
-                                    int32_t   w);                   \
-                                                                    \
-static void                                                         \
-mips_composite_##name (pixman_implementation_t *imp,                \
-                       pixman_composite_info_t *info)               \
-{                                                                   \
-    PIXMAN_COMPOSITE_ARGS (info);                                   \
-    dst_type  *dst_line, *dst;                                      \
-    mask_type *mask_line, *mask;                                    \
-    int32_t    dst_stride, mask_stride;                             \
-    uint32_t   src;                                                 \
-                                                                    \
-    src = _pixman_image_get_solid (                                 \
-        imp, src_image, dest_image->bits.format);                   \
-                                                                    \
-    if ((flags & SKIP_ZERO_SRC) && src == 0)                        \
-        return;                                                     \
-                                                                    \
-    PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, dst_type,    \
-                           dst_stride, dst_line, dst_cnt);          \
-    PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, mask_type,   \
-                           mask_stride, mask_line, mask_cnt);       \
-                                                                    \
-    while (height--)                                                \
-    {                                                               \
-        dst = dst_line;                                             \
-        dst_line += dst_stride;                                     \
-        mask = mask_line;                                           \
-        mask_line += mask_stride;                                   \
-        pixman_composite_##name##_asm_mips (dst, src, mask, width); \
-    }                                                               \
-}
-
-/****************************************************************************/
-
-#define PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_DST(flags, name, op,            \
-                                                 src_type, dst_type)         \
-void                                                                         \
-pixman_scaled_bilinear_scanline_##name##_##op##_asm_mips(                    \
-                                             dst_type *       dst,           \
-                                             const src_type * src_top,       \
-                                             const src_type * src_bottom,    \
-                                             int32_t          w,             \
-                                             int              wt,            \
-                                             int              wb,            \
-                                             pixman_fixed_t   vx,            \
-                                             pixman_fixed_t   unit_x);       \
-static force_inline void                                                     \
-scaled_bilinear_scanline_mips_##name##_##op (dst_type *       dst,           \
-                                             const uint32_t * mask,          \
-                                             const src_type * src_top,       \
-                                             const src_type * src_bottom,    \
-                                             int32_t          w,             \
-                                             int              wt,            \
-                                             int              wb,            \
-                                             pixman_fixed_t   vx,            \
-                                             pixman_fixed_t   unit_x,        \
-                                             pixman_fixed_t   max_vx,        \
-                                             pixman_bool_t    zero_src)      \
-{                                                                            \
-    if ((flags & SKIP_ZERO_SRC) && zero_src)                                 \
-        return;                                                              \
-    pixman_scaled_bilinear_scanline_##name##_##op##_asm_mips (dst, src_top,  \
-                                                              src_bottom, w, \
-                                                              wt, wb,        \
-                                                              vx, unit_x);   \
-}                                                                            \
-                                                                             \
-FAST_BILINEAR_MAINLOOP_COMMON (mips_##name##_cover_##op,                     \
-                       scaled_bilinear_scanline_mips_##name##_##op,          \
-                       src_type, uint32_t, dst_type, COVER, FLAG_NONE)       \
-FAST_BILINEAR_MAINLOOP_COMMON (mips_##name##_none_##op,                      \
-                       scaled_bilinear_scanline_mips_##name##_##op,          \
-                       src_type, uint32_t, dst_type, NONE, FLAG_NONE)        \
-FAST_BILINEAR_MAINLOOP_COMMON (mips_##name##_pad_##op,                       \
-                       scaled_bilinear_scanline_mips_##name##_##op,          \
-                       src_type, uint32_t, dst_type, PAD, FLAG_NONE)         \
-FAST_BILINEAR_MAINLOOP_COMMON (mips_##name##_normal_##op,                    \
-                       scaled_bilinear_scanline_mips_##name##_##op,          \
-                       src_type, uint32_t, dst_type, NORMAL,                 \
-                       FLAG_NONE)
-
-/*****************************************************************************/
-
-#define PIXMAN_MIPS_BIND_SCALED_BILINEAR_SRC_A8_DST(flags, name, op,          \
-                                                src_type, dst_type)           \
-void                                                                          \
-pixman_scaled_bilinear_scanline_##name##_##op##_asm_mips (                    \
-                                             dst_type *       dst,            \
-                                             const uint8_t *  mask,           \
-                                             const src_type * top,            \
-                                             const src_type * bottom,         \
-                                             int              wt,             \
-                                             int              wb,             \
-                                             pixman_fixed_t   x,              \
-                                             pixman_fixed_t   ux,             \
-                                             int              width);         \
-                                                                              \
-static force_inline void                                                      \
-scaled_bilinear_scanline_mips_##name##_##op (dst_type *       dst,            \
-                                             const uint8_t *  mask,           \
-                                             const src_type * src_top,        \
-                                             const src_type * src_bottom,     \
-                                             int32_t          w,              \
-                                             int              wt,             \
-                                             int              wb,             \
-                                             pixman_fixed_t   vx,             \
-                                             pixman_fixed_t   unit_x,         \
-                                             pixman_fixed_t   max_vx,         \
-                                             pixman_bool_t    zero_src)       \
-{                                                                             \
-    if ((flags & SKIP_ZERO_SRC) && zero_src)                                  \
-        return;                                                               \
-    pixman_scaled_bilinear_scanline_##name##_##op##_asm_mips (                \
-                      dst, mask, src_top, src_bottom, wt, wb, vx, unit_x, w); \
-}                                                                             \
-                                                                              \
-FAST_BILINEAR_MAINLOOP_COMMON (mips_##name##_cover_##op,                      \
-                       scaled_bilinear_scanline_mips_##name##_##op,           \
-                       src_type, uint8_t, dst_type, COVER,                    \
-                       FLAG_HAVE_NON_SOLID_MASK)                              \
-FAST_BILINEAR_MAINLOOP_COMMON (mips_##name##_none_##op,                       \
-                       scaled_bilinear_scanline_mips_##name##_##op,           \
-                       src_type, uint8_t, dst_type, NONE,                     \
-                       FLAG_HAVE_NON_SOLID_MASK)                              \
-FAST_BILINEAR_MAINLOOP_COMMON (mips_##name##_pad_##op,                        \
-                       scaled_bilinear_scanline_mips_##name##_##op,           \
-                       src_type, uint8_t, dst_type, PAD,                      \
-                       FLAG_HAVE_NON_SOLID_MASK)                              \
-FAST_BILINEAR_MAINLOOP_COMMON (mips_##name##_normal_##op,                     \
-                       scaled_bilinear_scanline_mips_##name##_##op,           \
-                       src_type, uint8_t, dst_type, NORMAL,                   \
-                       FLAG_HAVE_NON_SOLID_MASK)
-
-#endif //PIXMAN_MIPS_DSPR2_H
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-mips-memcpy-asm.S
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- * Copyright (c) 2012
- *      MIPS Technologies, Inc., California.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its
- *    contributors may be used to endorse or promote products derived from
- *    this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "pixman-mips-dspr2-asm.h"
-
-/*
- * This routine could be optimized for MIPS64. The current code only
- * uses MIPS32 instructions.
- */
-
-#ifdef EB
-#  define LWHI	lwl		/* high part is left in big-endian */
-#  define SWHI	swl		/* high part is left in big-endian */
-#  define LWLO	lwr		/* low part is right in big-endian */
-#  define SWLO	swr		/* low part is right in big-endian */
-#else
-#  define LWHI	lwr		/* high part is right in little-endian */
-#  define SWHI	swr		/* high part is right in little-endian */
-#  define LWLO	lwl		/* low part is left in big-endian */
-#  define SWLO	swl		/* low part is left in big-endian */
-#endif
-
-LEAF_MIPS32R2(pixman_mips_fast_memcpy)
-
-	slti	AT, a2, 8
-	bne	AT, zero, $last8
-	move	v0, a0	/* memcpy returns the dst pointer */
-
-/* Test if the src and dst are word-aligned, or can be made word-aligned */
-	xor	t8, a1, a0
-	andi	t8, t8, 0x3		/* t8 is a0/a1 word-displacement */
-
-	bne	t8, zero, $unaligned
-	negu	a3, a0
-
-	andi	a3, a3, 0x3	/* we need to copy a3 bytes to make a0/a1 aligned */
-	beq	a3, zero, $chk16w	/* when a3=0 then the dst (a0) is word-aligned */
-	subu	a2, a2, a3	/* now a2 is the remining bytes count */
-
-	LWHI	t8, 0(a1)
-	addu	a1, a1, a3
-	SWHI	t8, 0(a0)
-	addu	a0, a0, a3
-
-/* Now the dst/src are mutually word-aligned with word-aligned addresses */
-$chk16w:	andi	t8, a2, 0x3f	/* any whole 64-byte chunks? */
-				/* t8 is the byte count after 64-byte chunks */
-
-	beq	a2, t8, $chk8w	/* if a2==t8, no 64-byte chunks */
-				/* There will be at most 1 32-byte chunk after it */
-	subu	a3, a2, t8	/* subtract from a2 the reminder */
-                                /* Here a3 counts bytes in 16w chunks */
-	addu	a3, a0, a3	/* Now a3 is the final dst after 64-byte chunks */
-
-	addu	t0, a0, a2	/* t0 is the "past the end" address */
-
-/*
- * When in the loop we exercise "pref 30, x(a0)", the a0+x should not be past
- * the "t0-32" address
- * This means: for x=128 the last "safe" a0 address is "t0-160"
- * Alternatively, for x=64 the last "safe" a0 address is "t0-96"
- * In the current version we use "pref 30, 128(a0)", so "t0-160" is the limit
- */
-	subu	t9, t0, 160	/* t9 is the "last safe pref 30, 128(a0)" address */
-
-	pref    0, 0(a1)		/* bring the first line of src, addr 0 */
-	pref    0, 32(a1)	/* bring the second line of src, addr 32 */
-	pref    0, 64(a1)	/* bring the third line of src, addr 64 */
-	pref	30, 32(a0)	/* safe, as we have at least 64 bytes ahead */
-/* In case the a0 > t9 don't use "pref 30" at all */
-	sgtu	v1, a0, t9
-	bgtz	v1, $loop16w	/* skip "pref 30, 64(a0)" for too short arrays */
-	nop
-/* otherwise, start with using pref30 */
-	pref	30, 64(a0)
-$loop16w:
-	pref	0, 96(a1)
-	lw	t0, 0(a1)
-	bgtz	v1, $skip_pref30_96	/* skip "pref 30, 96(a0)" */
-	lw	t1, 4(a1)
-	pref    30, 96(a0)   /* continue setting up the dest, addr 96 */
-$skip_pref30_96:
-	lw	t2, 8(a1)
-	lw	t3, 12(a1)
-	lw	t4, 16(a1)
-	lw	t5, 20(a1)
-	lw	t6, 24(a1)
-	lw	t7, 28(a1)
-        pref    0, 128(a1)    /* bring the next lines of src, addr 128 */
-
-	sw	t0, 0(a0)
-	sw	t1, 4(a0)
-	sw	t2, 8(a0)
-	sw	t3, 12(a0)
-	sw	t4, 16(a0)
-	sw	t5, 20(a0)
-	sw	t6, 24(a0)
-	sw	t7, 28(a0)
-
-	lw	t0, 32(a1)
-	bgtz	v1, $skip_pref30_128	/* skip "pref 30, 128(a0)" */
-	lw	t1, 36(a1)
-	pref    30, 128(a0)   /* continue setting up the dest, addr 128 */
-$skip_pref30_128:
-	lw	t2, 40(a1)
-	lw	t3, 44(a1)
-	lw	t4, 48(a1)
-	lw	t5, 52(a1)
-	lw	t6, 56(a1)
-	lw	t7, 60(a1)
-        pref    0, 160(a1)    /* bring the next lines of src, addr 160 */
-
-	sw	t0, 32(a0)
-	sw	t1, 36(a0)
-	sw	t2, 40(a0)
-	sw	t3, 44(a0)
-	sw	t4, 48(a0)
-	sw	t5, 52(a0)
-	sw	t6, 56(a0)
-	sw	t7, 60(a0)
-
-	addiu	a0, a0, 64	/* adding 64 to dest */
-	sgtu	v1, a0, t9
-	bne	a0, a3, $loop16w
-	addiu	a1, a1, 64	/* adding 64 to src */
-	move	a2, t8
-
-/* Here we have src and dest word-aligned but less than 64-bytes to go */
-
-$chk8w:
-	pref 0, 0x0(a1)
-	andi	t8, a2, 0x1f	/* is there a 32-byte chunk? */
-				/* the t8 is the reminder count past 32-bytes */
-	beq	a2, t8, $chk1w	/* when a2=t8, no 32-byte chunk */
-	 nop
-
-	lw	t0, 0(a1)
-	lw	t1, 4(a1)
-	lw	t2, 8(a1)
-	lw	t3, 12(a1)
-	lw	t4, 16(a1)
-	lw	t5, 20(a1)
-	lw	t6, 24(a1)
-	lw	t7, 28(a1)
-	addiu	a1, a1, 32
-
-	sw	t0, 0(a0)
-	sw	t1, 4(a0)
-	sw	t2, 8(a0)
-	sw	t3, 12(a0)
-	sw	t4, 16(a0)
-	sw	t5, 20(a0)
-	sw	t6, 24(a0)
-	sw	t7, 28(a0)
-	addiu	a0, a0, 32
-
-$chk1w:
-	andi	a2, t8, 0x3	/* now a2 is the reminder past 1w chunks */
-	beq	a2, t8, $last8
-	subu	a3, t8, a2	/* a3 is count of bytes in 1w chunks */
-	addu	a3, a0, a3	/* now a3 is the dst address past the 1w chunks */
-
-/* copying in words (4-byte chunks) */
-$wordCopy_loop:
-	lw	t3, 0(a1)	/* the first t3 may be equal t0 ... optimize? */
-	addiu	a1, a1, 4
-	addiu	a0, a0, 4
-	bne	a0, a3, $wordCopy_loop
-	sw	t3, -4(a0)
-
-/* For the last (<8) bytes */
-$last8:
-	blez	a2, leave
-	addu	a3, a0, a2	/* a3 is the last dst address */
-$last8loop:
-	lb	v1, 0(a1)
-	addiu	a1, a1, 1
-	addiu	a0, a0, 1
-	bne	a0, a3, $last8loop
-	sb	v1, -1(a0)
-
-leave:	j	ra
-	nop
-
-/*
- * UNALIGNED case
- */
-
-$unaligned:
-	/* got here with a3="negu a0" */
-	andi	a3, a3, 0x3	/* test if the a0 is word aligned */
-	beqz	a3, $ua_chk16w
-	subu	a2, a2, a3	/* bytes left after initial a3 bytes */
-
-	LWHI	v1, 0(a1)
-	LWLO	v1, 3(a1)
-	addu	a1, a1, a3	/* a3 may be here 1, 2 or 3 */
-	SWHI	v1, 0(a0)
-	addu	a0, a0, a3	/* below the dst will be word aligned (NOTE1) */
-
-$ua_chk16w:	andi	t8, a2, 0x3f	/* any whole 64-byte chunks? */
-				/* t8 is the byte count after 64-byte chunks */
-	beq	a2, t8, $ua_chk8w	/* if a2==t8, no 64-byte chunks */
-				/* There will be at most 1 32-byte chunk after it */
-	subu	a3, a2, t8	/* subtract from a2 the reminder */
-                                /* Here a3 counts bytes in 16w chunks */
-	addu	a3, a0, a3	/* Now a3 is the final dst after 64-byte chunks */
-
-	addu	t0, a0, a2	/* t0 is the "past the end" address */
-
-	subu	t9, t0, 160	/* t9 is the "last safe pref 30, 128(a0)" address */
-
-	pref    0, 0(a1)		/* bring the first line of src, addr 0 */
-	pref    0, 32(a1)	/* bring the second line of src, addr 32 */
-	pref    0, 64(a1)	/* bring the third line of src, addr 64 */
-	pref	30, 32(a0)	/* safe, as we have at least 64 bytes ahead */
-/* In case the a0 > t9 don't use "pref 30" at all */
-	sgtu	v1, a0, t9
-	bgtz	v1, $ua_loop16w	/* skip "pref 30, 64(a0)" for too short arrays */
-	nop
-/* otherwise,  start with using pref30 */
-	pref	30, 64(a0)
-$ua_loop16w:
-	pref	0, 96(a1)
-	LWHI	t0, 0(a1)
-	LWLO	t0, 3(a1)
-	LWHI	t1, 4(a1)
-	bgtz	v1, $ua_skip_pref30_96
-	LWLO	t1, 7(a1)
-	pref    30, 96(a0)   /* continue setting up the dest, addr 96 */
-$ua_skip_pref30_96:
-	LWHI	t2, 8(a1)
-	LWLO	t2, 11(a1)
-	LWHI	t3, 12(a1)
-	LWLO	t3, 15(a1)
-	LWHI	t4, 16(a1)
-	LWLO	t4, 19(a1)
-	LWHI	t5, 20(a1)
-	LWLO	t5, 23(a1)
-	LWHI	t6, 24(a1)
-	LWLO	t6, 27(a1)
-	LWHI	t7, 28(a1)
-	LWLO	t7, 31(a1)
-        pref    0, 128(a1)    /* bring the next lines of src, addr 128 */
-
-	sw	t0, 0(a0)
-	sw	t1, 4(a0)
-	sw	t2, 8(a0)
-	sw	t3, 12(a0)
-	sw	t4, 16(a0)
-	sw	t5, 20(a0)
-	sw	t6, 24(a0)
-	sw	t7, 28(a0)
-
-	LWHI	t0, 32(a1)
-	LWLO	t0, 35(a1)
-	LWHI	t1, 36(a1)
-	bgtz	v1, $ua_skip_pref30_128
-	LWLO	t1, 39(a1)
-	pref    30, 128(a0)   /* continue setting up the dest, addr 128 */
-$ua_skip_pref30_128:
-	LWHI	t2, 40(a1)
-	LWLO	t2, 43(a1)
-	LWHI	t3, 44(a1)
-	LWLO	t3, 47(a1)
-	LWHI	t4, 48(a1)
-	LWLO	t4, 51(a1)
-	LWHI	t5, 52(a1)
-	LWLO	t5, 55(a1)
-	LWHI	t6, 56(a1)
-	LWLO	t6, 59(a1)
-	LWHI	t7, 60(a1)
-	LWLO	t7, 63(a1)
-        pref    0, 160(a1)    /* bring the next lines of src, addr 160 */
-
-	sw	t0, 32(a0)
-	sw	t1, 36(a0)
-	sw	t2, 40(a0)
-	sw	t3, 44(a0)
-	sw	t4, 48(a0)
-	sw	t5, 52(a0)
-	sw	t6, 56(a0)
-	sw	t7, 60(a0)
-
-	addiu	a0, a0, 64	/* adding 64 to dest */
-	sgtu	v1, a0, t9
-	bne	a0, a3, $ua_loop16w
-	addiu	a1, a1, 64	/* adding 64 to src */
-	move	a2, t8
-
-/* Here we have src and dest word-aligned but less than 64-bytes to go */
-
-$ua_chk8w:
-	pref 0, 0x0(a1)
-	andi	t8, a2, 0x1f	/* is there a 32-byte chunk? */
-				/* the t8 is the reminder count */
-	beq	a2, t8, $ua_chk1w	/* when a2=t8, no 32-byte chunk */
-
-	LWHI	t0, 0(a1)
-	LWLO	t0, 3(a1)
-	LWHI	t1, 4(a1)
-	LWLO	t1, 7(a1)
-	LWHI	t2, 8(a1)
-	LWLO	t2, 11(a1)
-	LWHI	t3, 12(a1)
-	LWLO	t3, 15(a1)
-	LWHI	t4, 16(a1)
-	LWLO	t4, 19(a1)
-	LWHI	t5, 20(a1)
-	LWLO	t5, 23(a1)
-	LWHI	t6, 24(a1)
-	LWLO	t6, 27(a1)
-	LWHI	t7, 28(a1)
-	LWLO	t7, 31(a1)
-	addiu	a1, a1, 32
-
-	sw	t0, 0(a0)
-	sw	t1, 4(a0)
-	sw	t2, 8(a0)
-	sw	t3, 12(a0)
-	sw	t4, 16(a0)
-	sw	t5, 20(a0)
-	sw	t6, 24(a0)
-	sw	t7, 28(a0)
-	addiu	a0, a0, 32
-
-$ua_chk1w:
-	andi	a2, t8, 0x3	/* now a2 is the reminder past 1w chunks */
-	beq	a2, t8, $ua_smallCopy
-	subu	a3, t8, a2	/* a3 is count of bytes in 1w chunks */
-	addu	a3, a0, a3	/* now a3 is the dst address past the 1w chunks */
-
-/* copying in words (4-byte chunks) */
-$ua_wordCopy_loop:
-	LWHI	v1, 0(a1)
-	LWLO	v1, 3(a1)
-	addiu	a1, a1, 4
-	addiu	a0, a0, 4		/* note: dst=a0 is word aligned here, see NOTE1 */
-	bne	a0, a3, $ua_wordCopy_loop
-	sw	v1, -4(a0)
-
-/* Now less than 4 bytes (value in a2) left to copy */
-$ua_smallCopy:
-	beqz	a2, leave
-	addu	a3, a0, a2	/* a3 is the last dst address */
-$ua_smallCopy_loop:
-	lb	v1, 0(a1)
-	addiu	a1, a1, 1
-	addiu	a0, a0, 1
-	bne	a0, a3, $ua_smallCopy_loop
-	sb	v1, -1(a0)
-
-	j	ra
-	nop
-
-END(pixman_mips_fast_memcpy)
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-mips.c
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright © 2000 SuSE, Inc.
- * Copyright © 2007 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 SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  SuSE makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "pixman-private.h"
-
-#if defined(USE_MIPS_DSPR2) || defined(USE_LOONGSON_MMI)
-
-#include <string.h>
-#include <stdlib.h>
-
-static pixman_bool_t
-have_feature (const char *search_string)
-{
-#if defined (__linux__) /* linux ELF */
-    /* Simple detection of MIPS features at runtime for Linux.
-     * It is based on /proc/cpuinfo, which reveals hardware configuration
-     * to user-space applications.  According to MIPS (early 2010), no similar
-     * facility is universally available on the MIPS architectures, so it's up
-     * to individual OSes to provide such.
-     */
-    const char *file_name = "/proc/cpuinfo";
-    char cpuinfo_line[256];
-    FILE *f = NULL;
-
-    if ((f = fopen (file_name, "r")) == NULL)
-        return FALSE;
-
-    while (fgets (cpuinfo_line, sizeof (cpuinfo_line), f) != NULL)
-    {
-        if (strstr (cpuinfo_line, search_string) != NULL)
-        {
-            fclose (f);
-            return TRUE;
-        }
-    }
-
-    fclose (f);
-#endif
-
-    /* Did not find string in the proc file, or not Linux ELF. */
-    return FALSE;
-}
-
-#endif
-
-pixman_implementation_t *
-_pixman_mips_get_implementations (pixman_implementation_t *imp)
-{
-#ifdef USE_LOONGSON_MMI
-    /* I really don't know if some Loongson CPUs don't have MMI. */
-    if (!_pixman_disabled ("loongson-mmi") && have_feature ("Loongson"))
-	imp = _pixman_implementation_create_mmx (imp);
-#endif
-
-#ifdef USE_MIPS_DSPR2
-    /* Only currently available MIPS core that supports DSPr2 is 74K. */
-    if (!_pixman_disabled ("mips-dspr2") && have_feature ("MIPS 74K"))
-	imp = _pixman_implementation_create_mips_dspr2 (imp);
-#endif
-
-    return imp;
-}
--- a/gfx/cairo/libpixman/src/pixman-mmx.c
+++ b/gfx/cairo/libpixman/src/pixman-mmx.c
@@ -28,26 +28,21 @@
  *
  * Based on work by Owen Taylor
  */
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 
-#if defined USE_X86_MMX || defined USE_ARM_IWMMXT || defined USE_LOONGSON_MMI
-
-#ifdef USE_LOONGSON_MMI
-#include <loongson-mmintrin.h>
-#else
+#if defined USE_X86_MMX || defined USE_ARM_IWMMXT
+
 #include <mmintrin.h>
-#endif
 #include "pixman-private.h"
 #include "pixman-combine32.h"
-#include "pixman-inlines.h"
 
 #define no_vERBOSE
 
 #ifdef VERBOSE
 #define CHECKPOINT() error_f ("at %s %d\n", __FUNCTION__, __LINE__)
 #else
 #define CHECKPOINT()
 #endif
@@ -63,29 +58,16 @@ extern __inline void __attribute__((__gn
 
 #ifdef USE_X86_MMX
 # if (defined(__SUNPRO_C) || defined(_MSC_VER))
 #  include <xmmintrin.h>
 # else
 /* We have to compile with -msse to use xmmintrin.h, but that causes SSE
  * instructions to be generated that we don't want. Just duplicate the
  * functions we want to use.  */
-extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
-_mm_movemask_pi8 (__m64 __A)
-{
-    int ret;
-
-    asm ("pmovmskb %1, %0\n\t"
-	: "=r" (ret)
-	: "y" (__A)
-    );
-
-    return ret;
-}
-
 extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
 _mm_mulhi_pu16 (__m64 __A, __m64 __B)
 {
     asm ("pmulhuw %1, %0\n\t"
 	: "+y" (__A)
 	: "y" (__B)
     );
     return __A;
@@ -100,27 +82,18 @@ extern __inline __m64 __attribute__((__g
     asm ("pshufw %2, %1, %0\n\t"
 	: "=y" (ret)
 	: "y" (__A), "K" (__N)
     );
 
     return ret;
 }
 #  else
-#   define _mm_shuffle_pi16(A, N)					\
-    ({									\
-	__m64 ret;							\
-									\
-	asm ("pshufw %2, %1, %0\n\t"					\
-	     : "=y" (ret)						\
-	     : "y" (A), "K" ((const int8_t)N)				\
-	);								\
-									\
-	ret;								\
-    })
+#   define _mm_shuffle_pi16(A, N) \
+    ((__m64) __builtin_ia32_pshufw ((__v4hi)(__m64)(A), (int)(N)))
 #  endif
 # endif
 #endif
 
 #ifndef _MSC_VER
 #define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \
  (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0))
 #endif
@@ -147,24 +120,21 @@ extern __inline __m64 __attribute__((__g
 /* --------------- MMX primitives ------------------------------------- */
 
 /* If __m64 is defined as a struct or union, then define M64_MEMBER to be
  * the name of the member used to access the data.
  * If __m64 requires using mm_cvt* intrinsics functions to convert between
  * uint64_t and __m64 values, then define USE_CVT_INTRINSICS.
  * If __m64 and uint64_t values can just be cast to each other directly,
  * then define USE_M64_CASTS.
- * If __m64 is a double datatype, then define USE_M64_DOUBLE.
  */
 #ifdef _MSC_VER
 # define M64_MEMBER m64_u64
 #elif defined(__ICC)
 # define USE_CVT_INTRINSICS
-#elif defined(USE_LOONGSON_MMI)
-# define USE_M64_DOUBLE
 #elif defined(__GNUC__)
 # define USE_M64_CASTS
 #elif defined(__SUNPRO_C)
 # if (__SUNPRO_C >= 0x5120) && !defined(__NOVECTORSIZE__)
 /* Solaris Studio 12.3 (Sun C 5.12) introduces __attribute__(__vector_size__)
  * support, and defaults to using it to define __m64, unless __NOVECTORSIZE__
  * is defined.   If it is used, then the mm_cvt* intrinsics must be used.
  */
@@ -172,119 +142,95 @@ extern __inline __m64 __attribute__((__g
 # else
 /* For Studio 12.2 or older, or when __attribute__(__vector_size__) is
  * disabled, __m64 is defined as a struct containing "unsigned long long l_".
  */
 #  define M64_MEMBER l_
 # endif
 #endif
 
-#if defined(USE_M64_CASTS) || defined(USE_CVT_INTRINSICS) || defined(USE_M64_DOUBLE)
+#if defined(USE_M64_CASTS) || defined(USE_CVT_INTRINSICS)
 typedef uint64_t mmxdatafield;
 #else
 typedef __m64 mmxdatafield;
 #endif
 
 typedef struct
 {
     mmxdatafield mmx_4x00ff;
     mmxdatafield mmx_4x0080;
     mmxdatafield mmx_565_rgb;
     mmxdatafield mmx_565_unpack_multiplier;
-    mmxdatafield mmx_565_pack_multiplier;
     mmxdatafield mmx_565_r;
     mmxdatafield mmx_565_g;
     mmxdatafield mmx_565_b;
-    mmxdatafield mmx_packed_565_rb;
-    mmxdatafield mmx_packed_565_g;
-    mmxdatafield mmx_expand_565_g;
-    mmxdatafield mmx_expand_565_b;
-    mmxdatafield mmx_expand_565_r;
-#ifndef USE_LOONGSON_MMI
     mmxdatafield mmx_mask_0;
     mmxdatafield mmx_mask_1;
     mmxdatafield mmx_mask_2;
     mmxdatafield mmx_mask_3;
-#endif
     mmxdatafield mmx_full_alpha;
     mmxdatafield mmx_4x0101;
-    mmxdatafield mmx_ff000000;
 } mmx_data_t;
 
 #if defined(_MSC_VER)
 # define MMXDATA_INIT(field, val) { val ## UI64 }
 #elif defined(M64_MEMBER)       /* __m64 is a struct, not an integral type */
 # define MMXDATA_INIT(field, val) field =   { val ## ULL }
 #else                           /* mmxdatafield is an integral type */
 # define MMXDATA_INIT(field, val) field =   val ## ULL
 #endif
 
 static const mmx_data_t c =
 {
     MMXDATA_INIT (.mmx_4x00ff,                   0x00ff00ff00ff00ff),
     MMXDATA_INIT (.mmx_4x0080,                   0x0080008000800080),
     MMXDATA_INIT (.mmx_565_rgb,                  0x000001f0003f001f),
     MMXDATA_INIT (.mmx_565_unpack_multiplier,    0x0000008404100840),
-    MMXDATA_INIT (.mmx_565_pack_multiplier,      0x2000000420000004),
     MMXDATA_INIT (.mmx_565_r,                    0x000000f800000000),
     MMXDATA_INIT (.mmx_565_g,                    0x0000000000fc0000),
     MMXDATA_INIT (.mmx_565_b,                    0x00000000000000f8),
-    MMXDATA_INIT (.mmx_packed_565_rb,            0x00f800f800f800f8),
-    MMXDATA_INIT (.mmx_packed_565_g,             0x0000fc000000fc00),
-    MMXDATA_INIT (.mmx_expand_565_g,             0x07e007e007e007e0),
-    MMXDATA_INIT (.mmx_expand_565_b,             0x001f001f001f001f),
-    MMXDATA_INIT (.mmx_expand_565_r,             0xf800f800f800f800),
-#ifndef USE_LOONGSON_MMI
     MMXDATA_INIT (.mmx_mask_0,                   0xffffffffffff0000),
     MMXDATA_INIT (.mmx_mask_1,                   0xffffffff0000ffff),
     MMXDATA_INIT (.mmx_mask_2,                   0xffff0000ffffffff),
     MMXDATA_INIT (.mmx_mask_3,                   0x0000ffffffffffff),
-#endif
     MMXDATA_INIT (.mmx_full_alpha,               0x00ff000000000000),
     MMXDATA_INIT (.mmx_4x0101,                   0x0101010101010101),
-    MMXDATA_INIT (.mmx_ff000000,                 0xff000000ff000000),
 };
 
 #ifdef USE_CVT_INTRINSICS
 #    define MC(x) to_m64 (c.mmx_ ## x)
 #elif defined(USE_M64_CASTS)
 #    define MC(x) ((__m64)c.mmx_ ## x)
-#elif defined(USE_M64_DOUBLE)
-#    define MC(x) (*(__m64 *)&c.mmx_ ## x)
 #else
 #    define MC(x) c.mmx_ ## x
 #endif
 
 static force_inline __m64
 to_m64 (uint64_t x)
 {
 #ifdef USE_CVT_INTRINSICS
     return _mm_cvtsi64_m64 (x);
 #elif defined M64_MEMBER        /* __m64 is a struct, not an integral type */
     __m64 res;
 
     res.M64_MEMBER = x;
     return res;
-#elif defined USE_M64_DOUBLE
-    return *(__m64 *)&x;
 #else /* USE_M64_CASTS */
     return (__m64)x;
 #endif
 }
 
 static force_inline uint64_t
 to_uint64 (__m64 x)
 {
 #ifdef USE_CVT_INTRINSICS
     return _mm_cvtm64_si64 (x);
 #elif defined M64_MEMBER        /* __m64 is a struct, not an integral type */
     uint64_t res = x.M64_MEMBER;
     return res;
-#elif defined USE_M64_DOUBLE
-    return *(uint64_t *)&x;
 #else /* USE_M64_CASTS */
     return (uint64_t)x;
 #endif
 }
 
 static force_inline __m64
 shift (__m64 v,
        int   s)
@@ -373,30 +319,30 @@ in_over (__m64 src, __m64 srca, __m64 ma
 
 #define in_over(src, srca, mask, dest)					\
     over (in (src, mask), pix_multiply (srca, mask), dest)
 
 #endif
 
 /* Elemental unaligned loads */
 
-static force_inline __m64 ldq_u(__m64 *p)
+static force_inline __m64 ldq_u(uint64_t *p)
 {
 #ifdef USE_X86_MMX
     /* x86's alignment restrictions are very relaxed. */
     return *(__m64 *)p;
 #elif defined USE_ARM_IWMMXT
     int align = (uintptr_t)p & 7;
     __m64 *aligned_p;
     if (align == 0)
 	return *p;
     aligned_p = (__m64 *)((uintptr_t)p & ~7);
     return (__m64) _mm_align_si64 (aligned_p[0], aligned_p[1], align);
 #else
-    struct __una_u64 { __m64 x __attribute__((packed)); };
+    struct __una_u64 { uint64_t x __attribute__((packed)); };
     const struct __una_u64 *ptr = (const struct __una_u64 *) p;
     return (__m64) ptr->x;
 #endif
 }
 
 static force_inline uint32_t ldl_u(const uint32_t *p)
 {
 #ifdef USE_X86_MMX
@@ -405,100 +351,39 @@ static force_inline uint32_t ldl_u(const
 #else
     struct __una_u32 { uint32_t x __attribute__((packed)); };
     const struct __una_u32 *ptr = (const struct __una_u32 *) p;
     return ptr->x;
 #endif
 }
 
 static force_inline __m64
-load (const uint32_t *v)
-{
-#ifdef USE_LOONGSON_MMI
-    __m64 ret;
-    asm ("lwc1 %0, %1\n\t"
-	: "=f" (ret)
-	: "m" (*v)
-    );
-    return ret;
-#else
-    return _mm_cvtsi32_si64 (*v);
-#endif
-}
-
-static force_inline __m64
 load8888 (const uint32_t *v)
 {
-#ifdef USE_LOONGSON_MMI
-    return _mm_unpacklo_pi8_f (*(__m32 *)v, _mm_setzero_si64 ());
-#else
-    return _mm_unpacklo_pi8 (load (v), _mm_setzero_si64 ());
-#endif
+    return _mm_unpacklo_pi8 (_mm_cvtsi32_si64 (*v), _mm_setzero_si64 ());
 }
 
 static force_inline __m64
 load8888u (const uint32_t *v)
 {
-    uint32_t l = ldl_u (v);
-    return load8888 (&l);
+    uint32_t l = ldl_u(v);
+    return load8888(&l);
 }
 
 static force_inline __m64
 pack8888 (__m64 lo, __m64 hi)
 {
     return _mm_packs_pu16 (lo, hi);
 }
 
 static force_inline void
-store (uint32_t *dest, __m64 v)
-{
-#ifdef USE_LOONGSON_MMI
-    asm ("swc1 %1, %0\n\t"
-	: "=m" (*dest)
-	: "f" (v)
-	: "memory"
-    );
-#else
-    *dest = _mm_cvtsi64_si32 (v);
-#endif
-}
-
-static force_inline void
 store8888 (uint32_t *dest, __m64 v)
 {
-    v = pack8888 (v, _mm_setzero_si64 ());
-    store (dest, v);
-}
-
-static force_inline pixman_bool_t
-is_equal (__m64 a, __m64 b)
-{
-#ifdef USE_LOONGSON_MMI
-    /* __m64 is double, we can compare directly. */
-    return a == b;
-#else
-    return _mm_movemask_pi8 (_mm_cmpeq_pi8 (a, b)) == 0xff;
-#endif
-}
-
-static force_inline pixman_bool_t
-is_opaque (__m64 v)
-{
-#ifdef USE_LOONGSON_MMI
-    return is_equal (_mm_and_si64 (v, MC (full_alpha)), MC (full_alpha));
-#else
-    __m64 ffs = _mm_cmpeq_pi8 (v, v);
-    return (_mm_movemask_pi8 (_mm_cmpeq_pi8 (v, ffs)) & 0x40);
-#endif
-}
-
-static force_inline pixman_bool_t
-is_zero (__m64 v)
-{
-    return is_equal (v, _mm_setzero_si64 ());
+    v = pack8888 (v, _mm_setzero_si64());
+    *dest = _mm_cvtsi64_si32 (v);
 }
 
 /* Expand 16 bits positioned at @pos (0-3) of a mmx register into
  *
  *    00RR00GG00BB
  *
  * --- Expanding 565 in the low word ---
  *
@@ -512,109 +397,55 @@ is_zero (__m64 v)
  */
 static force_inline __m64
 expand565 (__m64 pixel, int pos)
 {
     __m64 p = pixel;
     __m64 t1, t2;
 
     /* move pixel to low 16 bit and zero the rest */
-#ifdef USE_LOONGSON_MMI
-    p = loongson_extract_pi16 (p, pos);
-#else
     p = shift (shift (p, (3 - pos) * 16), -48);
-#endif
 
     t1 = shift (p, 36 - 11);
     t2 = shift (p, 16 - 5);
 
     p = _mm_or_si64 (t1, p);
     p = _mm_or_si64 (t2, p);
     p = _mm_and_si64 (p, MC (565_rgb));
 
     pixel = _mm_mullo_pi16 (p, MC (565_unpack_multiplier));
     return _mm_srli_pi16 (pixel, 8);
 }
 
-/* Expand 4 16 bit pixels in an mmx register into two mmx registers of
- *
- *    AARRGGBBRRGGBB
- */
-static force_inline void
-expand_4xpacked565 (__m64 vin, __m64 *vout0, __m64 *vout1, int full_alpha)
-{
-    __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));
-    if (full_alpha)
-	alpha = _mm_cmpeq_pi32 (alpha, alpha);
-
-    /* Replicate high bits into empty low bits. */
-    r = _mm_or_si64 (_mm_srli_pi16 (r, 8), _mm_srli_pi16 (r, 13));
-    g = _mm_or_si64 (_mm_srli_pi16 (g, 3), _mm_srli_pi16 (g, 9));
-    b = _mm_or_si64 (_mm_slli_pi16 (b, 3), _mm_srli_pi16 (b, 2));
-
-    r = _mm_packs_pu16 (r, _mm_setzero_si64 ());	/* 00 00 00 00 R3 R2 R1 R0 */
-    g = _mm_packs_pu16 (g, _mm_setzero_si64 ());	/* 00 00 00 00 G3 G2 G1 G0 */
-    b = _mm_packs_pu16 (b, _mm_setzero_si64 ());	/* 00 00 00 00 B3 B2 B1 B0 */
-
-    t1 = _mm_unpacklo_pi8 (r, alpha);			/* A3 R3 A2 R2 A1 R1 A0 R0 */
-    t0 = _mm_unpacklo_pi8 (b, g);			/* G3 B3 G2 B2 G1 B1 G0 B0 */
-
-    *vout0 = _mm_unpacklo_pi16 (t0, t1);		/* A1 R1 G1 B1 A0 R0 G0 B0 */
-    *vout1 = _mm_unpackhi_pi16 (t0, t1);		/* A3 R3 G3 B3 A2 R2 G2 B2 */
-}
-
 static force_inline __m64
 expand8888 (__m64 in, int pos)
 {
     if (pos == 0)
 	return _mm_unpacklo_pi8 (in, _mm_setzero_si64 ());
     else
 	return _mm_unpackhi_pi8 (in, _mm_setzero_si64 ());
 }
 
 static force_inline __m64
 expandx888 (__m64 in, int pos)
 {
     return _mm_or_si64 (expand8888 (in, pos), MC (full_alpha));
 }
 
-static force_inline void
-expand_4x565 (__m64 vin, __m64 *vout0, __m64 *vout1, __m64 *vout2, __m64 *vout3, int full_alpha)
-{
-    __m64 v0, v1;
-    expand_4xpacked565 (vin, &v0, &v1, full_alpha);
-    *vout0 = expand8888 (v0, 0);
-    *vout1 = expand8888 (v0, 1);
-    *vout2 = expand8888 (v1, 0);
-    *vout3 = expand8888 (v1, 1);
-}
-
 static force_inline __m64
 pack_565 (__m64 pixel, __m64 target, int pos)
 {
     __m64 p = pixel;
     __m64 t = target;
     __m64 r, g, b;
 
     r = _mm_and_si64 (p, MC (565_r));
     g = _mm_and_si64 (p, MC (565_g));
     b = _mm_and_si64 (p, MC (565_b));
 
-#ifdef USE_LOONGSON_MMI
-    r = shift (r, -(32 - 8));
-    g = shift (g, -(16 - 3));
-    b = shift (b, -(0  + 3));
-
-    p = _mm_or_si64 (r, g);
-    p = _mm_or_si64 (p, b);
-    return loongson_insert_pi16 (t, p, pos);
-#else
     r = shift (r, -(32 - 8) + pos * 16);
     g = shift (g, -(16 - 3) + pos * 16);
     b = shift (b, -(0  + 3) + pos * 16);
 
     if (pos == 0)
 	t = _mm_and_si64 (t, MC (mask_0));
     else if (pos == 1)
 	t = _mm_and_si64 (t, MC (mask_1));
@@ -622,133 +453,84 @@ pack_565 (__m64 pixel, __m64 target, int
 	t = _mm_and_si64 (t, MC (mask_2));
     else if (pos == 3)
 	t = _mm_and_si64 (t, MC (mask_3));
 
     p = _mm_or_si64 (r, t);
     p = _mm_or_si64 (g, p);
 
     return _mm_or_si64 (b, p);
-#endif
-}
-
-static force_inline __m64
-pack_4xpacked565 (__m64 a, __m64 b)
-{
-    __m64 rb0 = _mm_and_si64 (a, MC (packed_565_rb));
-    __m64 rb1 = _mm_and_si64 (b, MC (packed_565_rb));
-
-    __m64 t0 = _mm_madd_pi16 (rb0, MC (565_pack_multiplier));
-    __m64 t1 = _mm_madd_pi16 (rb1, MC (565_pack_multiplier));
-
-    __m64 g0 = _mm_and_si64 (a, MC (packed_565_g));
-    __m64 g1 = _mm_and_si64 (b, MC (packed_565_g));
-
-    t0 = _mm_or_si64 (t0, g0);
-    t1 = _mm_or_si64 (t1, g1);
-
-    t0 = shift(t0, -5);
-#ifdef USE_ARM_IWMMXT
-    t1 = shift(t1, -5);
-    return _mm_packs_pu32 (t0, t1);
-#else
-    t1 = shift(t1, -5 + 16);
-    return _mm_shuffle_pi16 (_mm_or_si64 (t0, t1), _MM_SHUFFLE (3, 1, 2, 0));
-#endif
 }
 
 #ifndef _MSC_VER
 
 static force_inline __m64
-pack_4x565 (__m64 v0, __m64 v1, __m64 v2, __m64 v3)
-{
-    return pack_4xpacked565 (pack8888 (v0, v1), pack8888 (v2, v3));
-}
-
-static force_inline __m64
 pix_add_mul (__m64 x, __m64 a, __m64 y, __m64 b)
 {
     x = pix_multiply (x, a);
     y = pix_multiply (y, b);
 
     return pix_add (x, y);
 }
 
 #else
 
-/* MSVC only handles a "pass by register" of up to three SSE intrinsics */
-
-#define pack_4x565(v0, v1, v2, v3) \
-    pack_4xpacked565 (pack8888 (v0, v1), pack8888 (v2, v3))
-
 #define pix_add_mul(x, a, y, b)	 \
     ( x = pix_multiply (x, a),	 \
       y = pix_multiply (y, b),	 \
       pix_add (x, y) )
 
 #endif
 
 /* --------------- MMX code patch for fbcompose.c --------------------- */
 
-static force_inline __m64
+static force_inline uint32_t
 combine (const uint32_t *src, const uint32_t *mask)
 {
-    __m64 vsrc = load8888 (src);
+    uint32_t ssrc = *src;
 
     if (mask)
     {
 	__m64 m = load8888 (mask);
+	__m64 s = load8888 (&ssrc);
 
 	m = expand_alpha (m);
-	vsrc = pix_multiply (vsrc, m);
+	s = pix_multiply (s, m);
+
+	store8888 (&ssrc, s);
     }
 
-    return vsrc;
-}
-
-static force_inline __m64
-core_combine_over_u_pixel_mmx (__m64 vsrc, __m64 vdst)
-{
-    vsrc = _mm_unpacklo_pi8 (vsrc, _mm_setzero_si64 ());
-
-    if (is_opaque (vsrc))
-    {
-	return vsrc;
-    }
-    else if (!is_zero (vsrc))
-    {
-	return over (vsrc, expand_alpha (vsrc),
-		     _mm_unpacklo_pi8 (vdst, _mm_setzero_si64 ()));
-    }
-
-    return _mm_unpacklo_pi8 (vdst, _mm_setzero_si64 ());
+    return ssrc;
 }
 
 static void
 mmx_combine_over_u (pixman_implementation_t *imp,
                     pixman_op_t              op,
                     uint32_t *               dest,
                     const uint32_t *         src,
                     const uint32_t *         mask,
                     int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
-	__m64 vsrc = combine (src, mask);
-
-	if (is_opaque (vsrc))
+	uint32_t ssrc = combine (src, mask);
+	uint32_t a = ssrc >> 24;
+
+	if (a == 0xff)
 	{
-	    store8888 (dest, vsrc);
+	    *dest = ssrc;
 	}
-	else if (!is_zero (vsrc))
+	else if (ssrc)
 	{
-	    __m64 sa = expand_alpha (vsrc);
-	    store8888 (dest, over (vsrc, sa, load8888 (dest)));
+	    __m64 s, sa;
+	    s = load8888 (&ssrc);
+	    sa = expand_alpha (s);
+	    store8888 (dest, over (s, sa, load8888 (dest)));
 	}
 
 	++dest;
 	++src;
 	if (mask)
 	    ++mask;
     }
     _mm_empty ();
@@ -762,21 +544,21 @@ mmx_combine_over_reverse_u (pixman_imple
                             const uint32_t *         mask,
                             int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
 	__m64 d, da;
-	__m64 s = combine (src, mask);
+	uint32_t s = combine (src, mask);
 
 	d = load8888 (dest);
 	da = expand_alpha (d);
-	store8888 (dest, over (d, da, s));
+	store8888 (dest, over (d, da, load8888 (&s)));
 
 	++dest;
 	++src;
 	if (mask)
 	    mask++;
     }
     _mm_empty ();
 }
@@ -788,19 +570,20 @@ mmx_combine_in_u (pixman_implementation_
                   const uint32_t *         src,
                   const uint32_t *         mask,
                   int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
-	__m64 a;
-	__m64 x = combine (src, mask);
-
+	__m64 x, a;
+	uint32_t ssrc = combine (src, mask);
+
+	x = load8888 (&ssrc);
 	a = load8888 (dest);
 	a = expand_alpha (a);
 	x = pix_multiply (x, a);
 
 	store8888 (dest, x);
 
 	++dest;
 	++src;
@@ -817,20 +600,21 @@ mmx_combine_in_reverse_u (pixman_impleme
                           const uint32_t *         src,
                           const uint32_t *         mask,
                           int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
-	__m64 a = combine (src, mask);
-	__m64 x;
+	__m64 x, a;
+	uint32_t ssrc = combine (src, mask);
 
 	x = load8888 (dest);
+	a = load8888 (&ssrc);
 	a = expand_alpha (a);
 	x = pix_multiply (x, a);
 	store8888 (dest, x);
 
 	++dest;
 	++src;
 	if (mask)
 	    mask++;
@@ -845,19 +629,20 @@ mmx_combine_out_u (pixman_implementation
                    const uint32_t *         src,
                    const uint32_t *         mask,
                    int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
-	__m64 a;
-	__m64 x = combine (src, mask);
-
+	__m64 x, a;
+	uint32_t ssrc = combine (src, mask);
+
+	x = load8888 (&ssrc);
 	a = load8888 (dest);
 	a = expand_alpha (a);
 	a = negate (a);
 	x = pix_multiply (x, a);
 	store8888 (dest, x);
 
 	++dest;
 	++src;
@@ -874,20 +659,21 @@ mmx_combine_out_reverse_u (pixman_implem
                            const uint32_t *         src,
                            const uint32_t *         mask,
                            int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
-	__m64 a = combine (src, mask);
-	__m64 x;
+	__m64 x, a;
+	uint32_t ssrc = combine (src, mask);
 
 	x = load8888 (dest);
+	a = load8888 (&ssrc);
 	a = expand_alpha (a);
 	a = negate (a);
 	x = pix_multiply (x, a);
 
 	store8888 (dest, x);
 
 	++dest;
 	++src;
@@ -904,19 +690,20 @@ mmx_combine_atop_u (pixman_implementatio
                     const uint32_t *         src,
                     const uint32_t *         mask,
                     int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
-	__m64 da, d, sia;
-	__m64 s = combine (src, mask);
-
+	__m64 s, da, d, sia;
+	uint32_t ssrc = combine (src, mask);
+
+	s = load8888 (&ssrc);
 	d = load8888 (dest);
 	sia = expand_alpha (s);
 	sia = negate (sia);
 	da = expand_alpha (d);
 	s = pix_add_mul (s, da, d, sia);
 	store8888 (dest, s);
 
 	++dest;
@@ -936,19 +723,20 @@ mmx_combine_atop_reverse_u (pixman_imple
                             int                      width)
 {
     const uint32_t *end;
 
     end = dest + width;
 
     while (dest < end)
     {
-	__m64 dia, d, sa;
-	__m64 s = combine (src, mask);
-
+	__m64 s, dia, d, sa;
+	uint32_t ssrc = combine (src, mask);
+
+	s = load8888 (&ssrc);
 	d = load8888 (dest);
 	sa = expand_alpha (s);
 	dia = expand_alpha (d);
 	dia = negate (dia);
 	s = pix_add_mul (s, dia, d, sa);
 	store8888 (dest, s);
 
 	++dest;
@@ -966,19 +754,20 @@ mmx_combine_xor_u (pixman_implementation
                    const uint32_t *         src,
                    const uint32_t *         mask,
                    int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
-	__m64 dia, d, sia;
-	__m64 s = combine (src, mask);
-
+	__m64 s, dia, d, sia;
+	uint32_t ssrc = combine (src, mask);
+
+	s = load8888 (&ssrc);
 	d = load8888 (dest);
 	sia = expand_alpha (s);
 	dia = expand_alpha (d);
 	sia = negate (sia);
 	dia = negate (dia);
 	s = pix_add_mul (s, dia, d, sia);
 	store8888 (dest, s);
 
@@ -997,19 +786,20 @@ mmx_combine_add_u (pixman_implementation
                    const uint32_t *         src,
                    const uint32_t *         mask,
                    int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
-	__m64 d;
-	__m64 s = combine (src, mask);
-
+	__m64 s, d;
+	uint32_t ssrc = combine (src, mask);
+
+	s = load8888 (&ssrc);
 	d = load8888 (dest);
 	s = pix_add (s, d);
 	store8888 (dest, s);
 
 	++dest;
 	++src;
 	if (mask)
 	    mask++;
@@ -1024,24 +814,22 @@ mmx_combine_saturate_u (pixman_implement
                         const uint32_t *         src,
                         const uint32_t *         mask,
                         int                      width)
 {
     const uint32_t *end = dest + width;
 
     while (dest < end)
     {
-	uint32_t s, sa, da;
+	uint32_t s = combine (src, mask);
 	uint32_t d = *dest;
-	__m64 ms = combine (src, mask);
-	__m64 md = load8888 (dest);
-
-	store8888(&s, ms);
-	da = ~d >> 24;
-	sa = s >> 24;
+	__m64 ms = load8888 (&s);
+	__m64 md = load8888 (&d);
+	uint32_t sa = s >> 24;
+	uint32_t da = ~d >> 24;
 
 	if (sa > da)
 	{
 	    uint32_t quot = DIV_UN8 (da, sa) << 24;
 	    __m64 msa = load8888 (&quot);
 	    msa = expand_alpha (msa);
 	    ms = pix_multiply (ms, msa);
 	}
@@ -1477,27 +1265,26 @@ mmx_composite_over_n_0565 (pixman_implem
 	    *dst = to_uint64 (vdest);
 
 	    w--;
 	    dst++;
 	}
 
 	while (w >= 4)
 	{
-	    __m64 vdest = *(__m64 *)dst;
-	    __m64 v0, v1, v2, v3;
-
-	    expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
-
-	    v0 = over (vsrc, vsrca, v0);
-	    v1 = over (vsrc, vsrca, v1);
-	    v2 = over (vsrc, vsrca, v2);
-	    v3 = over (vsrc, vsrca, v3);
-
-	    *(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);
+	    __m64 vdest;
+
+	    vdest = *(__m64 *)dst;
+
+	    vdest = pack_565 (over (vsrc, vsrca, expand565 (vdest, 0)), vdest, 0);
+	    vdest = pack_565 (over (vsrc, vsrca, expand565 (vdest, 1)), vdest, 1);
+	    vdest = pack_565 (over (vsrc, vsrca, expand565 (vdest, 2)), vdest, 2);
+	    vdest = pack_565 (over (vsrc, vsrca, expand565 (vdest, 3)), vdest, 3);
+
+	    *(__m64 *)dst = vdest;
 
 	    dst += 4;
 	    w -= 4;
 	}
 
 	CHECKPOINT ();
 
 	while (w)
@@ -1622,17 +1409,19 @@ mmx_composite_over_8888_n_8888 (pixman_i
     int32_t w;
 
     CHECKPOINT ();
 
     PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint32_t, dst_stride, dst_line, 1);
     PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint32_t, src_stride, src_line, 1);
 
     mask = _pixman_image_get_solid (imp, mask_image, dest_image->bits.format);
-    vmask = expand_alpha (load8888 (&mask));
+    mask &= 0xff000000;
+    mask = mask | mask >> 8 | mask >> 16 | mask >> 24;
+    vmask = load8888 (&mask);
 
     while (height--)
     {
 	dst = dst_line;
 	dst_line += dst_stride;
 	src = src_line;
 	src_line += src_stride;
 	w = width;
@@ -1646,17 +1435,17 @@ mmx_composite_over_8888_n_8888 (pixman_i
 
 	    w--;
 	    dst++;
 	    src++;
 	}
 
 	while (w >= 2)
 	{
-	    __m64 vs = ldq_u ((__m64 *)src);
+	    __m64 vs = ldq_u((uint64_t *)src);
 	    __m64 vd = *(__m64 *)dst;
 	    __m64 vsrc0 = expand8888 (vs, 0);
 	    __m64 vsrc1 = expand8888 (vs, 1);
 
 	    *(__m64 *)dst = pack8888 (
 	        in_over (vsrc0, expand_alpha (vsrc0), vmask, expand8888 (vd, 0)),
 	        in_over (vsrc1, expand_alpha (vsrc1), vmask, expand8888 (vd, 1)));
 
@@ -1691,17 +1480,19 @@ mmx_composite_over_x888_n_8888 (pixman_i
     __m64 srca;
 
     CHECKPOINT ();
 
     PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint32_t, dst_stride, dst_line, 1);
     PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint32_t, src_stride, src_line, 1);
     mask = _pixman_image_get_solid (imp, mask_image, dest_image->bits.format);
 
-    vmask = expand_alpha (load8888 (&mask));
+    mask &= 0xff000000;
+    mask = mask | mask >> 8 | mask >> 16 | mask >> 24;
+    vmask = load8888 (&mask);
     srca = MC (4x00ff);
 
     while (height--)
     {
 	dst = dst_line;
 	dst_line += dst_stride;
 	src = src_line;
 	src_line += src_stride;
@@ -1726,24 +1517,24 @@ mmx_composite_over_x888_n_8888 (pixman_i
 	    __m64 vd1 = *(__m64 *)(dst + 2);
 	    __m64 vd2 = *(__m64 *)(dst + 4);
 	    __m64 vd3 = *(__m64 *)(dst + 6);
 	    __m64 vd4 = *(__m64 *)(dst + 8);
 	    __m64 vd5 = *(__m64 *)(dst + 10);
 	    __m64 vd6 = *(__m64 *)(dst + 12);
 	    __m64 vd7 = *(__m64 *)(dst + 14);
 
-	    __m64 vs0 = ldq_u ((__m64 *)(src + 0));
-	    __m64 vs1 = ldq_u ((__m64 *)(src + 2));
-	    __m64 vs2 = ldq_u ((__m64 *)(src + 4));
-	    __m64 vs3 = ldq_u ((__m64 *)(src + 6));
-	    __m64 vs4 = ldq_u ((__m64 *)(src + 8));
-	    __m64 vs5 = ldq_u ((__m64 *)(src + 10));
-	    __m64 vs6 = ldq_u ((__m64 *)(src + 12));
-	    __m64 vs7 = ldq_u ((__m64 *)(src + 14));
+	    __m64 vs0 = ldq_u((uint64_t *)(src + 0));
+	    __m64 vs1 = ldq_u((uint64_t *)(src + 2));
+	    __m64 vs2 = ldq_u((uint64_t *)(src + 4));
+	    __m64 vs3 = ldq_u((uint64_t *)(src + 6));
+	    __m64 vs4 = ldq_u((uint64_t *)(src + 8));
+	    __m64 vs5 = ldq_u((uint64_t *)(src + 10));
+	    __m64 vs6 = ldq_u((uint64_t *)(src + 12));
+	    __m64 vs7 = ldq_u((uint64_t *)(src + 14));
 
 	    vd0 = pack8888 (
 	        in_over (expandx888 (vs0, 0), srca, vmask, expand8888 (vd0, 0)),
 	        in_over (expandx888 (vs0, 1), srca, vmask, expand8888 (vd0, 1)));
 
 	    vd1 = pack8888 (
 	        in_over (expandx888 (vs1, 0), srca, vmask, expand8888 (vd1, 0)),
 	        in_over (expandx888 (vs1, 1), srca, vmask, expand8888 (vd1, 1)));
@@ -1896,32 +1687,32 @@ mmx_composite_over_8888_0565 (pixman_imp
 	    dst++;
 	    src++;
 	}
 
 	CHECKPOINT ();
 
 	while (w >= 4)
 	{
-	    __m64 vdest = *(__m64 *)dst;
-	    __m64 v0, v1, v2, v3;
-
-	    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));
-
-	    v0 = over (vsrc0, expand_alpha (vsrc0), v0);
-	    v1 = over (vsrc1, expand_alpha (vsrc1), v1);
-	    v2 = over (vsrc2, expand_alpha (vsrc2), v2);
-	    v3 = over (vsrc3, expand_alpha (vsrc3), v3);
-
-	    *(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);
+	    __m64 vsrc0, vsrc1, vsrc2, vsrc3;
+	    __m64 vdest;
+
+	    vsrc0 = load8888 ((src + 0));
+	    vsrc1 = load8888 ((src + 1));
+	    vsrc2 = load8888 ((src + 2));
+	    vsrc3 = load8888 ((src + 3));
+
+	    vdest = *(__m64 *)dst;
+
+	    vdest = pack_565 (over (vsrc0, expand_alpha (vsrc0), expand565 (vdest, 0)), vdest, 0);
+	    vdest = pack_565 (over (vsrc1, expand_alpha (vsrc1), expand565 (vdest, 1)), vdest, 1);
+	    vdest = pack_565 (over (vsrc2, expand_alpha (vsrc2), expand565 (vdest, 2)), vdest, 2);
+	    vdest = pack_565 (over (vsrc3, expand_alpha (vsrc3), expand565 (vdest, 3)), vdest, 3);
+
+	    *(__m64 *)dst = vdest;
 
 	    w -= 4;
 	    dst += 4;
 	    src += 4;
 	}
 
 	CHECKPOINT ();
 
@@ -2200,72 +1991,16 @@ pixman_fill_mmx (uint32_t *bits,
 
     }
 
     _mm_empty ();
     return TRUE;
 }
 
 static void
-mmx_composite_src_x888_0565 (pixman_implementation_t *imp,
-                             pixman_composite_info_t *info)
-{
-    PIXMAN_COMPOSITE_ARGS (info);
-    uint16_t    *dst_line, *dst;
-    uint32_t    *src_line, *src, s;
-    int dst_stride, src_stride;
-    int32_t w;
-
-    PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint32_t, src_stride, src_line, 1);
-    PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint16_t, dst_stride, dst_line, 1);
-
-    while (height--)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-	src = src_line;
-	src_line += src_stride;
-	w = width;
-
-	while (w && (unsigned long)dst & 7)
-	{
-	    s = *src++;
-	    *dst = CONVERT_8888_TO_0565 (s);
-	    dst++;
-	    w--;
-	}
-
-	while (w >= 4)
-	{
-	    __m64 vdest;
-	    __m64 vsrc0 = ldq_u ((__m64 *)(src + 0));
-	    __m64 vsrc1 = ldq_u ((__m64 *)(src + 2));
-
-	    vdest = pack_4xpacked565 (vsrc0, vsrc1);
-
-	    *(__m64 *)dst = vdest;
-
-	    w -= 4;
-	    src += 4;
-	    dst += 4;
-	}
-
-	while (w)
-	{
-	    s = *src++;
-	    *dst = CONVERT_8888_TO_0565 (s);
-	    dst++;
-	    w--;
-	}
-    }
-
-    _mm_empty ();
-}
-
-static void
 mmx_composite_src_n_8_8888 (pixman_implementation_t *imp,
                             pixman_composite_info_t *info)
 {
     PIXMAN_COMPOSITE_ARGS (info);
     uint32_t src, srca;
     uint32_t    *dst_line, *dst;
     uint8_t     *mask_line, *mask;
     int dst_stride, mask_stride;
@@ -2383,34 +2118,38 @@ mmx_composite_over_n_8_0565 (pixman_impl
 {
     PIXMAN_COMPOSITE_ARGS (info);
     uint32_t src, srca;
     uint16_t *dst_line, *dst;
     uint8_t *mask_line, *mask;
     int dst_stride, mask_stride;
     int32_t w;
     __m64 vsrc, vsrca, tmp;
-    __m64 srcsrcsrcsrc;
+    uint64_t srcsrcsrcsrc, src16;
 
     CHECKPOINT ();
 
     src = _pixman_image_get_solid (imp, src_image, dest_image->bits.format);
 
     srca = src >> 24;
     if (src == 0)
 	return;
 
     PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint16_t, dst_stride, dst_line, 1);
     PIXMAN_IMAGE_GET_LINE (mask_image, mask_x, mask_y, uint8_t, mask_stride, mask_line, 1);
 
     vsrc = load8888 (&src);
     vsrca = expand_alpha (vsrc);
 
     tmp = pack_565 (vsrc, _mm_setzero_si64 (), 0);
-    srcsrcsrcsrc = expand_alpha_rev (tmp);
+    src16 = to_uint64 (tmp);
+
+    srcsrcsrcsrc =
+	(uint64_t)src16 << 48 | (uint64_t)src16 << 32 |
+	(uint64_t)src16 << 16 | (uint64_t)src16;
 
     while (height--)
     {
 	dst = dst_line;
 	dst_line += dst_stride;
 	mask = mask_line;
 	mask_line += mask_stride;
 	w = width;
@@ -2444,38 +2183,39 @@ mmx_composite_over_n_8_0565 (pixman_impl
 	    uint64_t m0, m1, m2, m3;
 	    m0 = *mask;
 	    m1 = *(mask + 1);
 	    m2 = *(mask + 2);
 	    m3 = *(mask + 3);
 
 	    if (srca == 0xff && (m0 & m1 & m2 & m3) == 0xff)
 	    {
-		*(__m64 *)dst = srcsrcsrcsrc;
+		*(uint64_t *)dst = srcsrcsrcsrc;
 	    }
 	    else if (m0 | m1 | m2 | m3)
 	    {
-		__m64 vdest = *(__m64 *)dst;
-		__m64 v0, v1, v2, v3;
-
-		expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
-
-		__m64 vm0 = to_m64 (m0);
-		v0 = in_over (vsrc, vsrca, expand_alpha_rev (vm0), v0);
-
-		__m64 vm1 = to_m64 (m1);
-		v1 = in_over (vsrc, vsrca, expand_alpha_rev (vm1), v1);
-
-		__m64 vm2 = to_m64 (m2);
-		v2 = in_over (vsrc, vsrca, expand_alpha_rev (vm2), v2);
-
-		__m64 vm3 = to_m64 (m3);
-		v3 = in_over (vsrc, vsrca, expand_alpha_rev (vm3), v3);
-
-		*(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);;
+		__m64 vdest;
+		__m64 vm0, vm1, vm2, vm3;
+
+		vdest = *(__m64 *)dst;
+
+		vm0 = to_m64 (m0);
+		vdest = pack_565 (in_over (vsrc, vsrca, expand_alpha_rev (vm0),
+					   expand565 (vdest, 0)), vdest, 0);
+		vm1 = to_m64 (m1);
+		vdest = pack_565 (in_over (vsrc, vsrca, expand_alpha_rev (vm1),
+					   expand565 (vdest, 1)), vdest, 1);
+		vm2 = to_m64 (m2);
+		vdest = pack_565 (in_over (vsrc, vsrca, expand_alpha_rev (vm2),
+					   expand565 (vdest, 2)), vdest, 2);
+		vm3 = to_m64 (m3);
+		vdest = pack_565 (in_over (vsrc, vsrca, expand_alpha_rev (vm3),
+					   expand565 (vdest, 3)), vdest, 3);
+
+		*(__m64 *)dst = vdest;
 	    }
 
 	    w -= 4;
 	    mask += 4;
 	    dst += 4;
 	}
 
 	CHECKPOINT ();
@@ -2562,41 +2302,34 @@ mmx_composite_over_pixbuf_0565 (pixman_i
 
 	    a0 = (s0 >> 24);
 	    a1 = (s1 >> 24);
 	    a2 = (s2 >> 24);
 	    a3 = (s3 >> 24);
 
 	    if ((a0 & a1 & a2 & a3) == 0xFF)
 	    {
-		__m64 v0 = invert_colors (load8888 (&s0));
-		__m64 v1 = invert_colors (load8888 (&s1));
-		__m64 v2 = invert_colors (load8888 (&s2));
-		__m64 v3 = invert_colors (load8888 (&s3));
-
-		*(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);
+		__m64 vdest;
+		vdest = pack_565 (invert_colors (load8888 (&s0)), _mm_setzero_si64 (), 0);
+		vdest = pack_565 (invert_colors (load8888 (&s1)), vdest, 1);
+		vdest = pack_565 (invert_colors (load8888 (&s2)), vdest, 2);
+		vdest = pack_565 (invert_colors (load8888 (&s3)), vdest, 3);
+
+		*(__m64 *)dst = vdest;
 	    }
 	    else if (s0 | s1 | s2 | s3)
 	    {
 		__m64 vdest = *(__m64 *)dst;
-		__m64 v0, v1, v2, v3;
-
-		__m64 vsrc0 = load8888 (&s0);
-		__m64 vsrc1 = load8888 (&s1);
-		__m64 vsrc2 = load8888 (&s2);
-		__m64 vsrc3 = load8888 (&s3);
-
-		expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
-
-		v0 = over_rev_non_pre (vsrc0, v0);
-		v1 = over_rev_non_pre (vsrc1, v1);
-		v2 = over_rev_non_pre (vsrc2, v2);
-		v3 = over_rev_non_pre (vsrc3, v3);
-
-		*(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);
+
+		vdest = pack_565 (over_rev_non_pre (load8888 (&s0), expand565 (vdest, 0)), vdest, 0);
+		vdest = pack_565 (over_rev_non_pre (load8888 (&s1), expand565 (vdest, 1)), vdest, 1);
+		vdest = pack_565 (over_rev_non_pre (load8888 (&s2), expand565 (vdest, 2)), vdest, 2);
+		vdest = pack_565 (over_rev_non_pre (load8888 (&s3), expand565 (vdest, 3)), vdest, 3);
+
+		*(__m64 *)dst = vdest;
 	    }
 
 	    w -= 4;
 	    dst += 4;
 	    src += 4;
 	}
 
 	CHECKPOINT ();
@@ -2760,26 +2493,23 @@ mmx_composite_over_n_8888_0565_ca (pixma
 	    m0 = *p;
 	    m1 = *(p + 1);
 	    m2 = *(p + 2);
 	    m3 = *(p + 3);
 
 	    if ((m0 | m1 | m2 | m3))
 	    {
 		__m64 vdest = *(__m64 *)q;
-		__m64 v0, v1, v2, v3;
-
-		expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
-
-		v0 = in_over (vsrc, vsrca, load8888 (&m0), v0);
-		v1 = in_over (vsrc, vsrca, load8888 (&m1), v1);
-		v2 = in_over (vsrc, vsrca, load8888 (&m2), v2);
-		v3 = in_over (vsrc, vsrca, load8888 (&m3), v3);
-
-		*(__m64 *)q = pack_4x565 (v0, v1, v2, v3);
+
+		vdest = pack_565 (in_over (vsrc, vsrca, load8888 (&m0), expand565 (vdest, 0)), vdest, 0);
+		vdest = pack_565 (in_over (vsrc, vsrca, load8888 (&m1), expand565 (vdest, 1)), vdest, 1);
+		vdest = pack_565 (in_over (vsrc, vsrca, load8888 (&m2), expand565 (vdest, 2)), vdest, 2);
+		vdest = pack_565 (in_over (vsrc, vsrca, load8888 (&m3), expand565 (vdest, 3)), vdest, 3);
+
+		*(__m64 *)q = vdest;
 	    }
 	    twidth -= 4;
 	    p += 4;
 	    q += 4;
 	}
 
 	while (twidth)
 	{
@@ -3074,17 +2804,17 @@ mmx_composite_add_8_8 (pixman_implementa
 
 	    dst++;
 	    src++;
 	    w--;
 	}
 
 	while (w >= 8)
 	{
-	    *(__m64*)dst = _mm_adds_pu8 (ldq_u ((__m64 *)src), *(__m64*)dst);
+	    *(__m64*)dst = _mm_adds_pu8 (ldq_u((uint64_t *)src), *(__m64*)dst);
 	    dst += 8;
 	    src += 8;
 	    w -= 8;
 	}
 
 	while (w)
 	{
 	    s = *src;
@@ -3098,104 +2828,21 @@ mmx_composite_add_8_8 (pixman_implementa
 	    w--;
 	}
     }
 
     _mm_empty ();
 }
 
 static void
-mmx_composite_add_0565_0565 (pixman_implementation_t *imp,
-                             pixman_composite_info_t *info)
-{
-    PIXMAN_COMPOSITE_ARGS (info);
-    uint16_t    *dst_line, *dst;
-    uint32_t	d;
-    uint16_t    *src_line, *src;
-    uint32_t	s;
-    int dst_stride, src_stride;
-    int32_t w;
-
-    CHECKPOINT ();
-
-    PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint16_t, src_stride, src_line, 1);
-    PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint16_t, dst_stride, dst_line, 1);
-
-    while (height--)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-	src = src_line;
-	src_line += src_stride;
-	w = width;
-
-	while (w && (unsigned long)dst & 7)
-	{
-	    s = *src++;
-	    if (s)
-	    {
-		d = *dst;
-		s = CONVERT_0565_TO_8888 (s);
-		if (d)
-		{
-		    d = CONVERT_0565_TO_8888 (d);
-		    UN8x4_ADD_UN8x4 (s, d);
-		}
-		*dst = CONVERT_8888_TO_0565 (s);
-	    }
-	    dst++;
-	    w--;
-	}
-
-	while (w >= 4)
-	{
-	    __m64 vdest = *(__m64 *)dst;
-	    __m64 vsrc = ldq_u ((__m64 *)src);
-	    __m64 vd0, vd1;
-	    __m64 vs0, vs1;
-
-	    expand_4xpacked565 (vdest, &vd0, &vd1, 0);
-	    expand_4xpacked565 (vsrc, &vs0, &vs1, 0);
-
-	    vd0 = _mm_adds_pu8 (vd0, vs0);
-	    vd1 = _mm_adds_pu8 (vd1, vs1);
-
-	    *(__m64 *)dst = pack_4xpacked565 (vd0, vd1);
-
-	    dst += 4;
-	    src += 4;
-	    w -= 4;
-	}
-
-	while (w--)
-	{
-	    s = *src++;
-	    if (s)
-	    {
-		d = *dst;
-		s = CONVERT_0565_TO_8888 (s);
-		if (d)
-		{
-		    d = CONVERT_0565_TO_8888 (d);
-		    UN8x4_ADD_UN8x4 (s, d);
-		}
-		*dst = CONVERT_8888_TO_0565 (s);
-	    }
-	    dst++;
-	}
-    }
-
-    _mm_empty ();
-}
-
-static void
 mmx_composite_add_8888_8888 (pixman_implementation_t *imp,
                              pixman_composite_info_t *info)
 {
     PIXMAN_COMPOSITE_ARGS (info);
+    __m64 dst64;
     uint32_t    *dst_line, *dst;
     uint32_t    *src_line, *src;
     int dst_stride, src_stride;
     int32_t w;
 
     CHECKPOINT ();
 
     PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint32_t, src_stride, src_line, 1);
@@ -3206,35 +2853,36 @@ mmx_composite_add_8888_8888 (pixman_impl
 	dst = dst_line;
 	dst_line += dst_stride;
 	src = src_line;
 	src_line += src_stride;
 	w = width;
 
 	while (w && (unsigned long)dst & 7)
 	{
-	    store (dst, _mm_adds_pu8 (load ((const uint32_t *)src),
-	                              load ((const uint32_t *)dst)));
+	    *dst = _mm_cvtsi64_si32 (_mm_adds_pu8 (_mm_cvtsi32_si64 (*src),
+	                                           _mm_cvtsi32_si64 (*dst)));
 	    dst++;
 	    src++;
 	    w--;
 	}
 
 	while (w >= 2)
 	{
-	    *(__m64 *)dst = _mm_adds_pu8 (ldq_u ((__m64 *)src), *(__m64*)dst);
+	    dst64 = _mm_adds_pu8 (ldq_u((uint64_t *)src), *(__m64*)dst);
+	    *(uint64_t*)dst = to_uint64 (dst64);
 	    dst += 2;
 	    src += 2;
 	    w -= 2;
 	}
 
 	if (w)
 	{
-	    store (dst, _mm_adds_pu8 (load ((const uint32_t *)src),
-	                              load ((const uint32_t *)dst)));
+	    *dst = _mm_cvtsi64_si32 (_mm_adds_pu8 (_mm_cvtsi32_si64 (*src),
+	                                           _mm_cvtsi32_si64 (*dst)));
 
 	}
     }
 
     _mm_empty ();
 }
 
 static pixman_bool_t
@@ -3305,17 +2953,17 @@ pixman_blt_mmx (uint32_t *src_bits,
 	    *(uint16_t *)d = *(uint16_t *)s;
 	    w -= 2;
 	    s += 2;
 	    d += 2;
 	}
 
 	while (w >= 4 && ((unsigned long)d & 7))
 	{
-	    *(uint32_t *)d = ldl_u ((uint32_t *)s);
+	    *(uint32_t *)d = ldl_u((uint32_t *)s);
 
 	    w -= 4;
 	    s += 4;
 	    d += 4;
 	}
 
 	while (w >= 64)
 	{
@@ -3339,41 +2987,41 @@ pixman_blt_mmx (uint32_t *src_bits,
 	        "movq	%%mm6,	48(%0)\n"
 	        "movq	%%mm7,	56(%0)\n"
 		:
 		: "r" (d), "r" (s)
 		: "memory",
 		  "%mm0", "%mm1", "%mm2", "%mm3",
 		  "%mm4", "%mm5", "%mm6", "%mm7");
 #else
-	    __m64 v0 = ldq_u ((__m64 *)(s + 0));
-	    __m64 v1 = ldq_u ((__m64 *)(s + 8));
-	    __m64 v2 = ldq_u ((__m64 *)(s + 16));
-	    __m64 v3 = ldq_u ((__m64 *)(s + 24));
-	    __m64 v4 = ldq_u ((__m64 *)(s + 32));
-	    __m64 v5 = ldq_u ((__m64 *)(s + 40));
-	    __m64 v6 = ldq_u ((__m64 *)(s + 48));
-	    __m64 v7 = ldq_u ((__m64 *)(s + 56));
+	    __m64 v0 = ldq_u((uint64_t *)(s + 0));
+	    __m64 v1 = ldq_u((uint64_t *)(s + 8));
+	    __m64 v2 = ldq_u((uint64_t *)(s + 16));
+	    __m64 v3 = ldq_u((uint64_t *)(s + 24));
+	    __m64 v4 = ldq_u((uint64_t *)(s + 32));
+	    __m64 v5 = ldq_u((uint64_t *)(s + 40));
+	    __m64 v6 = ldq_u((uint64_t *)(s + 48));
+	    __m64 v7 = ldq_u((uint64_t *)(s + 56));
 	    *(__m64 *)(d + 0)  = v0;
 	    *(__m64 *)(d + 8)  = v1;
 	    *(__m64 *)(d + 16) = v2;
 	    *(__m64 *)(d + 24) = v3;
 	    *(__m64 *)(d + 32) = v4;
 	    *(__m64 *)(d + 40) = v5;
 	    *(__m64 *)(d + 48) = v6;
 	    *(__m64 *)(d + 56) = v7;
 #endif
 
 	    w -= 64;
 	    s += 64;
 	    d += 64;
 	}
 	while (w >= 4)
 	{
-	    *(uint32_t *)d = ldl_u ((uint32_t *)s);
+	    *(uint32_t *)d = ldl_u((uint32_t *)s);
 
 	    w -= 4;
 	    s += 4;
 	    d += 4;
 	}
 	if (w >= 2)
 	{
 	    *(uint16_t *)d = *(uint16_t *)s;
@@ -3456,500 +3104,16 @@ mmx_composite_over_x888_8_8888 (pixman_i
 	    dst++;
 	    src++;
 	}
     }
 
     _mm_empty ();
 }
 
-static void
-mmx_composite_over_reverse_n_8888 (pixman_implementation_t *imp,
-                                   pixman_composite_info_t *info)
-{
-    PIXMAN_COMPOSITE_ARGS (info);
-    uint32_t src;
-    uint32_t    *dst_line, *dst;
-    int32_t w;
-    int dst_stride;
-    __m64 vsrc;
-
-    CHECKPOINT ();
-
-    src = _pixman_image_get_solid (imp, src_image, dest_image->bits.format);
-
-    if (src == 0)
-	return;
-
-    PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint32_t, dst_stride, dst_line, 1);
-
-    vsrc = load8888 (&src);
-
-    while (height--)
-    {
-	dst = dst_line;
-	dst_line += dst_stride;
-	w = width;
-
-	CHECKPOINT ();
-
-	while (w && (unsigned long)dst & 7)
-	{
-	    __m64 vdest = load8888 (dst);
-
-	    store8888 (dst, over (vdest, expand_alpha (vdest), vsrc));
-
-	    w--;
-	    dst++;
-	}
-
-	while (w >= 2)
-	{
-	    __m64 vdest = *(__m64 *)dst;
-	    __m64 dest0 = expand8888 (vdest, 0);
-	    __m64 dest1 = expand8888 (vdest, 1);
-
-
-	    dest0 = over (dest0, expand_alpha (dest0), vsrc);
-	    dest1 = over (dest1, expand_alpha (dest1), vsrc);
-
-	    *(__m64 *)dst = pack8888 (dest0, dest1);
-
-	    dst += 2;
-	    w -= 2;
-	}
-
-	CHECKPOINT ();
-
-	if (w)
-	{
-	    __m64 vdest = load8888 (dst);
-
-	    store8888 (dst, over (vdest, expand_alpha (vdest), vsrc));
-	}
-    }
-
-    _mm_empty ();
-}
-
-#define BSHIFT ((1 << BILINEAR_INTERPOLATION_BITS))
-#define BMSK (BSHIFT - 1)
-
-#define BILINEAR_DECLARE_VARIABLES						\
-    const __m64 mm_wt = _mm_set_pi16 (wt, wt, wt, wt);				\
-    const __m64 mm_wb = _mm_set_pi16 (wb, wb, wb, wb);				\
-    const __m64 mm_BSHIFT = _mm_set_pi16 (BSHIFT, BSHIFT, BSHIFT, BSHIFT);	\
-    const __m64 mm_addc7 = _mm_set_pi16 (0, 1, 0, 1);				\
-    const __m64 mm_xorc7 = _mm_set_pi16 (0, BMSK, 0, BMSK);			\
-    const __m64 mm_ux = _mm_set_pi16 (unit_x, unit_x, unit_x, unit_x);		\
-    const __m64 mm_zero = _mm_setzero_si64 ();					\
-    __m64 mm_x = _mm_set_pi16 (vx, vx, vx, vx)
-
-#define BILINEAR_INTERPOLATE_ONE_PIXEL(pix)					\
-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);		\
-    __m64 b_hi = _mm_mullo_pi16 (_mm_unpackhi_pi8 (b, mm_zero), mm_wb);		\
-    __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);					\
-    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);					\
-	lo = _mm_madd_pi16 (p, mm_wh);						\
-	hi = _mm_madd_pi16 (q, mm_wh);						\
-    }										\
-    else									\
-    {										\
-	/* calculate horizontal weights */					\
-	__m64 mm_wh_lo = _mm_sub_pi16 (mm_BSHIFT, _mm_srli_pi16 (mm_x,		\
-					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);				\
-	__m64 mm_hi_lo = _mm_mulhi_pu16 (lo, mm_wh_lo);				\
-	__m64 mm_hi_hi = _mm_mulhi_pu16 (hi, mm_wh_hi);				\
-	lo = _mm_add_pi32 (_mm_unpacklo_pi16 (mm_lo_lo, mm_hi_lo),		\
-			   _mm_unpacklo_pi16 (mm_lo_hi, mm_hi_hi));		\
-	hi = _mm_add_pi32 (_mm_unpackhi_pi16 (mm_lo_lo, mm_hi_lo),		\
-			   _mm_unpackhi_pi16 (mm_lo_hi, mm_hi_hi));		\
-    }										\
-    /* shift and pack the result */						\
-    hi = _mm_srli_pi32 (hi, BILINEAR_INTERPOLATION_BITS * 2);			\
-    lo = _mm_srli_pi32 (lo, BILINEAR_INTERPOLATION_BITS * 2);			\
-    lo = _mm_packs_pi32 (lo, hi);						\
-    lo = _mm_packs_pu16 (lo, lo);						\
-    pix = lo;									\
-} while (0)
-
-#define BILINEAR_SKIP_ONE_PIXEL()						\
-do {										\
-    vx += unit_x;								\
-    mm_x = _mm_add_pi16 (mm_x, mm_ux);						\
-} while(0)
-
-static force_inline void
-scaled_bilinear_scanline_mmx_8888_8888_SRC (uint32_t *       dst,
-					    const uint32_t * mask,
-					    const uint32_t * src_top,
-					    const uint32_t * src_bottom,
-					    int32_t          w,
-					    int              wt,
-					    int              wb,
-					    pixman_fixed_t   vx,
-					    pixman_fixed_t   unit_x,
-					    pixman_fixed_t   max_vx,
-					    pixman_bool_t    zero_src)
-{
-    BILINEAR_DECLARE_VARIABLES;
-    __m64 pix;
-
-    while (w--)
-    {
-	BILINEAR_INTERPOLATE_ONE_PIXEL (pix);
-	store (dst, pix);
-	dst++;
-    }
-
-    _mm_empty ();
-}
-
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8888_cover_SRC,
-			       scaled_bilinear_scanline_mmx_8888_8888_SRC,
-			       uint32_t, uint32_t, uint32_t,
-			       COVER, FLAG_NONE)
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8888_pad_SRC,
-			       scaled_bilinear_scanline_mmx_8888_8888_SRC,
-			       uint32_t, uint32_t, uint32_t,
-			       PAD, FLAG_NONE)
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8888_none_SRC,
-			       scaled_bilinear_scanline_mmx_8888_8888_SRC,
-			       uint32_t, uint32_t, uint32_t,
-			       NONE, FLAG_NONE)
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8888_normal_SRC,
-			       scaled_bilinear_scanline_mmx_8888_8888_SRC,
-			       uint32_t, uint32_t, uint32_t,
-			       NORMAL, FLAG_NONE)
-
-static force_inline void
-scaled_bilinear_scanline_mmx_8888_8888_OVER (uint32_t *       dst,
-					     const uint32_t * mask,
-					     const uint32_t * src_top,
-					     const uint32_t * src_bottom,
-					     int32_t          w,
-					     int              wt,
-					     int              wb,
-					     pixman_fixed_t   vx,
-					     pixman_fixed_t   unit_x,
-					     pixman_fixed_t   max_vx,
-					     pixman_bool_t    zero_src)
-{
-    BILINEAR_DECLARE_VARIABLES;
-    __m64 pix1, pix2;
-
-    while (w)
-    {
-	BILINEAR_INTERPOLATE_ONE_PIXEL (pix1);
-
-	if (!is_zero (pix1))
-	{
-	    pix2 = load (dst);
-	    store8888 (dst, core_combine_over_u_pixel_mmx (pix1, pix2));
-	}
-
-	w--;
-	dst++;
-    }
-
-    _mm_empty ();
-}
-
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8888_cover_OVER,
-			       scaled_bilinear_scanline_mmx_8888_8888_OVER,
-			       uint32_t, uint32_t, uint32_t,
-			       COVER, FLAG_NONE)
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8888_pad_OVER,
-			       scaled_bilinear_scanline_mmx_8888_8888_OVER,
-			       uint32_t, uint32_t, uint32_t,
-			       PAD, FLAG_NONE)
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8888_none_OVER,
-			       scaled_bilinear_scanline_mmx_8888_8888_OVER,
-			       uint32_t, uint32_t, uint32_t,
-			       NONE, FLAG_NONE)
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8888_normal_OVER,
-			       scaled_bilinear_scanline_mmx_8888_8888_OVER,
-			       uint32_t, uint32_t, uint32_t,
-			       NORMAL, FLAG_NONE)
-
-static force_inline void
-scaled_bilinear_scanline_mmx_8888_8_8888_OVER (uint32_t *       dst,
-					       const uint8_t  * mask,
-					       const uint32_t * src_top,
-					       const uint32_t * src_bottom,
-					       int32_t          w,
-					       int              wt,
-					       int              wb,
-					       pixman_fixed_t   vx,
-					       pixman_fixed_t   unit_x,
-					       pixman_fixed_t   max_vx,
-					       pixman_bool_t    zero_src)
-{
-    BILINEAR_DECLARE_VARIABLES;
-    __m64 pix1, pix2;
-    uint32_t m;
-
-    while (w)
-    {
-	m = (uint32_t) *mask++;
-
-	if (m)
-	{
-	    BILINEAR_INTERPOLATE_ONE_PIXEL (pix1);
-
-	    if (m == 0xff && is_opaque (pix1))
-	    {
-		store (dst, pix1);
-	    }
-	    else
-	    {
-		__m64 ms, md, ma, msa;
-
-		pix2 = load (dst);
-		ma = expand_alpha_rev (to_m64 (m));
-		ms = _mm_unpacklo_pi8 (pix1, _mm_setzero_si64 ());
-		md = _mm_unpacklo_pi8 (pix2, _mm_setzero_si64 ());
-
-		msa = expand_alpha (ms);
-
-		store8888 (dst, (in_over (ms, msa, ma, md)));
-	    }
-	}
-	else
-	{
-	    BILINEAR_SKIP_ONE_PIXEL ();
-	}
-
-	w--;
-	dst++;
-    }
-
-    _mm_empty ();
-}
-
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8_8888_cover_OVER,
-			       scaled_bilinear_scanline_mmx_8888_8_8888_OVER,
-			       uint32_t, uint8_t, uint32_t,
-			       COVER, FLAG_HAVE_NON_SOLID_MASK)
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8_8888_pad_OVER,
-			       scaled_bilinear_scanline_mmx_8888_8_8888_OVER,
-			       uint32_t, uint8_t, uint32_t,
-			       PAD, FLAG_HAVE_NON_SOLID_MASK)
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8_8888_none_OVER,
-			       scaled_bilinear_scanline_mmx_8888_8_8888_OVER,
-			       uint32_t, uint8_t, uint32_t,
-			       NONE, FLAG_HAVE_NON_SOLID_MASK)
-FAST_BILINEAR_MAINLOOP_COMMON (mmx_8888_8_8888_normal_OVER,
-			       scaled_bilinear_scanline_mmx_8888_8_8888_OVER,
-			       uint32_t, uint8_t, uint32_t,
-			       NORMAL, FLAG_HAVE_NON_SOLID_MASK)
-
-static uint32_t *
-mmx_fetch_x8r8g8b8 (pixman_iter_t *iter, const uint32_t *mask)
-{
-    int w = iter->width;
-    uint32_t *dst = iter->buffer;
-    uint32_t *src = (uint32_t *)iter->bits;
-
-    iter->bits += iter->stride;
-
-    while (w && ((unsigned long)dst) & 7)
-    {
-	*dst++ = (*src++) | 0xff000000;
-	w--;
-    }
-
-    while (w >= 8)
-    {
-	__m64 vsrc1 = ldq_u ((__m64 *)(src + 0));
-	__m64 vsrc2 = ldq_u ((__m64 *)(src + 2));
-	__m64 vsrc3 = ldq_u ((__m64 *)(src + 4));
-	__m64 vsrc4 = ldq_u ((__m64 *)(src + 6));
-
-	*(__m64 *)(dst + 0) = _mm_or_si64 (vsrc1, MC (ff000000));
-	*(__m64 *)(dst + 2) = _mm_or_si64 (vsrc2, MC (ff000000));
-	*(__m64 *)(dst + 4) = _mm_or_si64 (vsrc3, MC (ff000000));
-	*(__m64 *)(dst + 6) = _mm_or_si64 (vsrc4, MC (ff000000));
-
-	dst += 8;
-	src += 8;
-	w -= 8;
-    }
-
-    while (w)
-    {
-	*dst++ = (*src++) | 0xff000000;
-	w--;
-    }
-
-    _mm_empty ();
-    return iter->buffer;
-}
-
-static uint32_t *
-mmx_fetch_r5g6b5 (pixman_iter_t *iter, const uint32_t *mask)
-{
-    int w = iter->width;
-    uint32_t *dst = iter->buffer;
-    uint16_t *src = (uint16_t *)iter->bits;
-
-    iter->bits += iter->stride;
-
-    while (w && ((unsigned long)dst) & 0x0f)
-    {
-	uint16_t s = *src++;
-
-	*dst++ = CONVERT_0565_TO_8888 (s);
-	w--;
-    }
-
-    while (w >= 4)
-    {
-	__m64 vsrc = ldq_u ((__m64 *)src);
-	__m64 mm0, mm1;
-
-	expand_4xpacked565 (vsrc, &mm0, &mm1, 1);
-
-	*(__m64 *)(dst + 0) = mm0;
-	*(__m64 *)(dst + 2) = mm1;
-
-	dst += 4;
-	src += 4;
-	w -= 4;
-    }
-
-    while (w)
-    {
-	uint16_t s = *src++;
-
-	*dst++ = CONVERT_0565_TO_8888 (s);
-	w--;
-    }
-
-    _mm_empty ();
-    return iter->buffer;
-}
-
-static uint32_t *
-mmx_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
-{
-    int w = iter->width;
-    uint32_t *dst = iter->buffer;
-    uint8_t *src = iter->bits;
-
-    iter->bits += iter->stride;
-
-    while (w && (((unsigned long)dst) & 15))
-    {
-        *dst++ = *(src++) << 24;
-        w--;
-    }
-
-    while (w >= 8)
-    {
-	__m64 mm0 = ldq_u ((__m64 *)src);
-
-	__m64 mm1 = _mm_unpacklo_pi8  (_mm_setzero_si64(), mm0);
-	__m64 mm2 = _mm_unpackhi_pi8  (_mm_setzero_si64(), mm0);
-	__m64 mm3 = _mm_unpacklo_pi16 (_mm_setzero_si64(), mm1);
-	__m64 mm4 = _mm_unpackhi_pi16 (_mm_setzero_si64(), mm1);
-	__m64 mm5 = _mm_unpacklo_pi16 (_mm_setzero_si64(), mm2);
-	__m64 mm6 = _mm_unpackhi_pi16 (_mm_setzero_si64(), mm2);
-
-	*(__m64 *)(dst + 0) = mm3;
-	*(__m64 *)(dst + 2) = mm4;
-	*(__m64 *)(dst + 4) = mm5;
-	*(__m64 *)(dst + 6) = mm6;
-
-	dst += 8;
-	src += 8;
-	w -= 8;
-    }
-
-    while (w)
-    {
-	*dst++ = *(src++) << 24;
-	w--;
-    }
-
-    _mm_empty ();
-    return iter->buffer;
-}
-
-typedef struct
-{
-    pixman_format_code_t	format;
-    pixman_iter_get_scanline_t	get_scanline;
-} fetcher_info_t;
-
-static const fetcher_info_t fetchers[] =
-{
-    { PIXMAN_x8r8g8b8,		mmx_fetch_x8r8g8b8 },
-    { PIXMAN_r5g6b5,		mmx_fetch_r5g6b5 },
-    { PIXMAN_a8,		mmx_fetch_a8 },
-    { PIXMAN_null }
-};
-
-static void
-mmx_src_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
-{
-    pixman_image_t *image = iter->image;
-
-#define FLAGS								\
-    (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM |		\
-     FAST_PATH_BITS_IMAGE | FAST_PATH_SAMPLES_COVER_CLIP_NEAREST)
-
-    if ((iter->iter_flags & ITER_NARROW)			&&
-	(iter->image_flags & FLAGS) == FLAGS)
-    {
-	const fetcher_info_t *f;
-
-	for (f = &fetchers[0]; f->format != PIXMAN_null; f++)
-	{
-	    if (image->common.extended_format_code == f->format)
-	    {
-		uint8_t *b = (uint8_t *)image->bits.bits;
-		int s = image->bits.rowstride * 4;
-
-		iter->bits = b + s * iter->y + iter->x * PIXMAN_FORMAT_BPP (f->format) / 8;
-		iter->stride = s;
-
-		iter->get_scanline = f->get_scanline;
-		return;
-	    }
-	}
-    }
-
-    imp->delegate->src_iter_init (imp->delegate, iter);
-}
-
 static const pixman_fast_path_t mmx_fast_paths[] =
 {
     PIXMAN_STD_FAST_PATH    (OVER, solid,    a8,       r5g6b5,   mmx_composite_over_n_8_0565       ),
     PIXMAN_STD_FAST_PATH    (OVER, solid,    a8,       b5g6r5,   mmx_composite_over_n_8_0565       ),
     PIXMAN_STD_FAST_PATH    (OVER, solid,    a8,       a8r8g8b8, mmx_composite_over_n_8_8888       ),
     PIXMAN_STD_FAST_PATH    (OVER, solid,    a8,       x8r8g8b8, mmx_composite_over_n_8_8888       ),
     PIXMAN_STD_FAST_PATH    (OVER, solid,    a8,       a8b8g8r8, mmx_composite_over_n_8_8888       ),
     PIXMAN_STD_FAST_PATH    (OVER, solid,    a8,       x8b8g8r8, mmx_composite_over_n_8_8888       ),
@@ -3986,63 +3150,37 @@ static const pixman_fast_path_t mmx_fast
 
     PIXMAN_STD_FAST_PATH    (OVER, a8r8g8b8, null,     a8r8g8b8, mmx_composite_over_8888_8888      ),
     PIXMAN_STD_FAST_PATH    (OVER, a8r8g8b8, null,     x8r8g8b8, mmx_composite_over_8888_8888      ),
     PIXMAN_STD_FAST_PATH    (OVER, a8r8g8b8, null,     r5g6b5,   mmx_composite_over_8888_0565      ),
     PIXMAN_STD_FAST_PATH    (OVER, a8b8g8r8, null,     a8b8g8r8, mmx_composite_over_8888_8888      ),
     PIXMAN_STD_FAST_PATH    (OVER, a8b8g8r8, null,     x8b8g8r8, mmx_composite_over_8888_8888      ),
     PIXMAN_STD_FAST_PATH    (OVER, a8b8g8r8, null,     b5g6r5,   mmx_composite_over_8888_0565      ),
 
-    PIXMAN_STD_FAST_PATH    (OVER_REVERSE, solid, null, a8r8g8b8, mmx_composite_over_reverse_n_8888),
-    PIXMAN_STD_FAST_PATH    (OVER_REVERSE, solid, null, a8b8g8r8, mmx_composite_over_reverse_n_8888),
-
-    PIXMAN_STD_FAST_PATH    (ADD,  r5g6b5,   null,     r5g6b5,   mmx_composite_add_0565_0565       ),
-    PIXMAN_STD_FAST_PATH    (ADD,  b5g6r5,   null,     b5g6r5,   mmx_composite_add_0565_0565       ),
     PIXMAN_STD_FAST_PATH    (ADD,  a8r8g8b8, null,     a8r8g8b8, mmx_composite_add_8888_8888       ),
     PIXMAN_STD_FAST_PATH    (ADD,  a8b8g8r8, null,     a8b8g8r8, mmx_composite_add_8888_8888       ),
     PIXMAN_STD_FAST_PATH    (ADD,  a8,       null,     a8,       mmx_composite_add_8_8		   ),
     PIXMAN_STD_FAST_PATH    (ADD,  solid,    a8,       a8,       mmx_composite_add_n_8_8           ),
 
-    PIXMAN_STD_FAST_PATH    (SRC,  a8r8g8b8, null,     r5g6b5,   mmx_composite_src_x888_0565       ),
-    PIXMAN_STD_FAST_PATH    (SRC,  a8b8g8r8, null,     b5g6r5,   mmx_composite_src_x888_0565       ),
-    PIXMAN_STD_FAST_PATH    (SRC,  x8r8g8b8, null,     r5g6b5,   mmx_composite_src_x888_0565       ),
-    PIXMAN_STD_FAST_PATH    (SRC,  x8b8g8r8, null,     b5g6r5,   mmx_composite_src_x888_0565       ),
     PIXMAN_STD_FAST_PATH    (SRC,  solid,    a8,       a8r8g8b8, mmx_composite_src_n_8_8888        ),
     PIXMAN_STD_FAST_PATH    (SRC,  solid,    a8,       x8r8g8b8, mmx_composite_src_n_8_8888        ),
     PIXMAN_STD_FAST_PATH    (SRC,  solid,    a8,       a8b8g8r8, mmx_composite_src_n_8_8888        ),
     PIXMAN_STD_FAST_PATH    (SRC,  solid,    a8,       x8b8g8r8, mmx_composite_src_n_8_8888        ),
     PIXMAN_STD_FAST_PATH    (SRC,  a8r8g8b8, null,     a8r8g8b8, mmx_composite_copy_area           ),
     PIXMAN_STD_FAST_PATH    (SRC,  a8b8g8r8, null,     a8b8g8r8, mmx_composite_copy_area           ),
     PIXMAN_STD_FAST_PATH    (SRC,  a8r8g8b8, null,     x8r8g8b8, mmx_composite_copy_area           ),
     PIXMAN_STD_FAST_PATH    (SRC,  a8b8g8r8, null,     x8b8g8r8, mmx_composite_copy_area           ),
     PIXMAN_STD_FAST_PATH    (SRC,  x8r8g8b8, null,     x8r8g8b8, mmx_composite_copy_area           ),
     PIXMAN_STD_FAST_PATH    (SRC,  x8b8g8r8, null,     x8b8g8r8, mmx_composite_copy_area           ),
     PIXMAN_STD_FAST_PATH    (SRC,  r5g6b5,   null,     r5g6b5,   mmx_composite_copy_area           ),
     PIXMAN_STD_FAST_PATH    (SRC,  b5g6r5,   null,     b5g6r5,   mmx_composite_copy_area           ),
 
     PIXMAN_STD_FAST_PATH    (IN,   a8,       null,     a8,       mmx_composite_in_8_8              ),
     PIXMAN_STD_FAST_PATH    (IN,   solid,    a8,       a8,       mmx_composite_in_n_8_8            ),
 
-    SIMPLE_BILINEAR_FAST_PATH (SRC, a8r8g8b8,          a8r8g8b8, mmx_8888_8888                     ),
-    SIMPLE_BILINEAR_FAST_PATH (SRC, a8r8g8b8,          x8r8g8b8, mmx_8888_8888                     ),
-    SIMPLE_BILINEAR_FAST_PATH (SRC, x8r8g8b8,          x8r8g8b8, mmx_8888_8888                     ),
-    SIMPLE_BILINEAR_FAST_PATH (SRC, a8b8g8r8,          a8b8g8r8, mmx_8888_8888                     ),
-    SIMPLE_BILINEAR_FAST_PATH (SRC, a8b8g8r8,          x8b8g8r8, mmx_8888_8888                     ),
-    SIMPLE_BILINEAR_FAST_PATH (SRC, x8b8g8r8,          x8b8g8r8, mmx_8888_8888                     ),
-
-    SIMPLE_BILINEAR_FAST_PATH (OVER, a8r8g8b8,         x8r8g8b8, mmx_8888_8888                     ),
-    SIMPLE_BILINEAR_FAST_PATH (OVER, a8b8g8r8,         x8b8g8r8, mmx_8888_8888                     ),
-    SIMPLE_BILINEAR_FAST_PATH (OVER, a8r8g8b8,         a8r8g8b8, mmx_8888_8888                     ),
-    SIMPLE_BILINEAR_FAST_PATH (OVER, a8b8g8r8,         a8b8g8r8, mmx_8888_8888                     ),
-
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8r8g8b8, x8r8g8b8, mmx_8888_8_8888                   ),
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8b8g8r8, x8b8g8r8, mmx_8888_8_8888                   ),
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8r8g8b8, a8r8g8b8, mmx_8888_8_8888                   ),
-    SIMPLE_BILINEAR_A8_MASK_FAST_PATH (OVER, a8b8g8r8, a8b8g8r8, mmx_8888_8_8888                   ),
-
     { PIXMAN_OP_NONE },
 };
 
 static pixman_bool_t
 mmx_blt (pixman_implementation_t *imp,
          uint32_t *               src_bits,
          uint32_t *               dst_bits,
          int                      src_stride,
@@ -4117,14 +3255,12 @@ pixman_implementation_t *
     imp->combine_32_ca[PIXMAN_OP_ATOP] = mmx_combine_atop_ca;
     imp->combine_32_ca[PIXMAN_OP_ATOP_REVERSE] = mmx_combine_atop_reverse_ca;
     imp->combine_32_ca[PIXMAN_OP_XOR] = mmx_combine_xor_ca;
     imp->combine_32_ca[PIXMAN_OP_ADD] = mmx_combine_add_ca;
 
     imp->blt = mmx_blt;
     imp->fill = mmx_fill;
 
-    imp->src_iter_init = mmx_src_iter_init;
-
     return imp;
 }
 
-#endif /* USE_X86_MMX || USE_ARM_IWMMXT || USE_LOONGSON_MMI */
+#endif /* USE_X86_MMX || USE_ARM_IWMMXT */
--- a/gfx/cairo/libpixman/src/pixman-noop.c
+++ b/gfx/cairo/libpixman/src/pixman-noop.c
@@ -66,28 +66,28 @@ noop_src_iter_init (pixman_implementatio
 
 #define FLAGS						\
     (FAST_PATH_STANDARD_FLAGS | FAST_PATH_ID_TRANSFORM)
 
     if (!image)
     {
 	iter->get_scanline = get_scanline_null;
     }
-    else if ((iter->iter_flags & (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) ==
+    else if ((iter->flags & (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB)) ==
 	     (ITER_IGNORE_ALPHA | ITER_IGNORE_RGB))
     {
 	iter->get_scanline = _pixman_iter_get_scanline_noop;
     }
     else if (image->common.extended_format_code == PIXMAN_solid		&&
-	     ((iter->image_flags & (FAST_PATH_BITS_IMAGE | FAST_PATH_NO_ALPHA_MAP)) ==
+	     ((image->common.flags & (FAST_PATH_BITS_IMAGE | FAST_PATH_NO_ALPHA_MAP)) ==
 	      (FAST_PATH_BITS_IMAGE | FAST_PATH_NO_ALPHA_MAP)))
     {
 	bits_image_t *bits = &image->bits;
 
-	if (iter->iter_flags & ITER_NARROW)
+	if (iter->flags & ITER_NARROW)
 	{
 	    uint32_t color = bits->fetch_pixel_32 (bits, 0, 0);
 	    uint32_t *buffer = iter->buffer;
 	    uint32_t *end = buffer + iter->width;
 
 	    while (buffer < end)
 		*(buffer++) = color;
 	}
@@ -99,18 +99,18 @@ noop_src_iter_init (pixman_implementatio
 
 	    while (buffer < end)
 		*(buffer++) = color;
 	}
 
 	iter->get_scanline = _pixman_iter_get_scanline_noop;
     }
     else if (image->common.extended_format_code == PIXMAN_a8r8g8b8	&&
-	     (iter->iter_flags & ITER_NARROW)				&&
-	     (iter->image_flags & FLAGS) == FLAGS			&&
+	     (iter->flags & ITER_NARROW)				&&
+	     (image->common.flags & FLAGS) == FLAGS			&&
 	     iter->x >= 0 && iter->y >= 0				&&
 	     iter->x + iter->width <= image->bits.width			&&
 	     iter->y + iter->height <= image->bits.height)
     {
 	iter->buffer =
 	    image->bits.bits + iter->y * image->bits.rowstride + iter->x;
 
 	iter->get_scanline = noop_get_scanline;
@@ -120,18 +120,18 @@ noop_src_iter_init (pixman_implementatio
 	(* imp->delegate->src_iter_init) (imp->delegate, iter);
     }
 }
 
 static void
 noop_dest_iter_init (pixman_implementation_t *imp, pixman_iter_t *iter)
 {
     pixman_image_t *image = iter->image;
-    uint32_t image_flags = iter->image_flags;
-    uint32_t iter_flags = iter->iter_flags;
+    uint32_t image_flags = image->common.flags;
+    uint32_t iter_flags = iter->flags;
     
     if ((image_flags & FAST_PATH_STD_DEST_FLAGS) == FAST_PATH_STD_DEST_FLAGS	&&
 	(iter_flags & ITER_NARROW) == ITER_NARROW				&&
 	((image->common.extended_format_code == PIXMAN_a8r8g8b8)	||
 	 (image->common.extended_format_code == PIXMAN_x8r8g8b8 &&
 	  (iter_flags & (ITER_LOCALIZED_ALPHA)))))
     {
 	iter->buffer = image->bits.bits + iter->y * image->bits.rowstride + iter->x;
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-ppc.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright © 2000 SuSE, Inc.
- * Copyright © 2007 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 SuSE not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  SuSE makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
- * 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.
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "pixman-private.h"
-
-#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.
- */
-#ifdef __APPLE__
-#include <sys/sysctl.h>
-
-static pixman_bool_t
-pixman_have_vmx (void)
-{
-    size_t length = sizeof(have_vmx);
-    int error, have_mmx;
-
-    sysctlbyname ("hw.optional.altivec", &have_vmx, &length, NULL, 0);
-
-    if (error)
-	return FALSE;
-
-    return have_vmx;
-}
-
-#elif defined (__OpenBSD__)
-#include <sys/param.h>
-#include <sys/sysctl.h>
-#include <machine/cpu.h>
-
-static pixman_bool_t
-pixman_have_vmx (void)
-{
-    int mib[2] = { CTL_MACHDEP, CPU_ALTIVEC };
-    size_t length = sizeof(have_vmx);
-    int error, have_vmx;
-
-    error = sysctl (mib, 2, &have_vmx, &length, NULL, 0);
-
-    if (error != 0)
-	return FALSE;
-
-    return have_vmx;
-}
-
-#elif defined (__linux__)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <linux/auxvec.h>
-#include <asm/cputable.h>
-
-static pixman_bool_t
-pixman_have_vmx (void)
-{
-    int have_vmx = FALSE;
-    int fd;
-    struct
-    {
-	unsigned long type;
-	unsigned long value;
-    } aux;
-
-    fd = open ("/proc/self/auxv", O_RDONLY);
-    if (fd >= 0)
-    {
-	while (read (fd, &aux, sizeof (aux)) == sizeof (aux))
-	{
-	    if (aux.type == AT_HWCAP && (aux.value & PPC_FEATURE_HAS_ALTIVEC))
-	    {
-		have_vmx = TRUE;
-		break;
-	    }
-	}
-
-	close (fd);
-    }
-
-    return have_vmx;
-}
-
-#else /* !__APPLE__ && !__OpenBSD__ && !__linux__ */
-#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);
-}
-
-static pixman_bool_t
-pixman_have_vmx (void)
-{
-    struct sigaction sa, osa;
-    int jmp_result;
-
-    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);
-    return (jmp_result == 0);
-}
-
-#endif /* __APPLE__ */
-#endif /* USE_VMX */
-
-pixman_implementation_t *
-_pixman_ppc_get_implementations (pixman_implementation_t *imp)
-{
-#ifdef USE_VMX
-    if (!_pixman_disabled ("vmx") && pixman_have_vmx ())
-	imp = _pixman_implementation_create_vmx (imp);
-#endif
-
-    return imp;
-}
--- a/gfx/cairo/libpixman/src/pixman-private.h
+++ b/gfx/cairo/libpixman/src/pixman-private.h
@@ -1,44 +1,23 @@
-#ifndef PIXMAN_PRIVATE_H
-#define PIXMAN_PRIVATE_H
-
-/*
- * The defines which are shared between C and assembly code
- */
-
-/* bilinear interpolation precision (must be <= 8) */
-#ifdef MOZ_GFX_OPTIMIZE_MOBILE
-#define LOW_QUALITY_INTERPOLATION
-#define LOWER_QUALITY_INTERPOLATION
-#define BILINEAR_INTERPOLATION_BITS 4
-#else
-#define BILINEAR_INTERPOLATION_BITS 8
-#endif
-#define BILINEAR_INTERPOLATION_RANGE (1 << BILINEAR_INTERPOLATION_BITS)
-
-/*
- * C specific part
- */
-
-#ifndef __ASSEMBLER__
-
 #ifndef PACKAGE
 #  error config.h must be included before pixman-private.h
 #endif
 
+#ifndef PIXMAN_PRIVATE_H
+#define PIXMAN_PRIVATE_H
+
 #define PIXMAN_DISABLE_DEPRECATED
 #define PIXMAN_USE_INTERNAL_API
 
 #include "pixman.h"
 #include <time.h>
 #include <assert.h>
 #include <stdio.h>
 #include <string.h>
-#include <stddef.h>
 
 #include "pixman-compiler.h"
 
 /*
  * Images
  */
 typedef struct image_common image_common_t;
 typedef struct solid_fill solid_fill_t;
@@ -170,16 +149,19 @@ struct bits_image
     pixman_format_code_t       format;
     const pixman_indexed_t *   indexed;
     int                        width;
     int                        height;
     uint32_t *                 bits;
     uint32_t *                 free_me;
     int                        rowstride;  /* in number of uint32_t's */
 
+    fetch_scanline_t           get_scanline_32;
+    fetch_scanline_t           get_scanline_64;
+
     fetch_scanline_t           fetch_scanline_16;
 
     fetch_scanline_t           fetch_scanline_32;
     fetch_pixel_32_t	       fetch_pixel_32;
     store_scanline_t           store_scanline_32;
 
     fetch_scanline_t           fetch_scanline_64;
     fetch_pixel_64_t	       fetch_pixel_64;
@@ -242,25 +224,23 @@ typedef enum
 struct pixman_iter_t
 {
     /* These are initialized by _pixman_implementation_{src,dest}_init */
     pixman_image_t *		image;
     uint32_t *			buffer;
     int				x, y;
     int				width;
     int				height;
-    iter_flags_t		iter_flags;
-    uint32_t			image_flags;
+    iter_flags_t		flags;
 
     /* These function pointers are initialized by the implementation */
     pixman_iter_get_scanline_t	get_scanline;
     pixman_iter_write_back_t	write_back;
 
     /* These fields are scratch data that implementations can use */
-    void *			data;
     uint8_t *			bits;
     int				stride;
 };
 
 void
 _pixman_bits_image_setup_accessors (bits_image_t *image);
 
 void
@@ -545,42 +525,40 @@ void
 _pixman_implementation_src_iter_init (pixman_implementation_t       *imp,
 				      pixman_iter_t                 *iter,
 				      pixman_image_t                *image,
 				      int                            x,
 				      int                            y,
 				      int                            width,
 				      int                            height,
 				      uint8_t                       *buffer,
-				      iter_flags_t                   flags,
-				      uint32_t                       image_flags);
+				      iter_flags_t                   flags);
 
 void
 _pixman_implementation_dest_iter_init (pixman_implementation_t       *imp,
 				       pixman_iter_t                 *iter,
 				       pixman_image_t                *image,
 				       int                            x,
 				       int                            y,
 				       int                            width,
 				       int                            height,
 				       uint8_t                       *buffer,
-				       iter_flags_t                   flags,
-				       uint32_t                       image_flags);
+				       iter_flags_t                   flags);
 
 /* Specific implementations */
 pixman_implementation_t *
 _pixman_implementation_create_general (void);
 
 pixman_implementation_t *
 _pixman_implementation_create_fast_path (pixman_implementation_t *fallback);
 
 pixman_implementation_t *
 _pixman_implementation_create_noop (pixman_implementation_t *fallback);
 
-#if defined USE_X86_MMX || defined USE_ARM_IWMMXT || defined USE_LOONGSON_MMI
+#if defined USE_X86_MMX || defined USE_ARM_IWMMXT
 pixman_implementation_t *
 _pixman_implementation_create_mmx (pixman_implementation_t *fallback);
 #endif
 
 #ifdef USE_SSE2
 pixman_implementation_t *
 _pixman_implementation_create_sse2 (pixman_implementation_t *fallback);
 #endif
@@ -600,54 +578,24 @@ pixman_implementation_t *
 _pixman_implementation_create_mips_dspr2 (pixman_implementation_t *fallback);
 #endif
 
 #ifdef USE_VMX
 pixman_implementation_t *
 _pixman_implementation_create_vmx (pixman_implementation_t *fallback);
 #endif
 
-pixman_bool_t
-_pixman_implementation_disabled (const char *name);
-
-pixman_implementation_t *
-_pixman_x86_get_implementations (pixman_implementation_t *imp);
-
-pixman_implementation_t *
-_pixman_arm_get_implementations (pixman_implementation_t *imp);
-
-pixman_implementation_t *
-_pixman_ppc_get_implementations (pixman_implementation_t *imp);
-
-pixman_implementation_t *
-_pixman_mips_get_implementations (pixman_implementation_t *imp);
-
 pixman_implementation_t *
 _pixman_choose_implementation (void);
 
-pixman_bool_t
-_pixman_disabled (const char *name);
 
 
 /*
  * Utilities
  */
-pixman_bool_t
-_pixman_compute_composite_region32 (pixman_region32_t * region,
-				    pixman_image_t *    src_image,
-				    pixman_image_t *    mask_image,
-				    pixman_image_t *    dest_image,
-				    int32_t             src_x,
-				    int32_t             src_y,
-				    int32_t             mask_x,
-				    int32_t             mask_y,
-				    int32_t             dest_x,
-				    int32_t             dest_y,
-				    int32_t             width,
-				    int32_t             height);
 uint32_t *
 _pixman_iter_get_scanline_noop (pixman_iter_t *iter, const uint32_t *mask);
 
 /* These "formats" all have depth 0, so they
  * will never clash with any real ones
  */
 #define PIXMAN_null             PIXMAN_FORMAT (0, 0, 0, 0, 0, 0)
 #define PIXMAN_solid            PIXMAN_FORMAT (0, 1, 0, 0, 0, 0)
@@ -746,28 +694,16 @@ uint32_t *
 #define PIXMAN_STD_FAST_PATH_CA(op, src, mask, dest, func)		\
     { FAST_PATH (							\
 	    op,								\
 	    src,  SOURCE_FLAGS (src),					\
 	    mask, MASK_FLAGS (mask, FAST_PATH_COMPONENT_ALPHA),		\
 	    dest, FAST_PATH_STD_DEST_FLAGS,				\
 	    func) }
 
-extern pixman_implementation_t *global_implementation;
-
-static force_inline pixman_implementation_t *
-get_implementation (void)
-{
-#ifndef TOOLCHAIN_SUPPORTS_ATTRIBUTE_CONSTRUCTOR
-    if (!global_implementation)
-	global_implementation = _pixman_choose_implementation ();
-#endif
-    return global_implementation;
-}
-
 /* Memory allocation helpers */
 void *
 pixman_malloc_ab (unsigned int n, unsigned int b);
 
 void *
 pixman_malloc_abc (unsigned int a, unsigned int b, unsigned int c);
 
 pixman_bool_t
@@ -807,60 +743,16 @@ pixman_bool_t
 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);
 
-/* Doubly linked lists */
-typedef struct pixman_link_t pixman_link_t;
-struct pixman_link_t
-{
-    pixman_link_t *next;
-    pixman_link_t *prev;
-};
-
-typedef struct pixman_list_t pixman_list_t;
-struct pixman_list_t
-{
-    pixman_link_t *head;
-    pixman_link_t *tail;
-};
-
-static force_inline void
-pixman_list_init (pixman_list_t *list)
-{
-    list->head = (pixman_link_t *)list;
-    list->tail = (pixman_link_t *)list;
-}
-
-static force_inline void
-pixman_list_prepend (pixman_list_t *list, pixman_link_t *link)
-{
-    link->next = list->head;
-    link->prev = (pixman_link_t *)list;
-    list->head->prev = link;
-    list->head = link;
-}
-
-static force_inline void
-pixman_list_unlink (pixman_link_t *link)
-{
-    link->prev->next = link->next;
-    link->next->prev = link->prev;
-}
-
-static force_inline void
-pixman_list_move_to_front (pixman_list_t *list, pixman_link_t *link)
-{
-    pixman_list_unlink (link);
-    pixman_list_prepend (list, link);
-}
 
 /* Misc macros */
 
 #ifndef FALSE
 #   define FALSE 0
 #endif
 
 #ifndef TRUE
@@ -903,18 +795,17 @@ pixman_list_move_to_front (pixman_list_t
 #define CONVERT_8888_TO_8888(s) (s)
 #define CONVERT_x888_TO_8888(s) ((s) | 0xff000000)
 #define CONVERT_0565_TO_0565(s) (s)
 
 #define PIXMAN_FORMAT_IS_WIDE(f)					\
     (PIXMAN_FORMAT_A (f) > 8 ||						\
      PIXMAN_FORMAT_R (f) > 8 ||						\
      PIXMAN_FORMAT_G (f) > 8 ||						\
-     PIXMAN_FORMAT_B (f) > 8 ||						\
-     PIXMAN_FORMAT_TYPE (f) == PIXMAN_TYPE_ARGB_SRGB)
+     PIXMAN_FORMAT_B (f) > 8)
 
 #ifdef WORDS_BIGENDIAN
 #   define SCREEN_SHIFT_LEFT(x,n)	((x) << (n))
 #   define SCREEN_SHIFT_RIGHT(x,n)	((x) >> (n))
 #else
 #   define SCREEN_SHIFT_LEFT(x,n)	((x) >> (n))
 #   define SCREEN_SHIFT_RIGHT(x,n)	((x) << (n))
 #endif
@@ -1100,23 +991,9 @@ void pixman_timer_register (pixman_timer
 	begin ## tname = OIL_STAMP ();
 
 #define TIMER_END(tname)                                                \
     timer ## tname.total += OIL_STAMP () - begin ## tname;		\
     }
 
 #endif /* PIXMAN_TIMERS */
 
-/* sRGB<->linear conversion tables. Linear color space is the same
- * as sRGB but the components are in linear light (gamma 1.0).
- *
- * linear_to_srgb maps linear value from 0 to 4095 ([0.0, 1.0])
- * and returns 8-bit sRGB value.
- *
- * srgb_to_linear maps 8-bit sRGB value to 16-bit linear value
- * with range 0 to 65535 ([0.0, 1.0]).
- */
-extern const uint8_t linear_to_srgb[4096];
-extern const uint16_t srgb_to_linear[256];
-
-#endif /* __ASSEMBLER__ */
-
 #endif /* PIXMAN_PRIVATE_H */
--- a/gfx/cairo/libpixman/src/pixman-radial-gradient.c
+++ b/gfx/cairo/libpixman/src/pixman-radial-gradient.c
@@ -666,19 +666,19 @@ radial_get_scanline_wide (pixman_iter_t 
     pixman_expand ((uint64_t *)buffer, buffer, PIXMAN_a8r8g8b8, iter->width);
 
     return buffer;
 }
 
 void
 _pixman_radial_gradient_iter_init (pixman_image_t *image, pixman_iter_t *iter)
 {
-    if (iter->iter_flags & ITER_16)
+    if (iter->flags & ITER_16)
 	iter->get_scanline = radial_get_scanline_16;
-    else if (iter->iter_flags & ITER_NARROW)
+    else if (iter->flags & ITER_NARROW)
 	iter->get_scanline = radial_get_scanline_narrow;
     else
 	iter->get_scanline = radial_get_scanline_wide;
 }
 
 
 PIXMAN_EXPORT pixman_image_t *
 pixman_image_create_radial_gradient (pixman_point_fixed_t *        inner,
--- a/gfx/cairo/libpixman/src/pixman-region.c
+++ b/gfx/cairo/libpixman/src/pixman-region.c
@@ -2036,20 +2036,20 @@ PREFIX (_subtract) (region_type_t *reg_d
  * Results:
  *	TRUE.
  *
  * Side Effects:
  *	new_reg is overwritten.
  *
  *-----------------------------------------------------------------------
  */
-PIXMAN_EXPORT pixman_bool_t
-PREFIX (_inverse) (region_type_t *new_reg,  /* Destination region */
-		   region_type_t *reg1,     /* Region to invert */
-		   box_type_t *   inv_rect) /* Bounding box for inversion */
+pixman_bool_t
+PIXMAN_EXPORT PREFIX (_inverse) (region_type_t *new_reg,  /* Destination region */
+                                 region_type_t *reg1,     /* Region to invert */
+                                 box_type_t *   inv_rect) /* Bounding box for inversion */
 {
     region_type_t inv_reg; /* Quick and dirty region made from the
 			    * bounding box */
     int overlap;           /* result ignored */
 
     GOOD (reg1);
     GOOD (new_reg);
     
@@ -2132,19 +2132,19 @@ find_box_for_y (box_type_t *begin, box_t
  *   the region covers part of the box, part_in is set TRUE. The process ends
  *   when either the box has been completely covered (we reached a band that
  *   doesn't overlap the box, part_in is TRUE and part_out is false), the
  *   box has been partially covered (part_in == part_out == TRUE -- because of
  *   the banding, the first time this is true we know the box is only
  *   partially in the region) or is outside the region (we reached a band
  *   that doesn't overlap the box at all and part_in is false)
  */
-PIXMAN_EXPORT pixman_region_overlap_t
-PREFIX (_contains_rectangle) (region_type_t *  region,
-			      box_type_t *     prect)
+pixman_region_overlap_t
+PIXMAN_EXPORT PREFIX (_contains_rectangle) (region_type_t *  region,
+                                            box_type_t *     prect)
 {
     box_type_t *     pbox;
     box_type_t *     pbox_end;
     int part_in, part_out;
     int numRects;
     int x, y;
 
     GOOD (region);
--- a/gfx/cairo/libpixman/src/pixman-solid-fill.c
+++ b/gfx/cairo/libpixman/src/pixman-solid-fill.c
@@ -24,17 +24,17 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
 #include "pixman-private.h"
 
 void
 _pixman_solid_fill_iter_init (pixman_image_t *image, pixman_iter_t  *iter)
 {
-    if (iter->iter_flags & ITER_NARROW)
+    if (iter->flags & ITER_NARROW)
     {
 	uint32_t *b = (uint32_t *)iter->buffer;
 	uint32_t *e = b + iter->width;
 	uint32_t color = iter->image->solid.color_32;
 
 	while (b < e)
 	    *(b++) = color;
     }
deleted file mode 100644
--- a/gfx/cairo/libpixman/src/pixman-srgb.c
+++ /dev/null
@@ -1,455 +0,0 @@
-/* WARNING: This file is generated by make-srgb.pl.
- * Please edit that file instead of this one.
- */
-
-#include <stdint.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "pixman-private.h"
-
-const uint8_t linear_to_srgb[4096] =
-{
-	0, 1, 2, 2, 3, 4, 5, 6, 6, 7, 
-	8, 9, 10, 10, 11, 12, 13, 13, 14, 15, 
-	15, 16, 16, 17, 18, 18, 19, 19, 20, 20, 
-	21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 
-	25, 25, 26, 26, 27, 27, 27, 28, 28, 29, 
-	29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 
-	32, 33, 33, 33, 34, 34, 34, 34, 35, 35, 
-	35, 36, 36, 36, 37, 37, 37, 37, 38, 38, 
-	38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 
-	41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 
-	43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 
-	46, 46, 46, 46, 46, 47, 47, 47, 47, 48, 
-	48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 
-	50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 
-	52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 
-	54, 54, 54, 54, 55, 55, 55, 55, 55, 55, 
-	56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 
-	57, 58, 58, 58, 58, 58, 58, 59, 59, 59, 
-	59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 
-	61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 
-	62, 63, 63, 63, 63, 63, 63, 64, 64, 64, 
-	64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 
-	66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 
-	67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 
-	68, 69, 69, 69, 69, 69, 69, 69, 70, 70, 
-	70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 
-	71, 71, 72, 72, 72, 72, 72, 72, 72, 72, 
-	73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 
-	74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 
-	75, 75, 75, 76, 76, 76, 76, 76, 76, 76, 
-	77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 
-	78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 
-	79, 79, 79, 79, 79, 80, 80, 80, 80, 80, 
-	80, 80, 80, 81, 81, 81, 81, 81, 81, 81, 
-	81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 
-	83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 
-	84, 84, 84, 84, 84, 84, 84, 84, 85, 85, 
-	85, 85, 85, 85, 85, 85, 85, 86, 86, 86, 
-	86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 
-	87, 87, 87, 87, 87, 88, 88, 88, 88, 88, 
-	88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 
-	89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 
-	90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 
-	91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 
-	92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 
-	93, 93, 93, 93, 94, 94, 94, 94, 94, 94, 
-	94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 
-	95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 
-	96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 
-	97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 
-	98, 98, 98, 98, 98, 98, 99, 99, 99, 99, 
-	99, 99, 99, 99, 99, 99, 99, 100, 100, 100, 
-	100, 100, 100, 100, 100, 100, 100, 100, 101, 101, 
-	101, 101, 101, 101, 101, 101, 101, 101, 101, 102, 
-	102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 
-	103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 
-	103, 103, 104, 104, 104, 104, 104, 104, 104, 104, 
-	104, 104, 104, 105, 105, 105, 105, 105, 105, 105, 
-	105, 105, 105, 105, 105, 106, 106, 106, 106, 106, 
-	106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 
-	107, 107, 107, 107, 107, 107, 107, 107, 107, 108, 
-	108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 
-	108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 
-	109, 109, 109, 110, 110, 110, 110, 110, 110, 110, 
-	110, 110, 110, 110, 110, 111, 111, 111, 111, 111, 
-	111, 111, 111, 111, 111, 111, 111, 111, 112, 112, 
-	112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 
-	113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 
-	113, 113, 113, 114, 114, 114, 114, 114, 114, 114, 
-	114, 114, 114, 114, 114, 114, 115, 115, 115, 115, 
-	115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 
-	116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 
-	116, 116, 117, 117, 117, 117, 117, 117, 117, 117, 
-	117, 117, 117, 117, 117, 117, 118, 118, 118, 118, 
-	118, 118, 118, 118, 118, 118, 118, 118, 118, 119, 
-	119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 
-	119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 
-	120, 120, 120, 120, 120, 120, 120, 121, 121, 121, 
-	121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 
-	122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 
-	122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 
-	123, 123, 123, 123, 123, 123, 123, 123, 123, 124, 
-	124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 
-	124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 
-	125, 125, 125, 125, 125, 125, 125, 125, 126, 126, 
-	126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 
-	126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 
-	127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 
-	128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 
-	128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 
-	129, 129, 129, 129, 129, 129, 129, 130, 130, 130, 
-	130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 
-	130, 130, 131, 131, 131, 131, 131, 131, 131, 131, 
-	131, 131, 131, 131, 131, 131, 131, 131, 132, 132, 
-	132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 
-	132, 132, 132, 133, 133, 133, 133, 133, 133, 133, 
-	133, 133, 133, 133, 133, 133, 133, 133, 133, 134, 
-	134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 
-	134, 134, 134, 134, 134, 135, 135, 135, 135, 135, 
-	135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 
-	135, 136, 136, 136, 136, 136, 136, 136, 136, 136, 
-	136, 136, 136, 136, 136, 136, 136, 137, 137, 137, 
-	137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 
-	137, 137, 137, 138, 138, 138, 138, 138, 138, 138, 
-	138, 138, 138, 138, 138, 138, 138, 138, 138, 139, 
-	139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 
-	139, 139, 139, 139, 139, 139, 140, 140, 140, 140, 
-	140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 
-	140, 140, 140, 141, 141, 141, 141, 141, 141, 141, 
-	141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 
-	142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 
-	142, 142, 142, 142, 142, 142, 142, 143, 143, 143, 
-	143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 
-	143, 143, 143, 143, 144, 144, 144, 144, 144, 144, 
-	144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 
-	144, 145, 145, 145, 145, 145, 145, 145, 145, 145, 
-	145, 145, 145, 145, 145, 145, 145, 145, 145, 146, 
-	146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 
-	146, 146, 146, 146, 146, 146, 147, 147, 147, 147, 
-	147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 
-	147, 147, 147, 147, 148, 148, 148, 148, 148, 148, 
-	148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 
-	148, 148, 149, 149, 149, 149, 149, 149, 149, 149, 
-	149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 
-	150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 
-	150, 150, 150, 150, 150, 150, 150, 150, 150, 151, 
-	151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 
-	151, 151, 151, 151, 151, 151, 151, 152, 152, 152, 
-	152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 
-	152, 152, 152, 152, 152, 152, 153, 153, 153, 153, 
-	153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 
-	153, 153, 153, 153, 154, 154, 154, 154, 154, 154, 
-	154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 
-	154, 154, 154, 155, 155, 155, 155, 155, 155, 155, 
-	155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 
-	155, 155, 156, 156, 156, 156, 156, 156, 156, 156, 
-	156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 
-	156, 156, 157, 157, 157, 157, 157, 157, 157, 157, 
-	157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 
-	157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 
-	158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 
-	159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 
-	159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 
-	160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 
-	160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 
-	161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 
-	161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 
-	162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 
-	162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 
-	163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 
-	163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 
-	164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 
-	164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 
-	164, 165, 165, 165, 165, 165, 165, 165, 165, 165, 
-	165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 
-	165, 165, 166, 166, 166, 166, 166, 166, 166, 166, 
-	166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 
-	166, 166, 167, 167, 167, 167, 167, 167, 167, 167, 
-	167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 
-	167, 167, 167, 168, 168, 168, 168, 168, 168, 168, 
-	168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 
-	168, 168, 168, 168, 168, 169, 169, 169, 169, 169, 
-	169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 
-	169, 169, 169, 169, 169, 169, 170, 170, 170, 170, 
-	170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 
-	170, 170, 170, 170, 170, 170, 170, 171, 171, 171, 
-	171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 
-	171, 171, 171, 171, 171, 171, 171, 171, 171, 172, 
-	172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 
-	172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 
-	172, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
-	173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 
-	173, 173, 173, 174, 174, 174, 174, 174, 174, 174, 
-	174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 
-	174, 174, 174, 174, 174, 175, 175, 175, 175, 175, 
-	175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 
-	175, 175, 175, 175, 175, 175, 175, 176, 176, 176, 
-	176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 
-	176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 
-	177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 
-	177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 
-	177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 
-	178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 
-	178, 178, 178, 178, 178, 179, 179, 179, 179, 179, 
-	179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 
-	179, 179, 179, 179, 179, 179, 179, 179, 180, 180, 
-	180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 
-	180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 
-	180, 181, 181, 181, 181, 181, 181, 181, 181, 181, 
-	181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 
-	181, 181, 181, 181, 182, 182, 182, 182, 182, 182, 
-	182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 
-	182, 182, 182, 182, 182, 182, 182, 182, 183, 183, 
-	183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 
-	183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 
-	183, 184, 184, 184, 184, 184, 184, 184, 184, 184, 
-	184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 
-	184, 184, 184, 184, 184, 185, 185, 185, 185, 185, 
-	185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 
-	185, 185, 185, 185, 185, 185, 185, 185, 185, 186, 
-	186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 
-	186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 
-	186, 186, 186, 187, 187, 187, 187, 187, 187, 187, 
-	187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 
-	187, 187, 187, 187, 187, 187, 187, 187, 188, 188, 
-	188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 
-	188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 
-	188, 188, 189, 189, 189, 189, 189, 189, 189, 189, 
-	189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 
-	189, 189, 189, 189, 189, 189, 189, 190, 190, 190, 
-	190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 
-	190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 
-	190, 190, 191, 191, 191, 191, 191, 191, 191, 191, 
-	191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 
-	191, 191, 191, 191, 191, 191, 192, 192, 192, 192, 
-	192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 
-	192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 
-	192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 
-	193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 
-	193, 193, 193, 193, 193, 193, 193, 194, 194, 194, 
-	194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 
-	194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 
-	194, 194, 195, 195, 195, 195, 195, 195, 195, 195, 
-	195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 
-	195, 195, 195, 195, 195, 195, 195, 195, 196, 196, 
-	196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 
-	196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 
-	196, 196, 196, 196, 197, 197, 197, 197, 197, 197, 
-	197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 
-	197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 
-	198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 
-	198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 
-	198, 198, 198, 198, 198, 198, 199, 199, 199, 199, 
-	199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 
-	199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 
-	199, 199, 200, 200, 200, 200, 200, 200, 200, 200, 
-	200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 
-	200, 200, 200, 200, 200, 200, 200, 200, 200, 201, 
-	201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 
-	201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 
-	201, 201, 201, 201, 201, 201, 202, 202, 202, 202, 
-	202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 
-	202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 
-	202, 202, 202, 203, 203, 203, 203, 203, 203, 203, 
-	203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 
-	203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 
-	204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 
-	204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 
-	204, 204, 204, 204, 204, 204, 204, 205, 205, 205, 
-	205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 
-	205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 
-	205, 205, 205, 205, 206, 206, 206, 206, 206, 206, 
-	206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 
-	206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 
-	206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 
-	207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 
-	207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 
-	208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 
-	208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 
-	208, 208, 208, 208, 208, 208, 208, 209, 209, 209, 
-	209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 
-	209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 
-	209, 209, 209, 209, 209, 209, 210, 210, 210, 210, 
-	210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 
-	210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 
-	210, 210, 210, 210, 211, 211, 211, 211, 211, 211, 
-	211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 
-	211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 
-	211, 211, 212, 212, 212, 212, 212, 212, 212, 212, 
-	212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 
-	212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 
-	212, 213, 213, 213, 213, 213, 213, 213, 213, 213, 
-	213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 
-	213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 
-	214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 
-	214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 
-	214, 214, 214, 214, 214, 214, 214, 214, 214, 215, 
-	215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 
-	215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 
-	215, 215, 215, 215, 215, 215, 215, 215, 216, 216, 
-	216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 
-	216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 
-	216, 216, 216, 216, 216, 216, 216, 217, 217, 217, 
-	217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 
-	217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 
-	217, 217, 217, 217, 217, 217, 217, 218, 218, 218, 
-	218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 
-	218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 
-	218, 218, 218, 218, 218, 218, 219, 219, 219, 219, 
-	219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 
-	219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 
-	219, 219, 219, 219, 219, 219, 220, 220, 220, 220, 
-	220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 
-	220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 
-	220, 220, 220, 220, 220, 220, 221, 221, 221, 221, 
-	221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 
-	221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 
-	221, 221, 221, 221, 221, 221, 221, 222, 222, 222, 
-	222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 
-	222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 
-	222, 222, 222, 222, 222, 222, 222, 223, 223, 223, 
-	223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 
-	223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 
-	223, 223, 223, 223, 223, 223, 223, 223, 224, 224, 
-	224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 
-	224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 
-	224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 
-	225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 
-	225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 
-	225, 225, 225, 225, 225, 225, 225, 225, 225, 226, 
-	226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 
-	226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 
-	226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 
-	227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 
-	227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 
-	227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 
-	227, 227, 228, 228, 228, 228, 228, 228, 228, 228, 
-	228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 
-	228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 
-	228, 228, 228, 229, 229, 229, 229, 229, 229, 229, 
-	229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 
-	229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 
-	229, 229, 229, 229, 229, 230, 230, 230, 230, 230, 
-	230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 
-	230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 
-	230, 230, 230, 230, 230, 230, 230, 231, 231, 231, 
-	231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 
-	231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 
-	231, 231, 231, 231, 231, 231, 231, 231, 231, 232, 
-	232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 
-	232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 
-	232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 
-	232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 
-	233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 
-	233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 
-	233, 233, 233, 233, 234, 234, 234, 234, 234, 234, 
-	234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 
-	234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 
-	23