mmx: Fix _mm_empty problems for over_8888_8888/over_8888_n_8888
authorSiarhei Siamashka <siarhei.siamashka@gmail.com>
Mon, 22 Sep 2014 03:30:51 +0000 (06:30 +0300)
committerMatt Turner <mattst88@gmail.com>
Fri, 24 Oct 2014 21:25:30 +0000 (14:25 -0700)
Using "--disable-sse2 --disable-ssse3" configure options and
CFLAGS="-m32 -O2 -g" on an x86 system results in pixman "make check"
failures:

    ../test-driver: line 95: 29874 Aborted
    FAIL: affine-test
    ../test-driver: line 95: 29887 Aborted
    FAIL: scaling-test

One _mm_empty () was missing and another one is needed to workaround
an old GCC bug https://gcc.gnu.org/PR47759 (GCC may move MMX instructions
around and cause test suite failures).

Reviewed-by: Matt Turner <mattst88@gmail.com>
pixman/pixman-mmx.c

index c7fd5035823381604d423222b2a9b389912e1736..42826d94d18ce1114d879cbe3c21d06d2c8ba461 100644 (file)
@@ -3580,6 +3580,8 @@ scaled_nearest_scanline_mmx_8888_8888_OVER (uint32_t*       pd,
 
        w--;
     }
+
+    _mm_empty ();
 }
 
 FAST_NEAREST_MAINLOOP (mmx_8888_8888_cover_OVER,
@@ -3608,7 +3610,11 @@ scaled_nearest_scanline_mmx_8888_n_8888_OVER (const uint32_t * mask,
     __m64 mm_mask;
 
     if (zero_src || (*mask >> 24) == 0)
+    {
+       /* A workaround for https://gcc.gnu.org/PR47759 */
+       _mm_empty ();
        return;
+    }
 
     mm_mask = expand_alpha (load8888 (mask));