[Pixman] [PATCH 01/11] mmx: add store function and use it in add_8888_8888

Matt Turner mattst88 at gmail.com
Wed Mar 14 21:00:39 PDT 2012


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

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index f9efd73..7acec6f 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -368,10 +368,16 @@ pack8888 (__m64 lo, __m64 hi)
 }
 
 static force_inline void
+store (uint32_t *dest, __m64 v)
+{
+    *dest = _mm_cvtsi64_si32 (v);
+}
+
+static force_inline void
 store8888 (uint32_t *dest, __m64 v)
 {
     v = pack8888 (v, _mm_setzero_si64());
-    *dest = _mm_cvtsi64_si32 (v);
+    store (dest, v);
 }
 
 /* Expand 16 bits positioned at @pos (0-3) of a mmx register into
@@ -2851,8 +2857,8 @@ mmx_composite_add_8888_8888 (pixman_implementation_t *imp,
 
 	while (w && (unsigned long)dst & 7)
 	{
-	    *dst = _mm_cvtsi64_si32 (_mm_adds_pu8 (_mm_cvtsi32_si64 (*src),
-	                                           _mm_cvtsi32_si64 (*dst)));
+	    store (dst, _mm_adds_pu8 (_mm_cvtsi32_si64 (*src),
+	                              _mm_cvtsi32_si64 (*dst)));
 	    dst++;
 	    src++;
 	    w--;
@@ -2869,8 +2875,8 @@ mmx_composite_add_8888_8888 (pixman_implementation_t *imp,
 
 	if (w)
 	{
-	    *dst = _mm_cvtsi64_si32 (_mm_adds_pu8 (_mm_cvtsi32_si64 (*src),
-	                                           _mm_cvtsi32_si64 (*dst)));
+	    store (dst, _mm_adds_pu8 (_mm_cvtsi32_si64 (*src),
+	                              _mm_cvtsi32_si64 (*dst)));
 
 	}
     }
-- 
1.7.3.4



More information about the Pixman mailing list