43 register const vector
unsigned char vczero = (
const vector
unsigned char)vec_splat_u8(0);
44 register const vector
unsigned short vcsr8 = (
const vector
unsigned short)vec_splat_u16(8);
45 register vector
unsigned char dstv, dstv2, src_0, src_1, srcvA, srcvB, srcvC, srcvD;
46 register vector
unsigned short Av, Bv, Cv, Dv, rounderV, tempA, tempB, tempC, tempD;
48 unsigned long dst_odd = (
unsigned long)dst & 0x0000000F;
49 unsigned long src_really_odd = (
unsigned long)src & 0x0000000F;
51 tempA = vec_ld(0, (
const unsigned short*)ABCD);
52 Av = vec_splat(tempA, 0);
53 Bv = vec_splat(tempA, 1);
54 Cv = vec_splat(tempA, 2);
55 Dv = vec_splat(tempA, 3);
57 rounderV = vec_splat((
vec_u16)vec_lde(0, &rounder_a), 0);
64 src_0 = vec_ld(0, src);
65 src_1 = vec_ld(16, src);
66 srcvA = vec_perm(src_0, src_1, vec_lvsl(0, src));
68 if (src_really_odd != 0x0000000F) {
71 srcvB = vec_perm(src_0, src_1, vec_lvsl(1, src));
75 srcvA = vec_mergeh(vczero, srcvA);
76 srcvB = vec_mergeh(vczero, srcvB);
79 dst_odd = (
unsigned long)dst & 0x0000000F;
80 src_really_odd = (((
unsigned long)src) +
stride) & 0x0000000F;
82 dstv = vec_ld(0, dst);
88 src_0 = vec_ld(stride + 0, src);
89 src_1 = vec_ld(stride + 16, src);
90 srcvC = vec_perm(src_0, src_1, vec_lvsl(stride + 0, src));
92 if (src_really_odd != 0x0000000F) {
95 srcvD = vec_perm(src_0, src_1, vec_lvsl(stride + 1, src));
100 srcvC = vec_mergeh(vczero, srcvC);
101 srcvD = vec_mergeh(vczero, srcvD);
107 tempA = vec_mladd((vector
unsigned short)srcvA, Av, rounderV);
108 tempB = vec_mladd((vector
unsigned short)srcvB, Bv, tempA);
109 tempC = vec_mladd((vector
unsigned short)srcvC, Cv, tempB);
110 tempD = vec_mladd((vector
unsigned short)srcvD, Dv, tempC);
115 tempD = vec_sr(tempD, vcsr8);
117 dstv2 = vec_pack(tempD, (vector
unsigned short)vczero);
120 dstv2 = vec_perm(dstv, dstv2, vcprm(0,1,
s0,
s1));
122 dstv2 = vec_perm(dstv, dstv2, vcprm(
s0,
s1,2,3));
125 vec_st(dstv2, 0, dst);