diff options
author | Matt Turner <mattst88@gmail.com> | 2012-02-22 16:25:12 -0500 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2012-02-22 16:25:12 -0500 |
commit | 11c9f96509f6a72eb2edad1262a5f42c5ef12498 (patch) | |
tree | 5295505b6314f99262dbee2881a4dbe10255f41c | |
parent | a2ec7807a434418fe98983c2aebab1781c72506d (diff) |
fix up on x86loongson-wip2
-rw-r--r-- | pixman/pixman-mmx.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c index 687d8f6..dc66e4d 100644 --- a/pixman/pixman-mmx.c +++ b/pixman/pixman-mmx.c @@ -360,12 +360,16 @@ static __inline__ uint32_t ldl_u(uint32_t *p) static force_inline __m64 load (const uint32_t *v) { +#ifdef USE_LOONGSON_SIMD __m64 ret; asm("lwc1 %0, %1\n\t" : "=f" (ret) : "m" (*v) ); return ret; +#else + return _mm_cvtsi32_si64 (*v); +#endif } static force_inline __m64 @@ -377,7 +381,11 @@ load8888r (uint32_t v) static force_inline __m64 load8888 (const uint32_t *v) { +#ifdef USE_LOONGSON_SIMD return _mm_unpacklo_pi8_f (*(__m32 *)v, _mm_setzero_si64 ()); +#else + return _mm_unpacklo_pi8 (_mm_cvtsi32_si64 (*v), _mm_setzero_si64 ()); +#endif } static force_inline __m64 @@ -390,21 +398,29 @@ static force_inline void store8888 (uint32_t *dest, __m64 v) { v = pack8888 (v, _mm_setzero_si64()); +#ifdef USE_LOONGSON_SIMD asm("swc1 %1, %0\n\t" : "=m" (*dest) : "f" (v) : "memory" ); +#else + *dest = _mm_cvtsi64_si32 (v); +#endif } static force_inline void store (uint32_t *dest, __m64 v) { +#ifdef USE_LOONGSON_SIMD asm("swc1 %1, %0\n\t" : "=m" (*dest) : "f" (v) : "memory" ); +#else + *dest = _mm_cvtsi64_si32 (v); +#endif } /* Expand 16 bits positioned at @pos (0-3) of a mmx register into |