avutil/ppc/float_dsp_altivec: ppc: Fix bug in ff_vector_fmul_add_altivec() affecting little endian environments on POWER8

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Rong Yan 2014-09-11 09:07:40 +00:00 committed by Michael Niedermayer
parent 4a203b7737
commit 8e8db16a2c
1 changed files with 8 additions and 10 deletions

View File

@ -75,20 +75,18 @@ void ff_vector_fmul_add_altivec(float *dst, const float *src0,
int len)
{
int i;
vector float d, s0, s1, s2, t0, t1, edges;
vector unsigned char align = vec_lvsr(0,dst),
mask = vec_lvsl(0, dst);
vector float d, ss0, ss1, ss2, t0, t1, edges;
for (i = 0; i < len - 3; i += 4) {
t0 = vec_ld(0, dst + i);
t1 = vec_ld(15, dst + i);
s0 = vec_ld(0, src0 + i);
s1 = vec_ld(0, src1 + i);
s2 = vec_ld(0, src2 + i);
edges = vec_perm(t1, t0, mask);
d = vec_madd(s0, s1, s2);
t1 = vec_perm(d, edges, align);
t0 = vec_perm(edges, d, align);
ss0 = vec_ld(0, src0 + i);
ss1 = vec_ld(0, src1 + i);
ss2 = vec_ld(0, src2 + i);
edges = vec_perm(t1, t0, vcprm(0, 1, 2, 3));
d = vec_madd(ss0, ss1, ss2);
t1 = vec_perm(d, edges, vcprm(s0,s1,s2,s3));
t0 = vec_perm(edges, d, vcprm(s0,s1,s2,s3));
vec_st(t1, 15, dst + i);
vec_st(t0, 0, dst + i);
}