[Pixman] [PATCH 10/11] mmx: optimize in_n_8_8

Matt Turner mattst88 at gmail.com
Wed Mar 14 21:00:48 PDT 2012


Loongson:
in_n_8_8 =  L1:  80.23  L2:  81.66  M: 55.71 ( 58.47%)  HT: 39.27  VT: 38.36  R: 30.34  RT: 12.23 ( 121Kops/s)
in_n_8_8 =  L1:  85.38  L2:  86.92  M: 58.00 ( 61.03%)  HT: 47.52  VT: 40.55  R: 35.18  RT: 14.77 ( 138Kops/s)

ARM/iwMMXt:
in_n_8_8 =  L1:  71.04  L2:  69.97  M: 50.06 ( 44.64%)  HT: 33.55  VT: 33.55  R: 28.57  RT: 13.05 ( 103Kops/s)
in_n_8_8 =  L1:  75.71  L2:  70.41  M: 49.80 ( 44.99%)  HT: 34.87  VT: 34.84  R: 27.77  RT: 13.87 ( 110Kops/s)

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

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 21ba076..8ad0135 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -2630,7 +2630,10 @@ mmx_composite_in_n_8_8 (pixman_implementation_t *imp,
 	    d = *dst;
 
 	    m = MUL_UN8 (sa, a, tmp);
-	    d = MUL_UN8 (m, d, tmp);
+	    if (m == 0)
+		d = 0;
+	    else
+		d = MUL_UN8 (m, d, tmp);
 
 	    *dst++ = d;
 	    w--;
@@ -2661,7 +2664,10 @@ mmx_composite_in_n_8_8 (pixman_implementation_t *imp,
 	    d = *dst;
 
 	    m = MUL_UN8 (sa, a, tmp);
-	    d = MUL_UN8 (m, d, tmp);
+	    if (m == 0)
+		d = 0;
+	    else
+		d = MUL_UN8 (m, d, tmp);
 
 	    *dst++ = d;
 	}
-- 
1.7.3.4



More information about the Pixman mailing list