[sse2] Don't emit prefetch 0 for an absent mask
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 13 Sep 2009 14:04:54 +0000 (15:04 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sun, 13 Sep 2009 15:37:57 +0000 (16:37 +0100)
pixman/pixman-sse2.c

index 9104e8d..fc78765 100644 (file)
@@ -629,7 +629,8 @@ core_combine_over_u_sse2 (uint32_t*       pd,
     /* call prefetch hint to optimize cache load*/
     cache_prefetch ((__m128i*)ps);
     cache_prefetch ((__m128i*)pd);
-    cache_prefetch ((__m128i*)pm);
+    if (pm)
+       cache_prefetch ((__m128i*)pm);
 
     /* Align dst on a 16-byte boundary */
     while (w && ((unsigned long)pd & 15))
@@ -647,14 +648,16 @@ core_combine_over_u_sse2 (uint32_t*       pd,
     /* call prefetch hint to optimize cache load*/
     cache_prefetch ((__m128i*)ps);
     cache_prefetch ((__m128i*)pd);
-    cache_prefetch ((__m128i*)pm);
+    if (pm)
+       cache_prefetch ((__m128i*)pm);
 
     while (w >= 4)
     {
        /* fill cache line with next memory */
        cache_prefetch_next ((__m128i*)ps);
        cache_prefetch_next ((__m128i*)pd);
-       cache_prefetch_next ((__m128i*)pm);
+       if (pm)
+           cache_prefetch_next ((__m128i*)pm);
 
        /* I'm loading unaligned because I'm not sure about
         * the address alignment.