[Pixman] [PATCH 2/2] sse2, mmx: Remove initial unaligned loops in fetchers

Søren Sandmann sandmann at cs.au.dk
Wed Aug 28 13:01:27 PDT 2013


From: Søren Sandmann Pedersen <ssp at redhat.com>

Now that the general implementation guarantees that the iter buffers
are aligned to 16 bytes, there is no longer any reason for the initial
loop to bring the destination buffer up to an aligned position.
---
 pixman/pixman-mmx.c  |   20 --------------------
 pixman/pixman-sse2.c |   20 --------------------
 2 files changed, 0 insertions(+), 40 deletions(-)

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index c94d282..abf40f2 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -3799,12 +3799,6 @@ mmx_fetch_x8r8g8b8 (pixman_iter_t *iter, const uint32_t *mask)
 
     iter->bits += iter->stride;
 
-    while (w && ((uintptr_t)dst) & 7)
-    {
-	*dst++ = (*src++) | 0xff000000;
-	w--;
-    }
-
     while (w >= 8)
     {
 	__m64 vsrc1 = ldq_u ((__m64 *)(src + 0));
@@ -3841,14 +3835,6 @@ mmx_fetch_r5g6b5 (pixman_iter_t *iter, const uint32_t *mask)
 
     iter->bits += iter->stride;
 
-    while (w && ((uintptr_t)dst) & 0x0f)
-    {
-	uint16_t s = *src++;
-
-	*dst++ = convert_0565_to_8888 (s);
-	w--;
-    }
-
     while (w >= 4)
     {
 	__m64 vsrc = ldq_u ((__m64 *)src);
@@ -3885,12 +3871,6 @@ mmx_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
 
     iter->bits += iter->stride;
 
-    while (w && (((uintptr_t)dst) & 15))
-    {
-        *dst++ = *(src++) << 24;
-        w--;
-    }
-
     while (w >= 8)
     {
 	__m64 mm0 = ldq_u ((__m64 *)src);
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index dde9235..8634915 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -6222,12 +6222,6 @@ sse2_fetch_x8r8g8b8 (pixman_iter_t *iter, const uint32_t *mask)
 
     iter->bits += iter->stride;
 
-    while (w && ((uintptr_t)dst) & 0x0f)
-    {
-	*dst++ = (*src++) | 0xff000000;
-	w--;
-    }
-
     while (w >= 4)
     {
 	save_128_aligned (
@@ -6258,14 +6252,6 @@ sse2_fetch_r5g6b5 (pixman_iter_t *iter, const uint32_t *mask)
 
     iter->bits += iter->stride;
 
-    while (w && ((uintptr_t)dst) & 0x0f)
-    {
-	uint16_t s = *src++;
-
-	*dst++ = convert_0565_to_8888 (s);
-	w--;
-    }
-
     while (w >= 8)
     {
 	__m128i lo, hi, s;
@@ -6304,12 +6290,6 @@ sse2_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
 
     iter->bits += iter->stride;
 
-    while (w && (((uintptr_t)dst) & 15))
-    {
-        *dst++ = *(src++) << 24;
-        w--;
-    }
-
     while (w >= 16)
     {
 	xmm0 = _mm_loadu_si128((__m128i *)src);
-- 
1.7.1



More information about the Pixman mailing list