diff options
Diffstat (limited to 'pixman')
-rw-r--r-- | pixman/pixman/config.h | 6 | ||||
-rw-r--r-- | pixman/pixman/makefile | 4 | ||||
-rw-r--r-- | pixman/pixman/pixman-compiler.h | 21 | ||||
-rw-r--r-- | pixman/pixman/pixman-glyph.c | 2 | ||||
-rw-r--r-- | pixman/pixman/pixman-implementation.c | 2 | ||||
-rw-r--r-- | pixman/pixman/pixman-inlines.h | 1 | ||||
-rw-r--r-- | pixman/pixman/pixman-mmx.c | 59 |
7 files changed, 31 insertions, 64 deletions
diff --git a/pixman/pixman/config.h b/pixman/pixman/config.h index b16bc8da4..ee9aef828 100644 --- a/pixman/pixman/config.h +++ b/pixman/pixman/config.h @@ -122,7 +122,7 @@ /* #undef TRANS_REOPEN */ /* use MMX compiler intrinsics */ -#define USE_X86_MMX 1 +/*#define USE_X86_MMX 1*/ /* Support UNIX socket connections */ #define UNIXCONN 1 @@ -134,7 +134,7 @@ #define USE_DYNAMIC_XCURSOR 1 /* use SSE2 compiler intrinsics */ -#define USE_SSE2 1 +/*#define USE_SSE2 1*/ /* use VMX compiler intrinsics */ #undef USE_VMX @@ -226,4 +226,4 @@ /* Support gzip for bitmap fonts */ #define X_GZIP_FONT_COMPRESSION 1 -#define __inline__ __inline
\ No newline at end of file +#define __inline__ __inline diff --git a/pixman/pixman/makefile b/pixman/pixman/makefile index 128b204a6..f971e5167 100644 --- a/pixman/pixman/makefile +++ b/pixman/pixman/makefile @@ -35,8 +35,12 @@ CSRCS = \ $(NULL) ## mmx code +ifndef IS64 CSRCS += pixman-mmx.c +DEFINES+=USE_X86_MMX +endif # sse2 code CSRCS += pixman-sse2.c +DEFINES+=USE_SSE2 diff --git a/pixman/pixman/pixman-compiler.h b/pixman/pixman/pixman-compiler.h index 949182d4f..38e855519 100644 --- a/pixman/pixman/pixman-compiler.h +++ b/pixman/pixman/pixman-compiler.h @@ -118,22 +118,13 @@ # define PIXMAN_GET_THREAD_LOCAL(name) \ (&name) -#elif defined(__MINGW32__) && !defined(__WIN64) +#elif defined(__MINGW32__) -/* We can't include <windows.h> as it causes carious clashes with - * identifiers in pixman, sigh. So just declare the functions we need - * here. - */ -extern long __stdcall InterlockedCompareExchange(long volatile *, long, long); -#define InterlockedCompareExchangePointer(d,e,c) \ - (void *)InterlockedCompareExchange((long volatile *)(d),(long)(e),(long)(c)) -extern int __stdcall TlsAlloc (void); -extern void * __stdcall TlsGetValue (unsigned); -extern int __stdcall TlsSetValue (unsigned, void *); -extern void * __stdcall CreateMutexA(void *, int, char *); -extern int __stdcall CloseHandle(void *); -extern unsigned __stdcall WaitForSingleObject (void *, unsigned); -extern int __stdcall ReleaseMutex (void *); +# define _NO_W32_PSEUDO_MODIFIERS +# include <windows.h> +#ifdef IN +#undef IN +#endif # define PIXMAN_DEFINE_THREAD_LOCAL(type, name) \ static volatile int tls_ ## name ## _initialized = 0; \ diff --git a/pixman/pixman/pixman-glyph.c b/pixman/pixman/pixman-glyph.c index 5a271b64b..2f7ea940b 100644 --- a/pixman/pixman/pixman-glyph.c +++ b/pixman/pixman/pixman-glyph.c @@ -88,7 +88,7 @@ hash (const void *font_key, const void *glyph_key) key = key + (key << 3) + (key << 11); key = key ^ (key >> 16); - return key; + return key&0xffffffff; } static glyph_t * diff --git a/pixman/pixman/pixman-implementation.c b/pixman/pixman/pixman-implementation.c index 160847ad0..7f1332abf 100644 --- a/pixman/pixman/pixman-implementation.c +++ b/pixman/pixman/pixman-implementation.c @@ -33,7 +33,7 @@ _pixman_implementation_create (pixman_implementation_t *fallback, { pixman_implementation_t *imp; - assert (fast_paths); + assert (fast_paths!=NULL); if ((imp = malloc (sizeof (pixman_implementation_t)))) { diff --git a/pixman/pixman/pixman-inlines.h b/pixman/pixman/pixman-inlines.h index ccb29b093..dd1c2f17f 100644 --- a/pixman/pixman/pixman-inlines.h +++ b/pixman/pixman/pixman-inlines.h @@ -1176,7 +1176,6 @@ fast_composite_scaled_bilinear ## scale_func_name (pixman_implementation_t *imp, weight1, weight2, vx, unit_x, max_vx, FALSE); \ } \ } \ - _mm_empty (); \ } /* A workaround for old sun studio, see: https://bugs.freedesktop.org/show_bug.cgi?id=32764 */ diff --git a/pixman/pixman/pixman-mmx.c b/pixman/pixman/pixman-mmx.c index ed5107321..d30d36a6d 100644 --- a/pixman/pixman/pixman-mmx.c +++ b/pixman/pixman/pixman-mmx.c @@ -59,7 +59,7 @@ _mm_empty (void) } #endif -#if defined __GNUC__ && defined USE_X86_MMX +#ifdef USE_X86_MMX # if (defined(__SUNPRO_C) || defined(_MSC_VER) || defined(_WIN64)) # include <xmmintrin.h> # else @@ -116,17 +116,13 @@ _mm_shuffle_pi16 (__m64 __A, int8_t const __N) }) # endif # endif +#endif #ifndef _MSC_VER #define _MM_SHUFFLE(fp3,fp2,fp1,fp0) \ (((fp3) << 6) | ((fp2) << 4) | ((fp1) << 2) | (fp0)) #endif -#else -#include <xmmintrin.h> /* for _mm_shuffle_pi16 and _MM_SHUFFLE */ -#include <emmintrin.h> /* for SSE2 intrinsics */ -#endif - /* Notes about writing mmx code * * give memory operands as the second operand. If you give it as the @@ -272,9 +268,6 @@ 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) { @@ -289,7 +282,6 @@ to_uint64 (__m64 x) return (uint64_t)x; #endif } -#endif static force_inline __m64 shift (__m64 v, @@ -476,11 +468,6 @@ pack8888 (__m64 lo, __m64 hi) return _mm_packs_pu16 (lo, hi); } -#ifdef _MSC_VER -#define store8888(dest,v) *(dest)=_mm_cvtsi64_si32 (pack8888 (v, _mm_setzero_si64 ())) -#define store(dest,v) *(dest) = _mm_cvtsi64_si32 (v) -#else - static force_inline void store (uint32_t *dest, __m64 v) { @@ -501,7 +488,6 @@ store8888 (uint32_t *dest, __m64 v) v = pack8888 (v, _mm_setzero_si64 ()); store (dest, v); } -#endif static force_inline pixman_bool_t is_equal (__m64 a, __m64 b) @@ -510,9 +496,7 @@ is_equal (__m64 a, __m64 b) /* __m64 is double, we can compare directly. */ return a == b; #else - pixman_bool_t ret = _mm_movemask_pi8 (_mm_cmpeq_pi8 (a, b)) == 0xff; - _mm_empty(); - return ret; + return _mm_movemask_pi8 (_mm_cmpeq_pi8 (a, b)) == 0xff; #endif } @@ -523,21 +507,15 @@ is_opaque (__m64 v) return is_equal (_mm_and_si64 (v, MC (full_alpha)), MC (full_alpha)); #else __m64 ffs = _mm_cmpeq_pi8 (v, v); - pixman_bool_t ret = (_mm_movemask_pi8 (_mm_cmpeq_pi8 (v, ffs)) & 0x40); - _mm_empty(); - return ret; + return (_mm_movemask_pi8 (_mm_cmpeq_pi8 (v, ffs)) & 0x40); #endif } -#ifdef _MSC_VER -#define is_zero(v) is_equal (v, _mm_setzero_si64 ()) -#else static force_inline pixman_bool_t is_zero (__m64 v) { return is_equal (v, _mm_setzero_si64 ()); } -#endif /* Expand 16 bits positioned at @pos (0-3) of a mmx register into * @@ -605,7 +583,6 @@ expand_4xpacked565 (__m64 vin, __m64 *vout0, __m64 *vout1, int full_alpha) *vout0 = _mm_unpacklo_pi16 (t0, t1); /* A1 R1 G1 B1 A0 R0 G0 B0 */ *vout1 = _mm_unpackhi_pi16 (t0, t1); /* A3 R3 G3 B3 A2 R2 G2 B2 */ - _mm_empty(); } static force_inline __m64 @@ -632,7 +609,6 @@ expand_4x565 (__m64 vin, __m64 *vout0, __m64 *vout1, __m64 *vout2, __m64 *vout3, *vout1 = expand8888 (v0, 1); *vout2 = expand8888 (v1, 0); *vout3 = expand8888 (v1, 1); - _mm_empty(); } static force_inline __m64 @@ -3594,44 +3570,41 @@ mmx_composite_over_reverse_n_8888 (pixman_implementation_t *imp, #define BILINEAR_INTERPOLATE_ONE_PIXEL(pix) \ do { \ - __m64 t_hi, t_lo, b_hi, b_lo, hi, lo; \ /* fetch 2x2 pixel block into 2 mmx registers */ \ __m64 t = ldq_u ((__m64 *)&src_top [pixman_fixed_to_int (vx)]); \ __m64 b = ldq_u ((__m64 *)&src_bottom [pixman_fixed_to_int (vx)]); \ /* vertical interpolation */ \ - t_hi = _mm_mullo_pi16 (_mm_unpackhi_pi8 (t, mm_zero), mm_wt); \ - t_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (t, mm_zero), mm_wt); \ - b_hi = _mm_mullo_pi16 (_mm_unpackhi_pi8 (b, mm_zero), mm_wb); \ - b_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (b, mm_zero), mm_wb); \ - hi = _mm_add_pi16 (t_hi, b_hi); \ - lo = _mm_add_pi16 (t_lo, b_lo); \ + __m64 t_hi = _mm_mullo_pi16 (_mm_unpackhi_pi8 (t, mm_zero), mm_wt); \ + __m64 t_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (t, mm_zero), mm_wt); \ + __m64 b_hi = _mm_mullo_pi16 (_mm_unpackhi_pi8 (b, mm_zero), mm_wb); \ + __m64 b_lo = _mm_mullo_pi16 (_mm_unpacklo_pi8 (b, mm_zero), mm_wb); \ + __m64 hi = _mm_add_pi16 (t_hi, b_hi); \ + __m64 lo = _mm_add_pi16 (t_lo, b_lo); \ vx += unit_x; \ if (BILINEAR_INTERPOLATION_BITS < 8) \ { \ - __m64 p, q; \ /* calculate horizontal weights */ \ __m64 mm_wh = _mm_add_pi16 (mm_addc7, _mm_xor_si64 (mm_xorc7, \ _mm_srli_pi16 (mm_x, \ 16 - BILINEAR_INTERPOLATION_BITS))); \ /* horizontal interpolation */ \ - p = _mm_unpacklo_pi16 (lo, hi); \ - q = _mm_unpackhi_pi16 (lo, hi); \ + __m64 p = _mm_unpacklo_pi16 (lo, hi); \ + __m64 q = _mm_unpackhi_pi16 (lo, hi); \ lo = _mm_madd_pi16 (p, mm_wh); \ hi = _mm_madd_pi16 (q, mm_wh); \ } \ else \ { \ - __m64 mm_lo_lo, mm_lo_hi, mm_hi_lo, mm_hi_hi; \ /* calculate horizontal weights */ \ __m64 mm_wh_lo = _mm_sub_pi16 (mm_BSHIFT, _mm_srli_pi16 (mm_x, \ 16 - BILINEAR_INTERPOLATION_BITS)); \ __m64 mm_wh_hi = _mm_srli_pi16 (mm_x, \ 16 - BILINEAR_INTERPOLATION_BITS); \ /* horizontal interpolation */ \ - mm_lo_lo = _mm_mullo_pi16 (lo, mm_wh_lo); \ - mm_lo_hi = _mm_mullo_pi16 (hi, mm_wh_hi); \ - mm_hi_lo = _mm_mulhi_pu16 (lo, mm_wh_lo); \ - mm_hi_hi = _mm_mulhi_pu16 (hi, mm_wh_hi); \ + __m64 mm_lo_lo = _mm_mullo_pi16 (lo, mm_wh_lo); \ + __m64 mm_lo_hi = _mm_mullo_pi16 (hi, mm_wh_hi); \ + __m64 mm_hi_lo = _mm_mulhi_pu16 (lo, mm_wh_lo); \ + __m64 mm_hi_hi = _mm_mulhi_pu16 (hi, mm_wh_hi); \ lo = _mm_add_pi32 (_mm_unpacklo_pi16 (mm_lo_lo, mm_hi_lo), \ _mm_unpacklo_pi16 (mm_lo_hi, mm_hi_hi)); \ hi = _mm_add_pi32 (_mm_unpackhi_pi16 (mm_lo_lo, mm_hi_lo), \ |