[Pixman] [PATCH 5/6] mmx: introduce is_equal and is_zero functions

Matt Turner mattst88 at gmail.com
Fri Feb 24 15:18:06 PST 2012


To be used by the next commit.

Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
 pixman/pixman-mmx.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 8b55b32..63edf18 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -416,6 +416,23 @@ store8888 (uint32_t *dest, __m64 v)
     store(dest, v);
 }
 
+static force_inline pixman_bool_t
+is_equal (__m64 a, __m64 b)
+{
+#ifdef USE_LOONGSON_MMI
+    /* __m64 is double, we can compare directly. */
+    return a == b;
+#else
+    return to_uint64 (a) == to_uint64 (b);
+#endif
+}
+
+static force_inline pixman_bool_t
+is_zero (__m64 v)
+{
+    return is_equal (v, _mm_setzero_si64 ());
+}
+
 /* Expand 16 bits positioned at @pos (0-3) of a mmx register into
  *
  *    00RR00GG00BB
-- 
1.7.3.4



More information about the Pixman mailing list