[Pixman] [PATCH 17/32] arm: Move BIND_COMBINE_U from NEON code to a generic ARM header

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


This is so that it can be used with armv6 single-scanline functions.
For namespacing reasons, also rename it to PIXMAN_ARM_BIND_COMBINE_U.

Also correct the prototypes so that the destination pointers aren't const.
---
 pixman/pixman-arm-common.h |   28 ++++++++++++++++++++++++++++
 pixman/pixman-arm-neon.c   |   33 +++------------------------------
 2 files changed, 31 insertions(+), 30 deletions(-)

diff --git a/pixman/pixman-arm-common.h b/pixman/pixman-arm-common.h
index 3a7cb2b..3558c15 100644
--- a/pixman/pixman-arm-common.h
+++ b/pixman/pixman-arm-common.h
@@ -424,5 +424,33 @@ FAST_BILINEAR_MAINLOOP_COMMON (cputype##_##name##_normal_##op,                \
                        src_type, uint8_t, dst_type, NORMAL,                   \
                        FLAG_HAVE_NON_SOLID_MASK)
 
+/*****************************************************************************/
+
+#define PIXMAN_ARM_BIND_COMBINE_U(cputype, name)                              \
+void                                                                          \
+pixman_composite_scanline_##name##_mask_asm_##cputype (int32_t         w,     \
+                                                       uint32_t       *dst,   \
+                                                       const uint32_t *src,   \
+                                                       const uint32_t *mask); \
+                                                                              \
+void                                                                          \
+pixman_composite_scanline_##name##_asm_##cputype (int32_t         w,          \
+                                                  uint32_t       *dst,        \
+                                                  const uint32_t *src);       \
+                                                                              \
+static void                                                                   \
+cputype##_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_##cputype (width, dest,   \
+                                                               src, mask);    \
+    else                                                                      \
+        pixman_composite_scanline_##name##_asm_##cputype (width, dest, src);  \
+}
 
 #endif
diff --git a/pixman/pixman-arm-neon.c b/pixman/pixman-arm-neon.c
index 60e9c78..e5262b1 100644
--- a/pixman/pixman-arm-neon.c
+++ b/pixman/pixman-arm-neon.c
@@ -424,36 +424,9 @@ static const pixman_fast_path_t arm_neon_fast_paths[] =
     { PIXMAN_OP_NONE },
 };
 
-#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)
-BIND_COMBINE_U (add)
-BIND_COMBINE_U (out_reverse)
+PIXMAN_ARM_BIND_COMBINE_U (neon, over)
+PIXMAN_ARM_BIND_COMBINE_U (neon, add)
+PIXMAN_ARM_BIND_COMBINE_U (neon, out_reverse)
 
 pixman_implementation_t *
 _pixman_implementation_create_arm_neon (pixman_implementation_t *fallback)
-- 
1.7.5.4



More information about the Pixman mailing list