37 static int32_t scalarproduct_int16_altivec(
const int16_t *v1,
const int16_t *v2,
43 register vec_s32 res = vec_splat_s32(0), t;
46 for (
i = 0;
i < order;
i += 8) {
47 vec1 = vec_unaligned_load(v1);
48 t = vec_msum(vec1, vec_ld(0, v2),
zero_s32v);
49 res = vec_sums(t, res);
53 res = vec_splat(res, 3);
54 vec_ste(res, 0, &ires);
63 static int32_t scalarproduct_int16_vsx(
const int16_t *v1,
const int16_t *v2,
int order)
68 register vec_s32 res = vec_splat_s32(0), t;
71 for (
i = 0;
i < order;
i += 8) {
72 vec1 = vec_vsx_ld(0, v1);
73 t = vec_msum(vec1, vec_ld(0, v2),
zero_s32v);
74 res = vec_sums(t, res);
78 res = vec_splat(res, 3);
79 vec_ste(res, 0, &ires);
92 c->scalarproduct_int16 = scalarproduct_int16_altivec;
99 c->scalarproduct_int16 = scalarproduct_int16_vsx;