[Pixman] [PATCH] mmx: convert while (w) to if (w) when possible

Matt Turner mattst88 at gmail.com
Thu Sep 22 12:36:25 PDT 2011


gcc isn't able to see that w is no greater than 1, so it generates
unnecessary loop instructions with while (w).

Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
 pixman/pixman-mmx.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index f835a14..6c57909 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -1142,7 +1142,7 @@ mmx_composite_over_n_8888 (pixman_implementation_t *imp,
 
 	CHECKPOINT ();
 
-	while (w)
+	if (w)
 	{
 	    *dst = store8888 (over (vsrc, vsrca, load8888 (*dst)));
 
@@ -1383,7 +1383,7 @@ mmx_composite_over_8888_n_8888 (pixman_implementation_t *imp,
 	    src += 2;
 	}
 
-	while (w)
+	if (w)
 	{
 	    __m64 s = load8888 (*src);
 	    __m64 d = load8888 (*dst);
@@ -1758,7 +1758,7 @@ mmx_composite_over_n_8_8888 (pixman_implementation_t *imp,
 
 	CHECKPOINT ();
 
-	while (w)
+	if (w)
 	{
 	    uint64_t m = *mask;
 
@@ -2026,7 +2026,7 @@ mmx_composite_src_n_8_8888 (pixman_implementation_t *imp,
 
 	CHECKPOINT ();
 
-	while (w)
+	if (w)
 	{
 	    uint64_t m = *mask;
 
@@ -2366,7 +2366,7 @@ mmx_composite_over_pixbuf_8888 (pixman_implementation_t *imp,
 	    src += 2;
 	}
 
-	while (w)
+	if (w)
 	{
 	    __m64 s = load8888 (*src);
 	    __m64 d = load8888 (*dst);
-- 
1.7.3.4



More information about the Pixman mailing list