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

Luca Barbato lu_zero at gentoo.org
Mon Nov 21 20:31:43 CET 2016


---

Now with !HAVE_VSX and _prefixed variables to avoid shadowing warnings.

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

diff --git a/common/ppc/ppccommon.h b/common/ppc/ppccommon.h
index 4c91cd2..0e0ef2e 100644
--- a/common/ppc/ppccommon.h
+++ b/common/ppc/ppccommon.h
@@ -344,3 +344,22 @@ pix2v = vec_u8_to_s16( pix2v8 );                      \
 d = vec_sub( pix1v, pix2v);                           \
 p1 += i1;                                             \
 p2 += i2;
+
+#if !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 _v = (vec_u8_t)(v);                      \
+        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