mmx: optimize unaligned 64-bit ARM/iwmmxt loads
authorMatt Turner <mattst88@gmail.com>
Thu, 22 Sep 2011 19:28:00 +0000 (15:28 -0400)
committerMatt Turner <mattst88@gmail.com>
Tue, 27 Sep 2011 17:13:22 +0000 (13:13 -0400)
Signed-off-by: Matt Turner <mattst88@gmail.com>
pixman/pixman-mmx.c

index 801ae32ca6f2463515d9d8babbd0cc8773844ec9..f848ab4d584619543430713ade6808fb4d349e0e 100644 (file)
@@ -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;