diff options
Diffstat (limited to 'pixman/pixman/pixman-mmx.c')
-rw-r--r-- | pixman/pixman/pixman-mmx.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/pixman/pixman/pixman-mmx.c b/pixman/pixman/pixman-mmx.c index 027234773..88442f70e 100644 --- a/pixman/pixman/pixman-mmx.c +++ b/pixman/pixman/pixman-mmx.c @@ -152,6 +152,9 @@ to_m64 (uint64_t x) #endif } +#ifdef _MSC_VER +#define to_uint64(arg) arg.M64_MEMBER +#else static force_inline uint64_t to_uint64 (__m64 x) { @@ -164,6 +167,7 @@ to_uint64 (__m64 x) return (uint64_t)x; #endif } +#endif static force_inline __m64 shift (__m64 v, @@ -310,11 +314,15 @@ pack8888 (__m64 lo, __m64 hi) return _mm_packs_pu16 (lo, hi); } +#ifdef _MSC_VER +#define store8888(v) _mm_cvtsi64_si32 (pack8888 (v, _mm_setzero_si64 ())) +#else static force_inline uint32_t store8888 (__m64 v) { return _mm_cvtsi64_si32 (pack8888 (v, _mm_setzero_si64 ())); } +#endif /* Expand 16 bits positioned at @pos (0-3) of a mmx register into * @@ -417,6 +425,13 @@ pix_add_mul (__m64 x, __m64 a, __m64 y, __m64 b) /* --------------- MMX code patch for fbcompose.c --------------------- */ +#ifdef _MSC_VER +#define combine(src, mask) \ + ((mask) ? \ + store8888 (pix_multiply (load8888 (*src), expand_alpha (load8888 (*mask)))) \ + : \ + *src) +#else static force_inline uint32_t combine (const uint32_t *src, const uint32_t *mask) { @@ -435,6 +450,7 @@ combine (const uint32_t *src, const uint32_t *mask) return ssrc; } +#endif static void mmx_combine_over_u (pixman_implementation_t *imp, @@ -1685,7 +1701,7 @@ mmx_composite_over_8888_0565 (pixman_implementation_t *imp, vdest = pack_565 ( over (vsrc, expand_alpha (vsrc), vdest), vdest, 0); - *dst = to_uint64 (vdest); + *dst = to_uint64 (vdest)&0xffff; w--; dst++; @@ -1728,7 +1744,7 @@ mmx_composite_over_8888_0565 (pixman_implementation_t *imp, vdest = pack_565 (over (vsrc, expand_alpha (vsrc), vdest), vdest, 0); - *dst = to_uint64 (vdest); + *dst = to_uint64 (vdest) & 0xffff; w--; dst++; @@ -1943,7 +1959,7 @@ pixman_fill_mmx (uint32_t *bits, while (w >= 2 && ((unsigned long)d & 3)) { - *(uint16_t *)d = xor; + *(uint16_t *)d = (xor & 0xffff); w -= 2; d += 2; } @@ -1996,7 +2012,7 @@ pixman_fill_mmx (uint32_t *bits, } while (w >= 2) { - *(uint16_t *)d = xor; + *(uint16_t *)d = (xor & 0xffff); w -= 2; d += 2; } |