[Pixman] [PATCH 2/2] ARM: added 'neon_composite_src_8888_8_0565' fast path

Soeren Sandmann sandmann at daimi.au.dk
Thu Aug 26 05:09:32 PDT 2010


Siarhei Siamashka <siarhei.siamashka at gmail.com> writes:

> +.macro pixman_composite_src_n_8_0565_process_pixblock_head
> +    /* in */
> +    vmull.u8    q15, d24, d2
> +    vmull.u8    q3,  d24, d1
> +    vmull.u8    q2,  d24, d0
> +    vrshr.u16   q12, q15, #8
> +    vrshr.u16   q11, q3,  #8
> +    vrshr.u16   q10, q2,  #8
> +    vraddhn.u16 d16, q15, q12
> +    vraddhn.u16 d19, q3,  q11
> +    vraddhn.u16 d18, q2,  q10
> +.endm
> +
> +.macro pixman_composite_src_n_8_0565_process_pixblock_tail
> +    /* convert to r5g6b5 */
> +    vshll.u8    q14, d16, #8
> +    vshll.u8    q8,  d19, #8
> +    vshll.u8    q9,  d18, #8
> +    vsri.u16    q14, q8,  #5
> +    vsri.u16    q14, q9,  #11
> +.endm

It's remarkable how much NEON can do with so few instructions.

> @@ -90,6 +90,8 @@ PIXMAN_ARM_BIND_FAST_PATH_SRC_MASK_DST (neon, over_8888_8888_8888,
>                                          uint32_t, 1, uint32_t, 1, uint32_t, 1)
>  PIXMAN_ARM_BIND_FAST_PATH_SRC_MASK_DST (neon, over_8888_8_0565,
>                                          uint32_t, 1, uint8_t, 1, uint16_t, 1)
> +PIXMAN_ARM_BIND_FAST_PATH_SRC_MASK_DST (neon, src_8888_8_0565,
> +                                        uint32_t, 1, uint8_t, 1, uint16_t, 1)
>  
>  void
>  pixman_composite_src_n_8_asm_neon (int32_t   w,
> @@ -198,6 +200,8 @@ pixman_blt_neon (uint32_t *src_bits,
>  
>  static const pixman_fast_path_t arm_neon_fast_paths[] =
>  {
> +    PIXMAN_STD_FAST_PATH (SRC,  a8r8g8b8, a8,       r5g6b5,   neon_composite_src_8888_8_0565),
> +    PIXMAN_STD_FAST_PATH (SRC,  a8b8g8r8, a8,       b5g6r5,   neon_composite_src_8888_8_0565),

It seems like this fast path will work as src_x888_8_0565 as well
since the alpha channel is completely ignored.


Soren


More information about the Pixman mailing list