[Pixman] [PATCH 27/32] armv6: Add fetcher for r5g6b5 nearest-neighbour transformed images

Ben Avison bavison at riscosopen.org
Thu Aug 7 09:50:23 PDT 2014


This is related to the a8r8g8b8 nearest-scaled-cover fetcher. Below are
benchmarks for src_0565_8888, which uses it.

lowlevel-blt-bench -n :

     Before          After
     Mean   StdDev   Mean   StdDev  Confidence  Change
L1   9.0    0.0      34.4   0.3     100.0%      +284.7%
L2   8.1    0.1      29.0   0.6     100.0%      +258.7%
M    8.4    0.0      33.2   0.1     100.0%      +297.6%
HT   5.8    0.0      16.5   0.3     100.0%      +183.6%
VT   5.8    0.0      16.0   0.3     100.0%      +175.6%
R    5.6    0.0      15.6   0.1     100.0%      +175.5%
RT   3.0    0.0      6.0    0.2     100.0%      +98.7%

affine-bench:

     Before          After
     Mean   StdDev   Mean   StdDev  Confidence  Change
0.5  11.2   0.0      52.0   0.1     100.0%      +363.2%
0.75 10.9   0.0      41.3   0.1     100.0%      +279.3%
1.0  10.6   0.0      33.4   0.1     100.0%      +216.7%
1.5  10.0   0.0      32.3   0.1     100.0%      +221.8%
2.0  9.4    0.0      31.7   0.0     100.0%      +236.0%
---
 pixman/pixman-arm-simd-asm-scaled.S |   20 ++++++++++++++++++++
 pixman/pixman-arm-simd.c            |    9 +++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/pixman/pixman-arm-simd-asm-scaled.S b/pixman/pixman-arm-simd-asm-scaled.S
index 2c7e091..44f565a 100644
--- a/pixman/pixman-arm-simd-asm-scaled.S
+++ b/pixman/pixman-arm-simd-asm-scaled.S
@@ -162,4 +162,24 @@ generate_nearest_scaled_cover_function \
     pixman_get_scanline_nearest_scaled_cover_a8r8g8b8_asm_armv6, 32, \
     3, 3 /* prefetch distances */, nop_macro, nop_macro
 
+.macro init_ge
+        msr     CPSR_s, #0x50000
+.endm
+
+.macro convert_0565_8888, reg, tmp
+        bic     tmp, reg, #0x07e0                  @ 0000000000000000rrrrr000000bbbbb
+        and     reg, reg, #0x07e0                  @ 000000000000000000000gggggg00000
+        mov     tmp, tmp, lsl #3                   @ 0000000000000rrrrr000000bbbbb000
+        mov     reg, reg, lsl #5                   @ 0000000000000000gggggg0000000000
+        orr     tmp, tmp, tmp, lsr #5              @ 0000000000000rrrrrrrrrr0bbbbbbbb
+        orr     reg, reg, reg, lsr #6              @ 000000000000000gggggggggggg00000
+        pkhbt   tmp, tmp, tmp, lsl #5              @ --------rrrrrrrr--------bbbbbbbb
+        sel     reg, tmp, reg                      @ --------rrrrrrrrggggggggbbbbbbbb
+        orr     reg, reg, #0xFF000000              @ 11111111rrrrrrrrggggggggbbbbbbbb
+.endm
+
+generate_nearest_scaled_cover_function \
+    pixman_get_scanline_nearest_scaled_cover_r5g6b5_asm_armv6, 16, \
+    2, 3 /* prefetch distances */, init_ge, convert_0565_8888
+
 /******************************************************************************/
diff --git a/pixman/pixman-arm-simd.c b/pixman/pixman-arm-simd.c
index 0a4daa7..a9d8e7d 100644
--- a/pixman/pixman-arm-simd.c
+++ b/pixman/pixman-arm-simd.c
@@ -177,6 +177,7 @@ cputype##_get_scanline_nearest_scaled_cover_##name (pixman_iter_t  *iter,   \
 }
 
 BIND_GET_SCANLINE_NEAREST_SCALED_COVER (armv6, a8r8g8b8, uint32_t)
+BIND_GET_SCANLINE_NEAREST_SCALED_COVER (armv6, r5g6b5,   uint16_t)
 
 void
 pixman_composite_src_n_8888_asm_armv6 (int32_t   w,
@@ -433,6 +434,14 @@ static const pixman_iter_info_t arm_simd_iters[] =
       armv6_write_back_r5g6b5
     },
 
+    { PIXMAN_r5g6b5,
+      PIXMAN_ARM_NEAREST_SCALED_COVER_FLAGS,
+      ITER_NARROW | ITER_SRC,
+      NULL,
+      armv6_get_scanline_nearest_scaled_cover_r5g6b5,
+      NULL
+    },
+
     { PIXMAN_a1r5g5b5,
       (FAST_PATH_STANDARD_FLAGS             |
        FAST_PATH_ID_TRANSFORM               |
-- 
1.7.5.4



More information about the Pixman mailing list