Commit 3a557c5d authored by Chip Kerchner's avatar Chip Kerchner Committed by Carl Eugen Hoyos

lsws/ppc/yuv2rgb_altivec: Replace vec_lvsl/vec_perm with vec_xl

gcc 6.x and 7.x generate wrong code for little endian machines
for the vec_lvsl/vec_perm instruction combos in some cases.
The bug was fixed in version 8.x
If these instructions are replaced with vec_xl, the problem goes
away for all versions of the compilers.

Fixes ticket #7124.
parent faa9cd31
...@@ -305,9 +305,6 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in, \ ...@@ -305,9 +305,6 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in, \
vector signed short R1, G1, B1; \ vector signed short R1, G1, B1; \
vector unsigned char R, G, B; \ vector unsigned char R, G, B; \
\ \
const vector unsigned char *y1ivP, *y2ivP, *uivP, *vivP; \
vector unsigned char align_perm; \
\
vector signed short lCY = c->CY; \ vector signed short lCY = c->CY; \
vector signed short lOY = c->OY; \ vector signed short lOY = c->OY; \
vector signed short lCRV = c->CRV; \ vector signed short lCRV = c->CRV; \
...@@ -338,26 +335,13 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in, \ ...@@ -338,26 +335,13 @@ static int altivec_ ## name(SwsContext *c, const unsigned char **in, \
vec_dstst(oute, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 1); \ vec_dstst(oute, (0x02000002 | (((w * 3 + 32) / 32) << 16)), 1); \
\ \
for (j = 0; j < w / 16; j++) { \ for (j = 0; j < w / 16; j++) { \
y1ivP = (const vector unsigned char *) y1i; \ y0 = vec_xl(0, y1i); \
y2ivP = (const vector unsigned char *) y2i; \
uivP = (const vector unsigned char *) ui; \
vivP = (const vector unsigned char *) vi; \
\
align_perm = vec_lvsl(0, y1i); \
y0 = (vector unsigned char) \
vec_perm(y1ivP[0], y1ivP[1], align_perm); \
\ \
align_perm = vec_lvsl(0, y2i); \ y1 = vec_xl(0, y2i); \
y1 = (vector unsigned char) \
vec_perm(y2ivP[0], y2ivP[1], align_perm); \
\ \
align_perm = vec_lvsl(0, ui); \ u = (vector signed char) vec_xl(0, ui); \
u = (vector signed char) \
vec_perm(uivP[0], uivP[1], align_perm); \
\ \
align_perm = vec_lvsl(0, vi); \ v = (vector signed char) vec_xl(0, vi); \
v = (vector signed char) \
vec_perm(vivP[0], vivP[1], align_perm); \
\ \
u = (vector signed char) \ u = (vector signed char) \
vec_sub(u, \ vec_sub(u, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment