40 vector
signed char vpix1;
41 vector
signed short vpix2, vdiff, vpix1l,vpix1h;
42 union { vector
signed int vscore;
45 u.vscore = vec_splat_s32(0);
49 #define vec_unaligned_load(b) \
50 vec_perm(vec_ld(0,b),vec_ld(15,b),vec_lvsl(0, b));
61 vpix1h = vec_unpackh(vpix1);
62 vdiff = vec_sub(vpix1h, vpix2);
63 vpix1l = vec_unpackl(vpix1);
66 u.vscore = vec_msum(vdiff, vdiff,
u.vscore);
67 vdiff = vec_sub(vpix1l, vpix2);
68 u.vscore = vec_msum(vdiff, vdiff,
u.vscore);
73 u.vscore = vec_sums(
u.vscore, vec_splat_s32(0));
76 for (i = 0; i <
size; i++) {
77 u.score[3] += (pix1[i]-pix2[i])*(pix1[i]-pix2[i]);
91 for(i = 0; i < order; i += 8){
94 res = vec_sums(
t, res);
98 res = vec_splat(res, 3);
99 vec_ste(res, 0, &ires);
107 register vec_s16 muls = {mul,mul,mul,mul,mul,mul,mul,mul};
109 register vec_s16 i2 = vec_ld(0, v2), i3 = vec_ld(0, v3);
116 t0 = vec_perm(i2, i1, align);
118 t1 = vec_perm(i1, i2, align);
121 res = vec_msum(t0, i0, res);
122 res = vec_msum(t1, i1, res);
124 t0 = vec_perm(i3, i4, align);
126 t1 = vec_perm(i4, i3, align);
127 pv1[0] = vec_mladd(t0, muls, i0);
128 pv1[1] = vec_mladd(t1, muls, i1);
133 res = vec_splat(vec_sums(res,
zero_s32v), 3);
134 vec_ste(res, 0, &ires);