[Pixman] [PATCH 6/8] mmx: optimize unaligned 64-bit ARM/iwmmxt loads
Matt Turner
mattst88 at gmail.com
Fri Sep 23 11:54:15 PDT 2011
Signed-off-by: Matt Turner <mattst88 at gmail.com>
---
pixman/pixman-mmx.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/pixman/pixman-mmx.c b/pixman/pixman-mmx.c
index 801ae32..f848ab4 100644
--- a/pixman/pixman-mmx.c
+++ b/pixman/pixman-mmx.c
@@ -314,6 +314,13 @@ static __inline__ uint64_t ldq_u(uint64_t *p)
#ifdef USE_X86_MMX
/* x86's alignment restrictions are very relaxed. */
return *p;
+#elif defined USE_ARM_IWMMXT
+ int align = (uintptr_t)p & 7;
+ __m64 *aligned_p;
+ if (align == 0)
+ return *p;
+ aligned_p = (__m64 *)((uintptr_t)p & ~7);
+ return _mm_align_si64 (aligned_p[0], aligned_p[1], align);
#else
struct __una_u64 { uint64_t x __attribute__((packed)); };
const struct __una_u64 *ptr = (const struct __una_u64 *) p;
--
1.7.3.4
More information about the Pixman
mailing list