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

Luca Barbato git at videolan.org
Thu Dec 1 21:01:44 CET 2016


x264 | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue Nov  1 23:16:16 2016 +0100| [16142d8ee2a974060ecbad0f495b5a5c6516a75e] | committer: Henrik Gramner

ppc: Provide fallbacks for older architectures

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=16142d8ee2a974060ecbad0f495b5a5c6516a75e
---

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

diff --git a/common/ppc/ppccommon.h b/common/ppc/ppccommon.h
index 4c91cd2..915eeef 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



More information about the x264-devel mailing list