36 vector
float src1, src2, dst1, dst2, mul_v,
zero;
38 zero = (vector float)vec_splat_u32(0);
40 mul_v = vec_splat(mul_u.v, 0);
42 for (i = 0; i <
len; i += 8) {
43 src1 = vec_ctf(vec_ld(0, src+i), 0);
44 src2 = vec_ctf(vec_ld(16, src+i), 0);
45 dst1 = vec_madd(src1, mul_v, zero);
46 dst2 = vec_madd(src2, mul_v, zero);
47 vec_st(dst1, 0, dst+i);
48 vec_st(dst2, 16, dst+i);
55 vector
float s0 = vec_ld(0, src);
56 vector
float s1 = vec_ld(16, src);
57 vector
signed int t0 = vec_cts(s0, 0);
58 vector
signed int t1 = vec_cts(s1, 0);
59 return vec_packs(t0,t1);
65 vector
signed short d0, d1, d;
66 vector
unsigned char align;
67 if (((
long)dst) & 15) {
68 for (i = 0; i < len - 7; i += 8) {
69 d0 = vec_ld(0, dst+i);
71 d1 = vec_ld(15, dst+i);
72 d1 = vec_perm(d1, d0, vec_lvsl(0, dst + i));
73 align = vec_lvsr(0, dst + i);
74 d0 = vec_perm(d1, d, align);
75 d1 = vec_perm(d, d1, align);
76 vec_st(d0, 0, dst + i);
77 vec_st(d1, 15, dst + i);
80 for (i = 0; i < len - 7; i += 8) {
82 vec_st(d, 0, dst + i);
87 #define VSTE_INC(dst, v, elem, inc) do { \
88 vector signed short s = vec_splat(v, elem); \
97 vector
signed short d;
99 for (i = 0; i < len - 7; i += 8) {
113 long len,
int channels)
116 vector
signed short d0, d1, d2, c0,
c1,
t0,
t1;
117 vector
unsigned char align;
123 if (((
long)dst) & 15) {
124 for (i = 0; i < len - 7; i += 8) {
125 d0 = vec_ld(0, dst + i);
127 d1 = vec_ld(31, dst + i);
129 c0 = vec_mergeh(t0, t1);
130 c1 = vec_mergel(t0, t1);
131 d2 = vec_perm(d1, d0, vec_lvsl(0, dst + i));
132 align = vec_lvsr(0, dst + i);
133 d0 = vec_perm(d2, c0, align);
134 d1 = vec_perm(c0, c1, align);
135 vec_st(d0, 0, dst + i);
136 d0 = vec_perm(c1, d2, align);
137 vec_st(d1, 15, dst + i);
138 vec_st(d0, 31, dst + i);
142 for (i = 0; i < len - 7; i += 8) {
145 d0 = vec_mergeh(t0, t1);
146 d1 = vec_mergel(t0, t1);
147 vec_st(d0, 0, dst + i);
148 vec_st(d1, 16, dst + i);
153 for (i = 0; i < channels; i++)