diff options
author | Matt Turner <mattst88@gmail.com> | 2012-02-24 12:34:41 -0500 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2012-04-27 13:34:53 -0400 |
commit | 2e54b76a2d2203b6a70190f488d76d6d409e879a (patch) | |
tree | 99d0a1363495fcb6e839861c271d4cd57274a906 | |
parent | 084e3f2f4be900041cc35830359606addc1fc3be (diff) |
mmx: add load function and use it in add_8888_8888
-rw-r--r-- | 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 36cf2cd3..f8dfca77 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -356,9 +356,15 @@ static force_inline uint32_t ldl_u(const uint32_t *p) } static force_inline __m64 +load (const uint32_t *v) +{ + return _mm_cvtsi32_si64 (*v); +} + +static force_inline __m64 load8888 (const uint32_t *v) { - return _mm_unpacklo_pi8 (_mm_cvtsi32_si64 (*v), _mm_setzero_si64 ()); + return _mm_unpacklo_pi8 (load (v), _mm_setzero_si64 ()); } static force_inline __m64 @@ -2864,8 +2870,8 @@ mmx_composite_add_8888_8888 (pixman_implementation_t *imp, while (w && (unsigned long)dst & 7) { - store (dst, _mm_adds_pu8 (_mm_cvtsi32_si64 (*src), - _mm_cvtsi32_si64 (*dst))); + store (dst, _mm_adds_pu8 (load ((const uint32_t *)src), + load ((const uint32_t *)dst))); dst++; src++; w--; @@ -2882,8 +2888,8 @@ mmx_composite_add_8888_8888 (pixman_implementation_t *imp, if (w) { - store (dst, _mm_adds_pu8 (_mm_cvtsi32_si64 (*src), - _mm_cvtsi32_si64 (*dst))); + store (dst, _mm_adds_pu8 (load ((const uint32_t *)src), + load ((const uint32_t *)dst))); } } |