[Pixman] [PATCH 8/8] mmx: add ARM/iwmmxt inline assembly fill code

Matt Turner mattst88 at gmail.com
Fri Sep 23 11:54:17 PDT 2011


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

diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 4e384c1..06a8636 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -1826,7 +1826,7 @@ pixman_fill_mmx (uint32_t *bits,
     uint32_t byte_width;
     uint8_t     *byte_line;
 
-#if defined __GNUC__ && defined USE_X86_MMX
+#if defined __GNUC__
     __m64 v1, v2, v3, v4, v5, v6, v7;
 #endif
 
@@ -1860,8 +1860,9 @@ pixman_fill_mmx (uint32_t *bits,
     fill = ((uint64_t)xor << 32) | xor;
     vfill = to_m64 (fill);
 
-#if defined __GNUC__ && defined USE_X86_MMX
+#ifdef __GNUC__
     __asm__ (
+# ifdef USE_X86_MMX
         "movq		%7,	%0\n"
         "movq		%7,	%1\n"
         "movq		%7,	%2\n"
@@ -1869,6 +1870,15 @@ pixman_fill_mmx (uint32_t *bits,
         "movq		%7,	%4\n"
         "movq		%7,	%5\n"
         "movq		%7,	%6\n"
+# elif defined USE_ARM_IWMMXT
+	"wmov	%0, %7\n"
+	"wmov	%1, %7\n"
+	"wmov	%2, %7\n"
+	"wmov	%3, %7\n"
+	"wmov	%4, %7\n"
+	"wmov	%5, %7\n"
+	"wmov	%6, %7\n"
+# endif
 	: "=&y" (v1), "=&y" (v2), "=&y" (v3),
 	  "=&y" (v4), "=&y" (v5), "=&y" (v6), "=y" (v7)
 	: "y" (vfill));
@@ -1906,8 +1916,9 @@ pixman_fill_mmx (uint32_t *bits,
 
 	while (w >= 64)
 	{
-#if defined __GNUC__ && defined USE_X86_MMX
+#if defined __GNUC__
 	    __asm__ (
+# ifdef USE_X86_MMX
 	        "movq	%1,	  (%0)\n"
 	        "movq	%2,	 8(%0)\n"
 	        "movq	%3,	16(%0)\n"
@@ -1916,6 +1927,16 @@ pixman_fill_mmx (uint32_t *bits,
 	        "movq	%6,	40(%0)\n"
 	        "movq	%7,	48(%0)\n"
 	        "movq	%8,	56(%0)\n"
+# elif defined USE_ARM_IWMMXT
+		"wstrd	%1,	[%0]\n"
+		"wstrd	%2,	[%0,  #8]\n"
+		"wstrd	%3,	[%0, #16]\n"
+		"wstrd	%4,	[%0, #24]\n"
+		"wstrd	%5,	[%0, #32]\n"
+		"wstrd	%6,	[%0, #40]\n"
+		"wstrd	%7,	[%0, #48]\n"
+		"wstrd	%8,	[%0, #56]\n"
+# endif
 		:
 		: "r" (d),
 		  "y" (vfill), "y" (v1), "y" (v2), "y" (v3),
-- 
1.7.3.4



More information about the Pixman mailing list