35 vector
float src1, src2, dst1, dst2, mul_v,
zero;
37 zero = (vector float)vec_splat_u32(0);
39 mul_v = vec_splat(mul_u.v, 0);
41 for (i = 0; i <
len; i += 8) {
42 src1 = vec_ctf(vec_ld(0, src+i), 0);
43 src2 = vec_ctf(vec_ld(16, src+i), 0);
44 dst1 = vec_madd(src1, mul_v, zero);
45 dst2 = vec_madd(src2, mul_v, zero);
46 vec_st(dst1, 0, dst+i);
47 vec_st(dst2, 16, dst+i);
54 vector
float s0 = vec_ld(0, src);
55 vector
float s1 = vec_ld(16, src);
56 vector
signed int t0 = vec_cts(s0, 0);
57 vector
signed int t1 = vec_cts(s1, 0);
58 return vec_packs(t0,t1);
64 vector
signed short d0, d1, d;
65 vector
unsigned char align;
66 if (((
long)dst) & 15) {
67 for (i = 0; i < len - 7; i += 8) {
68 d0 = vec_ld(0, dst+i);
70 d1 = vec_ld(15, dst+i);
71 d1 = vec_perm(d1, d0, vec_lvsl(0, dst + i));
72 align = vec_lvsr(0, dst + i);
73 d0 = vec_perm(d1, d, align);
74 d1 = vec_perm(d, d1, align);
75 vec_st(d0, 0, dst + i);
76 vec_st(d1, 15, dst + i);
79 for (i = 0; i < len - 7; i += 8) {
81 vec_st(d, 0, dst + i);
86 #define VSTE_INC(dst, v, elem, inc) do { \
87 vector signed short s = vec_splat(v, elem); \
96 vector
signed short d, s;
98 for (i = 0; i < len - 7; i += 8) {
112 long len,
int channels)
115 vector
signed short d0, d1, d2, c0,
c1,
t0,
t1;
116 vector
unsigned char align;
122 if (((
long)dst) & 15) {
123 for (i = 0; i < len - 7; i += 8) {
124 d0 = vec_ld(0, dst + i);
126 d1 = vec_ld(31, dst + i);
128 c0 = vec_mergeh(t0, t1);
129 c1 = vec_mergel(t0, t1);
130 d2 = vec_perm(d1, d0, vec_lvsl(0, dst + i));
131 align = vec_lvsr(0, dst + i);
132 d0 = vec_perm(d2, c0, align);
133 d1 = vec_perm(c0, c1, align);
134 vec_st(d0, 0, dst + i);
135 d0 = vec_perm(c1, d2, align);
136 vec_st(d1, 15, dst + i);
137 vec_st(d0, 31, dst + i);
141 for (i = 0; i < len - 7; i += 8) {
144 d0 = vec_mergeh(t0, t1);
145 d1 = vec_mergel(t0, t1);
146 vec_st(d0, 0, dst + i);
147 vec_st(d1, 16, dst + i);
152 for (i = 0; i < channels; i++)