[x264-devel] [PATCH 4/6] ppc: Provide fallbacks for older architectures

Luca Barbato lu_zero at gentoo.org
Tue Nov 1 23:16:16 CET 2016


---
 common/ppc/ppccommon.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/common/ppc/ppccommon.h b/common/ppc/ppccommon.h
index 4c91cd2..bd5fd25 100644
--- a/common/ppc/ppccommon.h
+++ b/common/ppc/ppccommon.h
@@ -344,3 +344,21 @@ pix2v = vec_u8_to_s16( pix2v8 );                      \
 d = vec_sub( pix1v, pix2v);                           \
 p1 += i1;                                             \
 p2 += i2;
+
+#ifndef HAVE_VSX
+#undef vec_vsx_ld
+#define vec_vsx_ld(off, src) \
+    vec_perm(vec_ld(off, src), vec_ld(off + 15, src), vec_lvsl(off, src))
+
+#undef vec_vsx_st
+#define vec_vsx_st(v, off, dst)                        \
+    do {                                               \
+        vec_u8_t a = vec_ld(off, dst);                 \
+        vec_u8_t b = vec_ld(off + 15, dst);            \
+        vec_u8_t e = vec_perm(b, a, vec_lvsl(0, dst)); \
+        vec_u8_t m = vec_lvsr(0, dst);                 \
+                                                       \
+        vec_st(vec_perm(v, e, m), off + 15, dst);      \
+        vec_st(vec_perm(e, v, m), off, dst);           \
+    } while (0)
+#endif
-- 
2.9.2



More information about the x264-devel mailing list