[Pixman] [PATCH 3/3] mmx: define and use load8888u function

Matt Turner mattst88 at gmail.com
Wed Feb 22 15:27:40 PST 2012


For unaligned loads.

This will be squash-merged with the previous patch.

Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
 pixman/pixman-mmx.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index fe091a2..bd44f63 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -351,6 +351,13 @@ load8888 (const uint32_t *v)
 }
 
 static force_inline __m64
+load8888u (const uint32_t *v)
+{
+    uint32_t l = ldl_u(v);
+    return load8888(&l);
+}
+
+static force_inline __m64
 pack8888 (__m64 lo, __m64 hi)
 {
     return _mm_packs_pu16 (lo, hi);
@@ -2570,7 +2577,7 @@ mmx_composite_in_n_8_8 (pixman_implementation_t *imp,
 	    __m64 vmask;
 	    __m64 vdest;
 
-	    vmask = load8888 ((uint32_t *)mask);
+	    vmask = load8888u ((uint32_t *)mask);
 	    vdest = load8888 ((uint32_t *)dst);
 
 	    store8888 ((uint32_t *)dst, in (in (vsrca, vmask), vdest));
@@ -2640,7 +2647,7 @@ mmx_composite_in_8_8 (pixman_implementation_t *imp,
 	    uint32_t *s = (uint32_t *)src;
 	    uint32_t *d = (uint32_t *)dst;
 
-	    store8888 (d, in (load8888 ((uint32_t *)s), load8888 (d)));
+	    store8888 (d, in (load8888u (s), load8888 (d)));
 
 	    w -= 4;
 	    dst += 4;
@@ -2721,7 +2728,7 @@ mmx_composite_add_n_8_8 (pixman_implementation_t *imp,
 	    __m64 vmask;
 	    __m64 vdest;
 
-	    vmask = load8888 ((uint32_t *)mask);
+	    vmask = load8888u ((uint32_t *)mask);
 	    vdest = load8888 ((uint32_t *)dst);
 
 	    store8888 ((uint32_t *)dst, _mm_adds_pu8 (in (vsrca, vmask), vdest));
-- 
1.7.3.4



More information about the Pixman mailing list