From 16142d8ee2a974060ecbad0f495b5a5c6516a75e Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Tue, 1 Nov 2016 23:16:16 +0100 Subject: [PATCH] ppc: Provide fallbacks for older architectures --- common/ppc/ppccommon.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/common/ppc/ppccommon.h b/common/ppc/ppccommon.h index 4c91cd2a..915eeef1 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.40.0