diff options
author | Rong Yan <rongyan236@gmail.com> | 2014-11-07 08:57:49 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-07 10:51:35 +0100 |
commit | 6a6c16cbcc27242e6d6e630f2d63bd82a4d76c49 (patch) | |
tree | 42d5b6d651be91b187a00310ff83e7465c94c84c /libavutil/ppc | |
parent | c11f731768568787c1c6333970ed40ae0f2ff4f4 (diff) | |
download | ffmpeg-6a6c16cbcc27242e6d6e630f2d63bd82a4d76c49.tar.gz |
libavutil/ppc/util_altivec.h : fix unaligned_load() vec_unaligned_load() add macros VEC_LD() VEC_MERGEH() VEC_MERGEL() VEC_ST() for POWER LE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavutil/ppc')
-rw-r--r-- | libavutil/ppc/util_altivec.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/libavutil/ppc/util_altivec.h b/libavutil/ppc/util_altivec.h index 2c0ad5f6c6..4892a27b4d 100644 --- a/libavutil/ppc/util_altivec.h +++ b/libavutil/ppc/util_altivec.h @@ -85,8 +85,17 @@ do { \ } while (0) +#if HAVE_BIGENDIAN +#define VEC_LD(offset,b) \ + vec_perm(vec_ld(offset, b), vec_ld(offset+15, b), vec_lvsl(offset, b)) +#else +#define VEC_LD(offset,b) \ + vec_vsx_ld(offset, b) +#endif + /** @brief loads unaligned vector @a *src with offset @a offset and returns it */ +#if HAVE_BIGENDIAN static inline vector unsigned char unaligned_load(int offset, uint8_t *src) { register vector unsigned char first = vec_ld(offset, src); @@ -94,6 +103,10 @@ static inline vector unsigned char unaligned_load(int offset, uint8_t *src) register vector unsigned char mask = vec_lvsl(offset, src); return vec_perm(first, second, mask); } +#else +#define unaligned_load(a,b) VEC_LD(a,b) +#endif + /** * loads vector known misalignment @@ -106,8 +119,22 @@ static inline vec_u8 load_with_perm_vec(int offset, uint8_t *src, vec_u8 perm_ve return vec_perm(a, b, perm_vec); } -#define vec_unaligned_load(b) \ - vec_perm(vec_ld(0, b), vec_ld(15, b), vec_lvsl(0, b)); +#define vec_unaligned_load(b) VEC_LD(0, b) + +#if HAVE_BIGENDIAN +#define VEC_MERGEH(a, b) vec_mergeh(a, b) +#define VEC_MERGEL(a, b) vec_mergel(a, b) +#else +#define VEC_MERGEH(a, b) vec_mergeh(b, a) +#define VEC_MERGEL(a, b) vec_mergel(b, a) +#endif + +#if HAVE_BIGENDIAN +#define VEC_ST(a,b,c) vec_st(a,b,c) +#else +#define VEC_ST(a,b,c) vec_vsx_st(a,b,c) +#endif + #endif /* HAVE_ALTIVEC */ |