[Pixman] [PATCH 2/4] armv6: Add nearest-scaled-cover src_8888_8888 fast path

Ben Avison bavison at riscosopen.org
Tue Aug 25 16:23:24 PDT 2015


This patch implements a shortcut so that the nearest scaled cover fetcher
iterator is used in preference to the fast path in pixman-fast-path.c, or
even the fast path defined using PIXMAN_ARM_BIND_SCALED_NEAREST_SRC_DST in
pixman-arm-simd.c. This is because the fetcher performs better than the
fast paths.

This is presented as an alternative to the patch I posted last year which
used macroised C wrappers around the fetcher, rather than reusing
general_composite_rect. Judging by the following benchmarks:

lowlevel-blt-bench -n src_8888_8888

       Before          Old patch      New patch       Change
      Mean StdDev     Mean StdDev    Mean StdDev    Old     New
L1   116.8   4.15     72.1   1.24    53.9   0.69   -38.3%  -53.8%
L2    35.9   2.26     43.8   1.46    38.0   1.12   +22.1%   +6.1%
M     34.9   0.11     62.1   0.29    47.7   0.25   +77.6%  +36.5%
HT    18.4   0.14     26.4   0.31    17.8   0.57   +43.7%   -3.2%
VT    17.7   0.13     24.7   0.23    17.2   0.50   +39.3%   -3.3%
R     16.9   0.07     23.4   0.23    16.5   0.46   +38.4%   -2.7%
RT     8.0   0.09      9.2   0.28     5.8   0.23   +14.6%  -28.4%

I find it hard to advocate this patch, even though it is somewhat simpler.
---
 pixman/pixman-arm-common.h |    9 +++++++++
 pixman/pixman-arm-simd.c   |    7 +++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/pixman/pixman-arm-common.h b/pixman/pixman-arm-common.h
index 748e933..f970868 100644
--- a/pixman/pixman-arm-common.h
+++ b/pixman/pixman-arm-common.h
@@ -494,6 +494,15 @@ cputype##_combine_##name##_u (pixman_implementation_t *imp,                   \
      FAST_PATH_X_UNIT_POSITIVE            |                             \
      FAST_PATH_Y_UNIT_ZERO)
 
+#define PIXMAN_ARM_NEAREST_SCALED_COVER_SRC_DST_FAST_PATH_VIA_ITER(op,s,d,func) \
+    {   PIXMAN_OP_ ## op,                                                       \
+        PIXMAN_ ## s,                                                           \
+        PIXMAN_ARM_NEAREST_SCALED_COVER_FLAGS,                                  \
+        PIXMAN_null, 0,                                                         \
+        PIXMAN_ ## d, FAST_PATH_STD_DEST_FLAGS,                                 \
+        _pixman_general_composite_rect                                          \
+    }
+
 /*****************************************************************************/
 
 /* Support for scaled bilinear fetchers */
diff --git a/pixman/pixman-arm-simd.c b/pixman/pixman-arm-simd.c
index c37cec8..a72f9da 100644
--- a/pixman/pixman-arm-simd.c
+++ b/pixman/pixman-arm-simd.c
@@ -399,6 +399,13 @@ static const pixman_fast_path_t arm_simd_fast_paths[] =
     PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8b8g8r8, a8b8g8r8, armv6_composite_over_n_8888_8888_ca),
     PIXMAN_STD_FAST_PATH_CA (OVER, solid, a8b8g8r8, x8b8g8r8, armv6_composite_over_n_8888_8888_ca),
 
+    PIXMAN_ARM_NEAREST_SCALED_COVER_SRC_DST_FAST_PATH_VIA_ITER (SRC, a8r8g8b8, a8r8g8b8, src_8888_8888),
+    PIXMAN_ARM_NEAREST_SCALED_COVER_SRC_DST_FAST_PATH_VIA_ITER (SRC, a8r8g8b8, x8r8g8b8, src_8888_8888),
+    PIXMAN_ARM_NEAREST_SCALED_COVER_SRC_DST_FAST_PATH_VIA_ITER (SRC, x8r8g8b8, x8r8g8b8, src_8888_8888),
+    PIXMAN_ARM_NEAREST_SCALED_COVER_SRC_DST_FAST_PATH_VIA_ITER (SRC, a8b8g8r8, a8b8g8r8, src_8888_8888),
+    PIXMAN_ARM_NEAREST_SCALED_COVER_SRC_DST_FAST_PATH_VIA_ITER (SRC, a8b8g8r8, x8b8g8r8, src_8888_8888),
+    PIXMAN_ARM_NEAREST_SCALED_COVER_SRC_DST_FAST_PATH_VIA_ITER (SRC, x8b8g8r8, x8b8g8r8, src_8888_8888),
+
     SIMPLE_NEAREST_FAST_PATH (SRC, r5g6b5, r5g6b5, armv6_0565_0565),
     SIMPLE_NEAREST_FAST_PATH (SRC, b5g6r5, b5g6r5, armv6_0565_0565),
 
-- 
1.7.5.4



More information about the Pixman mailing list