[cairo] [PATCH] pixman: Cleanup inline definitions

Jeff Muizelaar jeff at infidigm.net
Mon Oct 27 16:24:11 PDT 2008


commit 44bc6bc0b0dd82fed39ef2e067b8089b217c6cc7
Author: Jeff Muizelaar <jmuizelaar at mozilla.com>
Date:   Mon Oct 27 15:50:51 2008 -0700

    Cleanup inline definitions
    
    Replace all inline definitions with a common one in pixman-private.h. Also,
    add 'force_inline' and replace all existing uses of 'inline' as a forced inline
    with 'force_inline'.

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index a856fe4..caeeafc 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -145,16 +145,13 @@ static const MMXData c =
 #    else
 #        define MC(x) ((__m64)c.mmx_##x)
 #    endif
-#    define inline __inline__ __attribute__ ((__always_inline__))
 #endif
 
 #ifdef _MSC_VER
 #    define MC(x) c.mmx_##x
-#    undef inline
-#    define inline __forceinline
 #endif
 
-static inline __m64
+static force_inline __m64
 M64 (ullong x)
 {
 #ifdef __ICC
@@ -171,7 +168,7 @@ M64 (ullong x)
 #endif
 }
 
-static inline ullong
+static force_inline ullong
 ULLONG (__m64 x)
 {
 #ifdef __ICC
@@ -188,7 +185,7 @@ ULLONG (__m64 x)
 #endif
 }
 
-static inline __m64
+static force_inline __m64
 shift (__m64 v, int s)
 {
     if (s > 0)
@@ -199,13 +196,13 @@ shift (__m64 v, int s)
 	return v;
 }
 
-static inline __m64
+static force_inline __m64
 negate (__m64 mask)
 {
     return _mm_xor_si64 (mask, MC(4x00ff));
 }
 
-static inline __m64
+static force_inline __m64
 pix_multiply (__m64 a, __m64 b)
 {
     __m64 res;
@@ -218,13 +215,13 @@ pix_multiply (__m64 a, __m64 b)
     return res;
 }
 
-static inline __m64
+static force_inline __m64
 pix_add (__m64 a, __m64 b)
 {
     return  _mm_adds_pu8 (a, b);
 }
 
-static inline __m64
+static force_inline __m64
 expand_alpha (__m64 pixel)
 {
     __m64 t1, t2;
@@ -238,7 +235,7 @@ expand_alpha (__m64 pixel)
     return t1;
 }
 
-static inline __m64
+static force_inline __m64
 expand_alpha_rev (__m64 pixel)
 {
     __m64 t1, t2;
@@ -255,7 +252,7 @@ expand_alpha_rev (__m64 pixel)
     return t1;
 }
 
-static inline __m64
+static force_inline __m64
 invert_colors (__m64 pixel)
 {
     __m64 x, y, z;
@@ -275,13 +272,13 @@ invert_colors (__m64 pixel)
     return x;
 }
 
-static inline __m64
+static force_inline __m64
 over (__m64 src, __m64 srca, __m64 dest)
 {
     return  _mm_adds_pu8 (src, pix_multiply(dest, negate(srca)));
 }
 
-static inline __m64
+static force_inline __m64
 over_rev_non_pre (__m64 src, __m64 dest)
 {
     __m64 srca = expand_alpha (src);
@@ -290,14 +287,14 @@ over_rev_non_pre (__m64 src, __m64 dest)
     return over(pix_multiply(invert_colors(src), srcfaaa), srca, dest);
 }
 
-static inline __m64
+static force_inline __m64
 in (__m64 src,
     __m64 mask)
 {
     return pix_multiply (src, mask);
 }
 
-static inline __m64
+static force_inline __m64
 in_over_full_src_alpha (__m64 src, __m64 mask, __m64 dest)
 {
     src = _mm_or_si64 (src, MC(full_alpha));
@@ -306,7 +303,7 @@ in_over_full_src_alpha (__m64 src, __m64 mask, __m64 dest)
 }
 
 #ifndef _MSC_VER
-static inline __m64
+static force_inline __m64
 in_over (__m64 src,
 	 __m64 srca,
 	 __m64 mask,
@@ -318,19 +315,19 @@ in_over (__m64 src,
 #define in_over(src, srca, mask, dest) over(in(src, mask), pix_multiply(srca, mask), dest)
 #endif
 
-static inline __m64
+static force_inline __m64
 load8888 (uint32_t v)
 {
     return _mm_unpacklo_pi8 (_mm_cvtsi32_si64 (v), _mm_setzero_si64());
 }
 
-static inline __m64
+static force_inline __m64
 pack8888 (__m64 lo, __m64 hi)
 {
     return _mm_packs_pu16 (lo, hi);
 }
 
-static inline uint32_t
+static force_inline uint32_t
 store8888 (__m64 v)
 {
     return _mm_cvtsi64_si32(pack8888(v, _mm_setzero_si64()));
@@ -350,7 +347,7 @@ store8888 (__m64 v)
  * Note the trick here - the top word is shifted by another nibble to
  * avoid it bumping into the middle word
  */
-static inline __m64
+static force_inline __m64
 expand565 (__m64 pixel, int pos)
 {
     __m64 p = pixel;
@@ -370,7 +367,7 @@ expand565 (__m64 pixel, int pos)
     return _mm_srli_pi16 (pixel, 8);
 }
 
-static inline __m64
+static force_inline __m64
 expand8888 (__m64 in, int pos)
 {
     if (pos == 0)
@@ -379,13 +376,13 @@ expand8888 (__m64 in, int pos)
 	return _mm_unpackhi_pi8 (in, _mm_setzero_si64());
 }
 
-static inline __m64
+static force_inline __m64
 expandx888 (__m64 in, int pos)
 {
     return _mm_or_si64 (expand8888 (in, pos), MC(full_alpha));
 }
 
-static inline __m64
+static force_inline __m64
 pack565 (__m64 pixel, __m64 target, int pos)
 {
     __m64 p = pixel;
@@ -416,7 +413,7 @@ pack565 (__m64 pixel, __m64 target, int pos)
 }
 
 #ifndef _MSC_VER
-static inline __m64
+static force_inline __m64
 pix_add_mul (__m64 x, __m64 a, __m64 y, __m64 b)
 {
     x = _mm_mullo_pi16 (x, a);
diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index 070b190..cc915d5 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -37,10 +37,6 @@
 #include "pixman-arm.h"
 #include "pixman-combine32.h"
 
-#ifdef __GNUC__
-#   define inline __inline__ __attribute__ ((__always_inline__))
-#endif
-
 #define FbFullMask(n)   ((n) == 32 ? (uint32_t)-1 : ((((uint32_t) 1) << n) - 1))
 
 #undef READ
@@ -53,7 +49,7 @@ typedef void (* CompositeFunc) (pixman_op_t,
 				int16_t, int16_t, int16_t, int16_t, int16_t, int16_t,
 				uint16_t, uint16_t);
 
-static inline uint32_t
+static force_inline uint32_t
 fbOver (uint32_t src, uint32_t dest)
 {
     // dest = (dest * (255 - alpha)) / 255 + src
diff --git a/pixman/pixman-private.h b/pixman/pixman-private.h
index e26a0c3..76cfaa3 100644
--- a/pixman/pixman-private.h
+++ b/pixman/pixman-private.h
@@ -67,7 +67,12 @@
 #endif
 
 #ifdef _MSC_VER
-#define inline __inline
+/* 'inline' is available only in C++ in MSVC */
+#   define inline __inline
+#   define force_inline __forceinline
+#elif defined __GNUC__
+#   define inline __inline__
+#   define force_inline __inline__ __attribute__ ((__always_inline__))
 #endif
 
 #define FB_SHIFT    5
diff --git a/pixman/pixman-sse2.c b/pixman/pixman-sse2.c
index 6890f5f..92872d0 100644
--- a/pixman/pixman-sse2.c
+++ b/pixman/pixman-sse2.c
@@ -38,15 +38,6 @@
 
 #ifdef USE_SSE2
 
-#ifdef _MSC_VER
-#undef inline
-#define inline __forceinline
-#endif
-
-#ifdef __GNUC__
-#    define inline __inline__ __attribute__ ((__always_inline__))
-#endif
-
 /* -------------------------------------------------------------------------------------------------
  * Locals
  */
@@ -79,20 +70,20 @@ static __m128i Mask565FixG;
 /* -------------------------------------------------------------------------------------------------
  * SSE2 Inlines
  */
-static inline __m128i
+static force_inline __m128i
 unpack_32_1x128 (uint32_t data)
 {
     return _mm_unpacklo_epi8 (_mm_cvtsi32_si128 (data), _mm_setzero_si128());
 }
 
-static inline void
+static force_inline void
 unpack_128_2x128 (__m128i data, __m128i* dataLo, __m128i* dataHi)
 {
     *dataLo = _mm_unpacklo_epi8 (data, _mm_setzero_si128 ());
     *dataHi = _mm_unpackhi_epi8 (data, _mm_setzero_si128 ());
 }
 
-static inline __m128i
+static force_inline __m128i
 unpack565to8888 (__m128i lo)
 {
     __m128i r, g, b, rb, t;
@@ -113,7 +104,7 @@ unpack565to8888 (__m128i lo)
     return _mm_or_si128 (rb, g);
 }
 
-static inline void
+static force_inline void
 unpack565_128_4x128 (__m128i data, __m128i* data0, __m128i* data1, __m128i* data2, __m128i* data3)
 {
     __m128i lo, hi;
@@ -128,19 +119,19 @@ unpack565_128_4x128 (__m128i data, __m128i* data0, __m128i* data1, __m128i* data
     unpack_128_2x128 (hi, data2, data3);
 }
 
-static inline uint16_t
+static force_inline uint16_t
 pack565_32_16 (uint32_t pixel)
 {
     return (uint16_t) (((pixel>>8) & 0xf800) | ((pixel>>5) & 0x07e0) | ((pixel>>3) & 0x001f));
 }
 
-static inline __m128i
+static force_inline __m128i
 pack_2x128_128 (__m128i lo, __m128i hi)
 {
     return _mm_packus_epi16 (lo, hi);
 }
 
-static inline __m128i
+static force_inline __m128i
 pack565_2x128_128 (__m128i lo, __m128i hi)
 {
     __m128i data;
@@ -156,13 +147,13 @@ pack565_2x128_128 (__m128i lo, __m128i hi)
     return _mm_or_si128 (_mm_or_si128 (_mm_or_si128 (r, g1), g2), b);
 }
 
-static inline __m128i
+static force_inline __m128i
 pack565_4x128_128 (__m128i* xmm0, __m128i* xmm1, __m128i* xmm2, __m128i* xmm3)
 {
     return _mm_packus_epi16 (pack565_2x128_128 (*xmm0, *xmm1), pack565_2x128_128 (*xmm2, *xmm3));
 }
 
-static inline uint32_t
+static force_inline uint32_t
 packAlpha (__m128i x)
 {
     return _mm_cvtsi128_si32 (_mm_packus_epi16 (_mm_packus_epi16 (_mm_srli_epi32 (x, 24),
@@ -170,19 +161,19 @@ packAlpha (__m128i x)
                                                 _mm_setzero_si128 ()));
 }
 
-static inline __m128i
+static force_inline __m128i
 expandPixel_32_1x128 (uint32_t data)
 {
     return _mm_shuffle_epi32 (unpack_32_1x128 (data), _MM_SHUFFLE(1, 0, 1, 0));
 }
 
-static inline __m128i
+static force_inline __m128i
 expandAlpha_1x128 (__m128i data)
 {
     return _mm_shufflehi_epi16 (_mm_shufflelo_epi16 (data, _MM_SHUFFLE(3, 3, 3, 3)), _MM_SHUFFLE(3, 3, 3, 3));
 }
 
-static inline void
+static force_inline void
 expandAlpha_2x128 (__m128i dataLo, __m128i dataHi, __m128i* alphaLo, __m128i* alphaHi)
 {
     __m128i lo, hi;
@@ -193,7 +184,7 @@ expandAlpha_2x128 (__m128i dataLo, __m128i dataHi, __m128i* alphaLo, __m128i* al
     *alphaHi = _mm_shufflehi_epi16 (hi, _MM_SHUFFLE(3, 3, 3, 3));
 }
 
-static inline void
+static force_inline void
 expandAlphaRev_2x128 (__m128i dataLo, __m128i dataHi, __m128i* alphaLo, __m128i* alphaHi)
 {
     __m128i lo, hi;
@@ -204,7 +195,7 @@ expandAlphaRev_2x128 (__m128i dataLo, __m128i dataHi, __m128i* alphaLo, __m128i*
     *alphaHi = _mm_shufflehi_epi16 (hi, _MM_SHUFFLE(0, 0, 0, 0));
 }
 
-static inline void
+static force_inline void
 pixMultiply_2x128 (__m128i* dataLo, __m128i* dataHi, __m128i* alphaLo, __m128i* alphaHi, __m128i* retLo, __m128i* retHi)
 {
     __m128i lo, hi;
@@ -217,7 +208,7 @@ pixMultiply_2x128 (__m128i* dataLo, __m128i* dataHi, __m128i* alphaLo, __m128i*
     *retHi = _mm_mulhi_epu16 (hi, Mask0101);
 }
 
-static inline void
+static force_inline void
 pixAddMultiply_2x128 (__m128i* srcLo, __m128i* srcHi, __m128i* alphaDstLo, __m128i* alphaDstHi,
                       __m128i* dstLo, __m128i* dstHi, __m128i* alphaSrcLo, __m128i* alphaSrcHi,
                       __m128i* retLo, __m128i* retHi)
@@ -237,14 +228,14 @@ pixAddMultiply_2x128 (__m128i* srcLo, __m128i* srcHi, __m128i* alphaDstLo, __m12
     *retHi = _mm_mulhi_epu16 (hi, Mask0101);
 }
 
-static inline void
+static force_inline void
 negate_2x128 (__m128i dataLo, __m128i dataHi, __m128i* negLo, __m128i* negHi)
 {
     *negLo = _mm_xor_si128 (dataLo, Mask00ff);
     *negHi = _mm_xor_si128 (dataHi, Mask00ff);
 }
 
-static inline void
+static force_inline void
 invertColors_2x128 (__m128i dataLo, __m128i dataHi, __m128i* invLo, __m128i* invHi)
 {
     __m128i lo, hi;
@@ -255,7 +246,7 @@ invertColors_2x128 (__m128i dataLo, __m128i dataHi, __m128i* invLo, __m128i* inv
     *invHi = _mm_shufflehi_epi16 (hi, _MM_SHUFFLE(3, 0, 1, 2));
 }
 
-static inline void
+static force_inline void
 over_2x128 (__m128i* srcLo, __m128i* srcHi, __m128i* alphaLo, __m128i* alphaHi, __m128i* dstLo, __m128i* dstHi)
 {
     __m128i t1, t2;
@@ -268,7 +259,7 @@ over_2x128 (__m128i* srcLo, __m128i* srcHi, __m128i* alphaLo, __m128i* alphaHi,
     *dstHi = _mm_adds_epu8 (*srcHi, *dstHi);
 }
 
-static inline void
+static force_inline void
 overRevNonPre_2x128 (__m128i srcLo, __m128i srcHi, __m128i* dstLo, __m128i* dstHi)
 {
     __m128i lo, hi;
@@ -286,7 +277,7 @@ overRevNonPre_2x128 (__m128i srcLo, __m128i srcHi, __m128i* dstLo, __m128i* dstH
     over_2x128 (&lo, &hi, &alphaLo, &alphaHi, dstLo, dstHi);
 }
 
-static inline void
+static force_inline void
 inOver_2x128 (__m128i* srcLo,  __m128i* srcHi,  __m128i*  alphaLo, __m128i*  alphaHi,
               __m128i* maskLo, __m128i* maskHi, __m128i* dstLo,   __m128i* dstHi)
 {
@@ -299,48 +290,48 @@ inOver_2x128 (__m128i* srcLo,  __m128i* srcHi,  __m128i*  alphaLo, __m128i*  alp
     over_2x128 (&sLo, &sHi, &aLo, &aHi, dstLo, dstHi);
 }
 
-static inline void
+static force_inline void
 cachePrefetch (__m128i* addr)
 {
     _mm_prefetch (addr, _MM_HINT_T0);
 }
 
-static inline void
+static force_inline void
 cachePrefetchNext (__m128i* addr)
 {
     _mm_prefetch (addr + 4, _MM_HINT_T0); // 64 bytes ahead
 }
 
 /* load 4 pixels from a 16-byte boundary aligned address */
-static inline __m128i
+static force_inline __m128i
 load128Aligned (__m128i* src)
 {
     return _mm_load_si128 (src);
 }
 
 /* load 4 pixels from a unaligned address */
-static inline __m128i
+static force_inline __m128i
 load128Unaligned (__m128i* src)
 {
     return _mm_loadu_si128 (src);
 }
 
 /* save 4 pixels using Write Combining memory on a 16-byte boundary aligned address */
-static inline void
+static force_inline void
 save128WriteCombining (__m128i* dst, __m128i data)
 {
     _mm_stream_si128 (dst, data);
 }
 
 /* save 4 pixels on a 16-byte boundary aligned address */
-static inline void
+static force_inline void
 save128Aligned (__m128i* dst, __m128i data)
 {
     _mm_store_si128 (dst, data);
 }
 
 /* save 4 pixels on a unaligned address */
-static inline void
+static force_inline void
 save128Unaligned (__m128i* dst, __m128i data)
 {
     _mm_storeu_si128 (dst, data);
@@ -350,31 +341,31 @@ save128Unaligned (__m128i* dst, __m128i data)
  * MMX inlines
  */
 
-static inline __m64
+static force_inline __m64
 unpack_32_1x64 (uint32_t data)
 {
     return _mm_unpacklo_pi8 (_mm_cvtsi32_si64 (data), _mm_setzero_si64());
 }
 
-static inline __m64
+static force_inline __m64
 expandAlpha_1x64 (__m64 data)
 {
     return _mm_shuffle_pi16 (data, _MM_SHUFFLE(3, 3, 3, 3));
 }
 
-static inline __m64
+static force_inline __m64
 expandAlphaRev_1x64 (__m64 data)
 {
     return _mm_shuffle_pi16 (data, _MM_SHUFFLE(0, 0, 0, 0));
 }
 
-static inline __m64
+static force_inline __m64
 expandPixel_8_1x64 (uint8_t data)
 {
     return _mm_shuffle_pi16 (unpack_32_1x64 ((uint32_t)data), _MM_SHUFFLE(0, 0, 0, 0));
 }
 
-static inline __m64
+static force_inline __m64
 pixMultiply_1x64 (__m64 data, __m64 alpha)
 {
     return _mm_mulhi_pu16 (_mm_adds_pu16 (_mm_mullo_pi16 (data, alpha),
@@ -382,7 +373,7 @@ pixMultiply_1x64 (__m64 data, __m64 alpha)
                            xMask0101);
 }
 
-static inline __m64
+static force_inline __m64
 pixAddMultiply_1x64 (__m64* src, __m64* alphaDst, __m64* dst, __m64* alphaSrc)
 {
     return _mm_mulhi_pu16 (_mm_adds_pu16 (_mm_adds_pu16 (_mm_mullo_pi16 (*src, *alphaDst),
@@ -391,25 +382,25 @@ pixAddMultiply_1x64 (__m64* src, __m64* alphaDst, __m64* dst, __m64* alphaSrc)
                            xMask0101);
 }
 
-static inline __m64
+static force_inline __m64
 negate_1x64 (__m64 data)
 {
     return _mm_xor_si64 (data, xMask00ff);
 }
 
-static inline __m64
+static force_inline __m64
 invertColors_1x64 (__m64 data)
 {
     return _mm_shuffle_pi16 (data, _MM_SHUFFLE(3, 0, 1, 2));
 }
 
-static inline __m64
+static force_inline __m64
 over_1x64 (__m64 src, __m64 alpha, __m64 dst)
 {
     return _mm_adds_pu8 (src, pixMultiply_1x64 (dst, negate_1x64 (alpha)));
 }
 
-static inline __m64
+static force_inline __m64
 inOver_1x64 (__m64* src, __m64* alpha, __m64* mask, __m64* dst)
 {
     return over_1x64 (pixMultiply_1x64 (*src, *mask),
@@ -417,7 +408,7 @@ inOver_1x64 (__m64* src, __m64* alpha, __m64* mask, __m64* dst)
                       *dst);
 }
 
-static inline __m64
+static force_inline __m64
 overRevNonPre_1x64 (__m64 src, __m64 dst)
 {
     __m64 alpha = expandAlpha_1x64 (src);
@@ -428,7 +419,7 @@ overRevNonPre_1x64 (__m64 src, __m64 dst)
                       dst);
 }
 
-static inline uint32_t
+static force_inline uint32_t
 pack_1x64_32( __m64 data )
 {
     return _mm_cvtsi64_si32 (_mm_packs_pu16 (data, _mm_setzero_si64()));
@@ -448,7 +439,7 @@ pack_1x64_32( __m64 data )
  * Note the trick here - the top word is shifted by another nibble to
  * avoid it bumping into the middle word
  */
-static inline __m64
+static force_inline __m64
 expand565_16_1x64 (uint16_t pixel)
 {
     __m64 p;
@@ -470,7 +461,7 @@ expand565_16_1x64 (uint16_t pixel)
 /* -------------------------------------------------------------------------------------------------
  * Compose Core transformations
  */
-static inline uint32_t
+static force_inline uint32_t
 coreCombineOverUPixelsse2 (uint32_t src, uint32_t dst)
 {
     uint8_t     a;
@@ -491,7 +482,7 @@ coreCombineOverUPixelsse2 (uint32_t src, uint32_t dst)
     return dst;
 }
 
-static inline void
+static force_inline void
 coreCombineOverUsse2 (uint32_t* pd, const uint32_t* ps, int w)
 {
     uint32_t pa;
@@ -566,7 +557,7 @@ coreCombineOverUsse2 (uint32_t* pd, const uint32_t* ps, int w)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineOverReverseUsse2 (uint32_t* pd, const uint32_t* ps, int w)
 {
     uint32_t s, d;
@@ -629,7 +620,7 @@ coreCombineOverReverseUsse2 (uint32_t* pd, const uint32_t* ps, int w)
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineInUPixelsse2 (uint32_t src, uint32_t dst)
 {
     uint32_t maska = src >> 24;
@@ -646,7 +637,7 @@ coreCombineInUPixelsse2 (uint32_t src, uint32_t dst)
     return dst;
 }
 
-static inline void
+static force_inline void
 coreCombineInUsse2 (uint32_t* pd, const uint32_t* ps, int w)
 {
     uint32_t s, d;
@@ -703,7 +694,7 @@ coreCombineInUsse2 (uint32_t* pd, const uint32_t* ps, int w)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineReverseInUsse2 (uint32_t* pd, const uint32_t* ps, int w)
 {
     uint32_t s, d;
@@ -760,7 +751,7 @@ coreCombineReverseInUsse2 (uint32_t* pd, const uint32_t* ps, int w)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineReverseOutUsse2 (uint32_t* pd, const uint32_t* ps, int w)
 {
     /* call prefetch hint to optimize cache load*/
@@ -817,7 +808,7 @@ coreCombineReverseOutUsse2 (uint32_t* pd, const uint32_t* ps, int w)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineOutUsse2 (uint32_t* pd, const uint32_t* ps, int w)
 {
     /* call prefetch hint to optimize cache load*/
@@ -874,7 +865,7 @@ coreCombineOutUsse2 (uint32_t* pd, const uint32_t* ps, int w)
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineAtopUPixelsse2 (uint32_t src, uint32_t dst)
 {
     __m64 s = unpack_32_1x64 (src);
@@ -886,7 +877,7 @@ coreCombineAtopUPixelsse2 (uint32_t src, uint32_t dst)
     return pack_1x64_32 (pixAddMultiply_1x64 (&s, &da, &d, &sa));
 }
 
-static inline void
+static force_inline void
 coreCombineAtopUsse2 (uint32_t* pd, const uint32_t* ps, int w)
 {
     uint32_t s, d;
@@ -951,7 +942,7 @@ coreCombineAtopUsse2 (uint32_t* pd, const uint32_t* ps, int w)
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineReverseAtopUPixelsse2 (uint32_t src, uint32_t dst)
 {
     __m64 s = unpack_32_1x64 (src);
@@ -963,7 +954,7 @@ coreCombineReverseAtopUPixelsse2 (uint32_t src, uint32_t dst)
     return pack_1x64_32 (pixAddMultiply_1x64 (&s, &da, &d, &sa));
 }
 
-static inline void
+static force_inline void
 coreCombineReverseAtopUsse2 (uint32_t* pd, const uint32_t* ps, int w)
 {
     uint32_t s, d;
@@ -1028,7 +1019,7 @@ coreCombineReverseAtopUsse2 (uint32_t* pd, const uint32_t* ps, int w)
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineXorUPixelsse2 (uint32_t src, uint32_t dst)
 {
     __m64 s = unpack_32_1x64 (src);
@@ -1040,7 +1031,7 @@ coreCombineXorUPixelsse2 (uint32_t src, uint32_t dst)
     return pack_1x64_32 (pixAddMultiply_1x64 (&s, &negD, &d, &negS));
 }
 
-static inline void
+static force_inline void
 coreCombineXorUsse2 (uint32_t* dst, const uint32_t* src, int width)
 {
     int w = width;
@@ -1109,7 +1100,7 @@ coreCombineXorUsse2 (uint32_t* dst, const uint32_t* src, int width)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineAddUsse2 (uint32_t* dst, const uint32_t* src, int width)
 {
     int w = width;
@@ -1155,7 +1146,7 @@ coreCombineAddUsse2 (uint32_t* dst, const uint32_t* src, int width)
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineSaturateUPixelsse2 (uint32_t src, uint32_t dst)
 {
     __m64 ms = unpack_32_1x64 (src);
@@ -1171,7 +1162,7 @@ coreCombineSaturateUPixelsse2 (uint32_t src, uint32_t dst)
     return pack_1x64_32 (_mm_adds_pu16 (md, ms));
 }
 
-static inline void
+static force_inline void
 coreCombineSaturateUsse2 (uint32_t *pd, const uint32_t *ps, int w)
 {
     uint32_t s,d;
@@ -1245,7 +1236,7 @@ coreCombineSaturateUsse2 (uint32_t *pd, const uint32_t *ps, int w)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineSrcCsse2 (uint32_t* pd, const uint32_t* ps, const uint32_t *pm, int w)
 {
     uint32_t s, m;
@@ -1304,7 +1295,7 @@ coreCombineSrcCsse2 (uint32_t* pd, const uint32_t* ps, const uint32_t *pm, int w
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineOverCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
 {
     __m64 s = unpack_32_1x64 (src);
@@ -1315,7 +1306,7 @@ coreCombineOverCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
     return pack_1x64_32 (inOver_1x64 (&s, &expAlpha, &unpkMask, &unpkDst));
 }
 
-static inline void
+static force_inline void
 coreCombineOverCsse2 (uint32_t* pd, const uint32_t* ps, const uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -1383,7 +1374,7 @@ coreCombineOverCsse2 (uint32_t* pd, const uint32_t* ps, const uint32_t *pm, int
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineOverReverseCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
 {
     __m64 d = unpack_32_1x64 (dst);
@@ -1391,7 +1382,7 @@ coreCombineOverReverseCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
 	return pack_1x64_32(over_1x64 (d, expandAlpha_1x64 (d), pixMultiply_1x64 (unpack_32_1x64 (src), unpack_32_1x64 (mask))));
 }
 
-static inline void
+static force_inline void
 coreCombineOverReverseCsse2 (uint32_t* pd, const uint32_t* ps, const uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -1460,7 +1451,7 @@ coreCombineOverReverseCsse2 (uint32_t* pd, const uint32_t* ps, const uint32_t *p
     }
 }
 
-static inline void
+static force_inline void
 coreCombineInCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -1531,7 +1522,7 @@ coreCombineInCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineInReverseCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -1604,7 +1595,7 @@ coreCombineInReverseCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineOutCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -1676,7 +1667,7 @@ coreCombineOutCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineOutReverseCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -1752,7 +1743,7 @@ coreCombineOutReverseCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineAtopCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
 {
     __m64 m = unpack_32_1x64 (mask);
@@ -1767,7 +1758,7 @@ coreCombineAtopCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
     return pack_1x64_32 (pixAddMultiply_1x64 (&d, &m, &s, &da));
 }
 
-static inline void
+static force_inline void
 coreCombineAtopCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -1844,7 +1835,7 @@ coreCombineAtopCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineReverseAtopCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
 {
     __m64 m = unpack_32_1x64 (mask);
@@ -1860,7 +1851,7 @@ coreCombineReverseAtopCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
     return pack_1x64_32 (pixAddMultiply_1x64 (&d, &m, &s, &da));
 }
 
-static inline void
+static force_inline void
 coreCombineReverseAtopCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -1937,7 +1928,7 @@ coreCombineReverseAtopCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
     }
 }
 
-static inline uint32_t
+static force_inline uint32_t
 coreCombineXorCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
 {
     __m64 a = unpack_32_1x64 (mask);
@@ -1954,7 +1945,7 @@ coreCombineXorCPixelsse2 (uint32_t src, uint32_t mask, uint32_t dst)
                                               &alphaSrc));
 }
 
-static inline void
+static force_inline void
 coreCombineXorCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -2032,7 +2023,7 @@ coreCombineXorCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
     }
 }
 
-static inline void
+static force_inline void
 coreCombineAddCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
 {
     uint32_t s, m, d;
@@ -2105,25 +2096,25 @@ coreCombineAddCsse2 (uint32_t *pd, uint32_t *ps, uint32_t *pm, int w)
 /* -------------------------------------------------------------------------------------------------
  * fbComposeSetupSSE2
  */
-static inline __m64
+static force_inline __m64
 createMask_16_64 (uint16_t mask)
 {
     return _mm_set1_pi16 (mask);
 }
 
-static inline __m128i
+static force_inline __m128i
 createMask_16_128 (uint16_t mask)
 {
     return _mm_set1_epi16 (mask);
 }
 
-static inline __m64
+static force_inline __m64
 createMask_2x32_64 (uint32_t mask0, uint32_t mask1)
 {
     return _mm_set_pi32 (mask0, mask1);
 }
 
-static inline __m128i
+static force_inline __m128i
 createMask_2x32_128 (uint32_t mask0, uint32_t mask1)
 {
     return _mm_set_epi32 (mask0, mask1, mask0, mask1);
@@ -2939,7 +2930,7 @@ fbCompositeSrc_8888x8888sse2 (pixman_op_t op,
 /* -------------------------------------------------------------------------------------------------
  * fbCompositeSrc_8888x0565
  */
-static inline uint16_t
+static force_inline uint16_t
 fbCompositeSrc_8888x0565pixel (uint32_t src, uint16_t dst)
 {
     __m64       ms;
diff --git a/pixman/pixman-vmx.c b/pixman/pixman-vmx.c
index 8c8a2a3..6af23c4 100644
--- a/pixman/pixman-vmx.c
+++ b/pixman/pixman-vmx.c
@@ -30,18 +30,14 @@
 #include "pixman-combine32.h"
 #include <altivec.h>
 
-#ifdef __GNUC__
-#   define inline __inline__ __attribute__ ((__always_inline__))
-#endif
-
-static inline vector unsigned int
+static force_inline vector unsigned int
 splat_alpha (vector unsigned int pix) {
     return vec_perm (pix, pix,
     (vector unsigned char)AVV(0x00,0x00,0x00,0x00, 0x04,0x04,0x04,0x04,
                                0x08,0x08,0x08,0x08, 0x0C,0x0C,0x0C,0x0C));
 }
 
-static inline vector unsigned int
+static force_inline vector unsigned int
 pix_multiply (vector unsigned int p, vector unsigned int a)
 {
     vector unsigned short hi, lo, mod;
@@ -80,14 +76,14 @@ pix_multiply (vector unsigned int p, vector unsigned int a)
     return (vector unsigned int)vec_packsu (hi, lo);
 }
 
-static inline vector unsigned int
+static force_inline vector unsigned int
 pix_add (vector unsigned int a, vector unsigned int b)
 {
     return (vector unsigned int)vec_adds ((vector unsigned char)a,
                      (vector unsigned char)b);
 }
 
-static inline vector unsigned int
+static force_inline vector unsigned int
 pix_add_mul (vector unsigned int x, vector unsigned int a,
              vector unsigned int y, vector unsigned int b)
 {
@@ -143,13 +139,13 @@ pix_add_mul (vector unsigned int x, vector unsigned int a,
     return (vector unsigned int)vec_packsu (hi, lo);
 }
 
-static inline vector unsigned int
+static force_inline vector unsigned int
 negate (vector unsigned int src)
 {
     return vec_nor (src, src);
 }
 /* dest*~srca + src */
-static inline vector unsigned int
+static force_inline vector unsigned int
 over (vector unsigned int src, vector unsigned int srca,
       vector unsigned int dest)
 {


More information about the cairo mailing list