54 #if ARCH_X86_32 && defined(__INTEL_COMPILER)
59 #if HAVE_SSE_INLINE && HAVE_7REGS
64 #define MIX5(mono, stereo) \
66 "movss 0(%1), %%xmm5 \n" \
67 "movss 8(%1), %%xmm6 \n" \
68 "movss 24(%1), %%xmm7 \n" \
69 "shufps $0, %%xmm5, %%xmm5 \n" \
70 "shufps $0, %%xmm6, %%xmm6 \n" \
71 "shufps $0, %%xmm7, %%xmm7 \n" \
73 "movaps (%0, %2), %%xmm0 \n" \
74 "movaps (%0, %3), %%xmm1 \n" \
75 "movaps (%0, %4), %%xmm2 \n" \
76 "movaps (%0, %5), %%xmm3 \n" \
77 "movaps (%0, %6), %%xmm4 \n" \
78 "mulps %%xmm5, %%xmm0 \n" \
79 "mulps %%xmm6, %%xmm1 \n" \
80 "mulps %%xmm5, %%xmm2 \n" \
81 "mulps %%xmm7, %%xmm3 \n" \
82 "mulps %%xmm7, %%xmm4 \n" \
83 stereo("addps %%xmm1, %%xmm0 \n") \
84 "addps %%xmm1, %%xmm2 \n" \
85 "addps %%xmm3, %%xmm0 \n" \
86 "addps %%xmm4, %%xmm2 \n" \
87 mono("addps %%xmm2, %%xmm0 \n") \
88 "movaps %%xmm0, (%0, %2) \n" \
89 stereo("movaps %%xmm2, (%0, %3) \n") \
94 "r"(samples[0] + len), \
95 "r"(samples[1] + len), \
96 "r"(samples[2] + len), \
97 "r"(samples[3] + len), \
98 "r"(samples[4] + len) \
99 : XMM_CLOBBERS("%xmm0", "%xmm1", "%xmm2", "%xmm3", \
100 "%xmm4", "%xmm5", "%xmm6", "%xmm7",) \
104 #define MIX_MISC(stereo) \
108 "mov -%c7(%6, %2, %c8), %3 \n" \
109 "movaps (%3, %0), %%xmm0 \n" \
110 stereo("movaps %%xmm0, %%xmm1 \n") \
111 "mulps %%xmm4, %%xmm0 \n" \
112 stereo("mulps %%xmm5, %%xmm1 \n") \
114 "mov (%6, %2, %c8), %1 \n" \
115 "movaps (%1, %0), %%xmm2 \n" \
116 stereo("movaps %%xmm2, %%xmm3 \n") \
117 "mulps (%4, %2, 8), %%xmm2 \n" \
118 stereo("mulps 16(%4, %2, 8), %%xmm3 \n") \
119 "addps %%xmm2, %%xmm0 \n" \
120 stereo("addps %%xmm3, %%xmm1 \n") \
124 stereo("mov (%6, %2, %c8), %1 \n") \
125 "movaps %%xmm0, (%3, %0) \n" \
126 stereo("movaps %%xmm1, (%1, %0) \n") \
129 : "+&r"(i), "=&r"(j), "=&r"(k), "=&r"(m) \
130 : "r"(matrix_simd + in_ch), \
131 "g"((intptr_t) - 4 * (in_ch - 1)), \
133 "i"(sizeof(float *)), "i"(sizeof(float *)/4) \
137 static void ac3_downmix_sse(
float **samples,
float (*matrix)[2],
138 int out_ch,
int in_ch,
int len)
140 int (*matrix_cmp)[2] = (int(*)[2])matrix;
143 i = -len *
sizeof(float);
144 if (in_ch == 5 && out_ch == 2 &&
145 !(matrix_cmp[0][1] | matrix_cmp[2][0] |
146 matrix_cmp[3][1] | matrix_cmp[4][0] |
147 (matrix_cmp[1][0] ^ matrix_cmp[1][1]) |
148 (matrix_cmp[0][0] ^ matrix_cmp[2][1]))) {
150 }
else if (in_ch == 5 && out_ch == 1 &&
151 matrix_cmp[0][0] == matrix_cmp[2][0] &&
152 matrix_cmp[3][0] == matrix_cmp[4][0]) {
158 for (j = 0; j < in_ch; j++)
159 samp[j] = samples[j] + len;
161 j = 2 * in_ch *
sizeof(float);
165 "movss (%2, %0), %%xmm4 \n"
166 "movss 4(%2, %0), %%xmm5 \n"
167 "shufps $0, %%xmm4, %%xmm4 \n"
168 "shufps $0, %%xmm5, %%xmm5 \n"
169 "movaps %%xmm4, (%1, %0, 4) \n"
170 "movaps %%xmm5, 16(%1, %0, 4) \n"
173 :
"r"(matrix_simd),
"r"(matrix)
226 #if HAVE_SSE_INLINE && HAVE_7REGS