[Pixman] [PATCH] mmx: Fix _mm_empty problems for over_8888_8888/over_8888_n_8888

Siarhei Siamashka siarhei.siamashka at gmail.com
Sun Sep 21 20:30:51 PDT 2014


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).
---
 pixman/pixman-mmx.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index c7fd503..42826d9 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -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));
 
-- 
1.8.3.2



More information about the Pixman mailing list