ARM: added 'neon_combine_over_u' function
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>
Wed, 9 Dec 2009 22:22:12 +0000 (00:22 +0200)
committerSiarhei Siamashka <siarhei.siamashka@nokia.com>
Wed, 16 Dec 2009 18:56:08 +0000 (20:56 +0200)
pixman/pixman-arm-neon-asm.S
pixman/pixman-arm-neon.c

index 43920be..d2c5fc7 100644 (file)
@@ -628,6 +628,16 @@ generate_composite_function \
     pixman_composite_over_8888_8888_process_pixblock_tail, \
     pixman_composite_over_8888_8888_process_pixblock_tail_head
 
+generate_composite_function_single_scanline \
+    pixman_composite_scanline_over_asm_neon, 32, 0, 32, \
+    FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+    8, /* number of pixels, processed in a single block */ \
+    default_init, \
+    default_cleanup, \
+    pixman_composite_over_8888_8888_process_pixblock_head, \
+    pixman_composite_over_8888_8888_process_pixblock_tail, \
+    pixman_composite_over_8888_8888_process_pixblock_tail_head
+
 /******************************************************************************/
 
 /* TODO: expand macros and do better instructions scheduling */
@@ -1271,6 +1281,20 @@ generate_composite_function \
     0,  /* src_basereg   */ \
     12  /* mask_basereg  */
 
+generate_composite_function_single_scanline \
+    pixman_composite_scanline_over_mask_asm_neon, 32, 32, 32, \
+    FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \
+    8, /* number of pixels, processed in a single block */ \
+    pixman_composite_over_8888_8888_8888_init, \
+    pixman_composite_over_8888_8888_8888_cleanup, \
+    pixman_composite_over_8888_n_8888_process_pixblock_head, \
+    pixman_composite_over_8888_n_8888_process_pixblock_tail, \
+    pixman_composite_over_8888_8888_8888_process_pixblock_tail_head \
+    28, /* dst_w_basereg */ \
+    4,  /* dst_r_basereg */ \
+    0,  /* src_basereg   */ \
+    12  /* mask_basereg  */
+
 /******************************************************************************/
 
 /* TODO: expand macros and do better instructions scheduling */
index 00237da..00f75eb 100644 (file)
@@ -516,12 +516,43 @@ arm_neon_fill (pixman_implementation_t *imp,
        imp->delegate, bits, stride, bpp, x, y, width, height, xor);
 }
 
+#define BIND_COMBINE_U(name)                                             \
+void                                                                     \
+pixman_composite_scanline_##name##_mask_asm_neon (int32_t         w,     \
+                                                  const uint32_t *dst,   \
+                                                  const uint32_t *src,   \
+                                                  const uint32_t *mask); \
+                                                                         \
+void                                                                     \
+pixman_composite_scanline_##name##_asm_neon (int32_t         w,          \
+                                             const uint32_t *dst,        \
+                                             const uint32_t *src);       \
+                                                                         \
+static void                                                              \
+neon_combine_##name##_u (pixman_implementation_t *imp,                   \
+                         pixman_op_t              op,                    \
+                         uint32_t *               dest,                  \
+                         const uint32_t *         src,                   \
+                         const uint32_t *         mask,                  \
+                         int                      width)                 \
+{                                                                        \
+    if (mask)                                                            \
+       pixman_composite_scanline_##name##_mask_asm_neon (width, dest,   \
+                                                         src, mask);    \
+    else                                                                 \
+       pixman_composite_scanline_##name##_asm_neon (width, dest, src);  \
+}
+
+BIND_COMBINE_U (over)
+
 pixman_implementation_t *
 _pixman_implementation_create_arm_neon (void)
 {
     pixman_implementation_t *general = _pixman_implementation_create_fast_path ();
     pixman_implementation_t *imp = _pixman_implementation_create (general);
 
+    imp->combine_32[PIXMAN_OP_OVER] = neon_combine_over_u;
+
     imp->composite = arm_neon_composite;
     imp->blt = arm_neon_blt;
     imp->fill = arm_neon_fill;