diff options
author | Ben Avison <bavison@riscosopen.org> | 2015-04-09 20:34:53 +0100 |
---|---|---|
committer | Siarhei Siamashka <siarhei.siamashka@gmail.com> | 2016-04-05 00:48:36 +0300 |
commit | c74f5288e5b544a40bc9b738acce8e30983e19ac (patch) | |
tree | 1358a52dae71c991f9c9d59c630ac46ac586ddbb | |
parent | ead9ada9fbcfae08a6161ed1873f29239678820c (diff) |
armv7: Add in_8888_8 fast path
This is tuned for the Cortex-A7 (Raspberry Pi 2).
lowlevel-blt-bench results, compared to the ARMv6 fast path:
Before After
Mean StdDev Mean StdDev Confidence Change
L1 146.0 0.7 231.4 1.2 100.0% +58.5%
L2 143.1 0.9 222.1 1.7 100.0% +55.3%
M 110.9 0.0 129.0 0.5 100.0% +16.3%
HT 57.3 0.6 73.0 0.3 100.0% +27.4%
VT 46.6 0.5 61.6 0.4 100.0% +32.3%
R 42.3 0.2 51.7 0.2 100.0% +22.2%
RT 19.1 0.1 21.0 0.1 100.0% +9.9%
-rw-r--r-- | pixman/pixman-arm-neon-asm.S | 35 | ||||
-rw-r--r-- | pixman/pixman-arm-neon.c | 5 |
2 files changed, 40 insertions, 0 deletions
diff --git a/pixman/pixman-arm-neon-asm.S b/pixman/pixman-arm-neon-asm.S index 46567cb..f276f60 100644 --- a/pixman/pixman-arm-neon-asm.S +++ b/pixman/pixman-arm-neon-asm.S @@ -3198,6 +3198,41 @@ generate_composite_function \ /******************************************************************************/ +.macro pixman_composite_in_8888_8_process_pixblock_head + /* src is in d0-d3 (deinterleaved) */ + /* destination pixel data is in d4 */ + vmull.u8 q8, d3, d4 +.endm + +.macro pixman_composite_in_8888_8_process_pixblock_tail + vrshr.u16 q9, q8, #8 + vraddhn.u16 d28, q8, q9 + /* result is in d28 */ +.endm + +.macro pixman_composite_in_8888_8_process_pixblock_tail_head + vld4.8 {d0-d3}, [SRC]! + vrshr.u16 q9, q8, #8 + vld1.8 {d4}, [DST_R :64]! + cache_preload 8, 8 + vraddhn.u16 d28, q8, q9 + vmull.u8 q8, d3, d4 + vst1.8 {d28}, [DST_W :64]! +.endm + +generate_composite_function \ + pixman_composite_in_8888_8_asm_neon, 32, 0, 8, \ + FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \ + 8, /* number of pixels, processed in a single block */ \ + 4, /* prefetch distance */ \ + default_init, \ + default_cleanup, \ + pixman_composite_in_8888_8_process_pixblock_head, \ + pixman_composite_in_8888_8_process_pixblock_tail, \ + pixman_composite_in_8888_8_process_pixblock_tail_head + +/******************************************************************************/ + .macro pixman_composite_src_1555_8888_process_pixblock_head /* src is in d0-d1 */ vshrn.i16 d31, q0, #8 diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c index 9f3faa4..254fee0 100644 --- a/pixman/pixman-arm-neon.c +++ b/pixman/pixman-arm-neon.c @@ -68,6 +68,8 @@ PIXMAN_ARM_BIND_FAST_PATH_SRC_DST (neon, out_reverse_8_0565, uint8_t, 1, uint16_t, 1) PIXMAN_ARM_BIND_FAST_PATH_SRC_DST (neon, out_reverse_8_8888, uint8_t, 1, uint32_t, 1) +PIXMAN_ARM_BIND_FAST_PATH_SRC_DST (neon, in_8888_8, + uint32_t, 1, uint8_t, 1) PIXMAN_ARM_BIND_FAST_PATH_SRC_DST (neon, in_reverse_8888_8888, uint32_t, 1, uint32_t, 1) @@ -377,6 +379,9 @@ static const pixman_fast_path_t arm_neon_fast_paths[] = PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, a8r8g8b8, neon_composite_add_8888_8888), PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, a8b8g8r8, neon_composite_add_8888_8888), PIXMAN_STD_FAST_PATH (IN, solid, null, a8, neon_composite_in_n_8), + PIXMAN_STD_FAST_PATH (IN, a8r8g8b8, null, a8, neon_composite_in_8888_8), + PIXMAN_STD_FAST_PATH (IN, a8b8g8r8, null, a8, neon_composite_in_8888_8), + PIXMAN_STD_FAST_PATH (IN, a8r8g8b8_sRGB, null, a8, neon_composite_in_8888_8), PIXMAN_STD_FAST_PATH (OVER_REVERSE, solid, null, a8r8g8b8, neon_composite_over_reverse_n_8888), PIXMAN_STD_FAST_PATH (OVER_REVERSE, solid, null, a8b8g8r8, neon_composite_over_reverse_n_8888), PIXMAN_STD_FAST_PATH (IN_REVERSE, a8r8g8b8, null, x8r8g8b8, neon_composite_in_reverse_8888_8888), |