diff options
author | root <root@yeeloong.(none)> | 2012-02-22 13:40:50 -0500 |
---|---|---|
committer | root <root@yeeloong.(none)> | 2012-02-22 18:52:03 -0500 |
commit | 1bd2130a0a337456c582bc75c454b767707bd9a1 (patch) | |
tree | 6bbc2f30c91338c61ed62c1a1b59bfaa47caab09 | |
parent | 1277771125e4ab9eab0f059bf405184ebe91d98f (diff) |
optimize add_8888_8888
-dmtc1: 89
+dmtc1: 85
-lwc1: 91
+lwc1: 95
-lwu: 6
+lwu: 2
Conflicts:
pixman/pixman-mmx.c
-rw-r--r-- | pixman/pixman-mmx.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index d1e9c3e..1d18529 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -358,6 +358,17 @@ static __inline__ uint32_t ldl_u(uint32_t *p) } static force_inline __m64 +load (const uint32_t *v) +{ + __m64 ret; + asm("lwc1 %0, %1\n\t" + : "=f" (ret) + : "m" (*v) + ); + return ret; +} + +static force_inline __m64 load8888 (const uint32_t *v) { #ifdef USE_LOONGSON_SIMD @@ -2882,8 +2893,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--; @@ -2900,8 +2911,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))); } } |