44 register const vector
unsigned char vczero = (
const vector
unsigned char)vec_splat_u8(0);
45 register const vector
unsigned short vcsr8 = (
const vector
unsigned short)vec_splat_u16(8);
46 register vector
unsigned char dstv, dstv2, src_0, src_1, srcvA, srcvB, srcvC, srcvD;
47 register vector
unsigned short Av, Bv, Cv, Dv, rounderV, tempA, tempB, tempC, tempD;
49 unsigned long dst_odd = (
unsigned long)dst & 0x0000000F;
50 unsigned long src_really_odd = (
unsigned long)src & 0x0000000F;
52 tempA = vec_ld(0, (
const unsigned short*)ABCD);
53 Av = vec_splat(tempA, 0);
54 Bv = vec_splat(tempA, 1);
55 Cv = vec_splat(tempA, 2);
56 Dv = vec_splat(tempA, 3);
58 rounderV = vec_splat((
vec_u16)vec_lde(0, &rounder_a), 0);
65 src_0 = vec_ld(0, src);
66 src_1 = vec_ld(16, src);
67 srcvA = vec_perm(src_0, src_1, vec_lvsl(0, src));
69 if (src_really_odd != 0x0000000F) {
72 srcvB = vec_perm(src_0, src_1, vec_lvsl(1, src));
76 srcvA = vec_mergeh(vczero, srcvA);
77 srcvB = vec_mergeh(vczero, srcvB);
80 dst_odd = (
unsigned long)dst & 0x0000000F;
81 src_really_odd = (((
unsigned long)src) +
stride) & 0x0000000F;
83 dstv = vec_ld(0, dst);
89 src_0 = vec_ld(stride + 0, src);
90 src_1 = vec_ld(stride + 16, src);
91 srcvC = vec_perm(src_0, src_1, vec_lvsl(stride + 0, src));
93 if (src_really_odd != 0x0000000F) {
96 srcvD = vec_perm(src_0, src_1, vec_lvsl(stride + 1, src));
101 srcvC = vec_mergeh(vczero, srcvC);
102 srcvD = vec_mergeh(vczero, srcvD);
108 tempA = vec_mladd((vector
unsigned short)srcvA, Av, rounderV);
109 tempB = vec_mladd((vector
unsigned short)srcvB, Bv, tempA);
110 tempC = vec_mladd((vector
unsigned short)srcvC, Cv, tempB);
111 tempD = vec_mladd((vector
unsigned short)srcvD, Dv, tempC);
116 tempD = vec_sr(tempD, vcsr8);
118 dstv2 = vec_pack(tempD, (vector
unsigned short)vczero);
121 dstv2 = vec_perm(dstv, dstv2,
vcprm(0,1,
s0,
s1));
123 dstv2 = vec_perm(dstv, dstv2,
vcprm(
s0,
s1,2,3));
126 vec_st(dstv2, 0, dst);