[linux-audio-dev] caps 0.1.0

Tim Goetze tim at quitte.de
Wed Feb 18 20:50:08 UTC 2004


>I read:
>> can you try the attached patch please?
>
>works with gcc-3.2, but not 3.3:
>In file included from Eq.h:4,
>                 from Eq.cc:31:
>dsp/Eq.h:167:46: missing terminating " character
>dsp/Eq.h:181:57: missing terminating " character
>dsp/Eq.h:185:46: missing terminating " character
>dsp/Eq.h:194:57: missing terminating " character
>dsp/Eq.h:199:38: missing terminating " character
>dsp/Eq.h:205:82: missing terminating " character
>make: *** [Eq.o] Error 1

ah, glad to hear it gets better, thanks.

to cure this, can you try the patch attached please?

tim
-------------- next part --------------
--- caps-0.1.1/dsp/Eq.h	Mon Feb 16 16:58:56 2004
+++ dsp/Eq.h	Wed Feb 18 21:45:38 2004
@@ -10,10 +10,6 @@
 #ifndef _DSP_EQ_H_
 #define _DSP_EQ_H_
 
-#ifndef __i386__
-# undef USE_SSE
-#endif
-
 namespace DSP {
 
 /* BANDS must be a multiple of 4 to enable the use of SSE instructions.
@@ -101,7 +97,6 @@
 				a[i] = b[i] = c[i] = 0;
 			}
 
-#ifndef USE_SSE
 		/* per-band recursion:
 		 * 	y = 2 * (a * (x - x[-2]) + c * y[-1] - b * y[-2]) 
 		 */
@@ -127,86 +122,6 @@
 
 				return r;
 			}
-#else /* do USE_SSE */
-		/* parallelized version of above. 
-		 *
-		 * FIXME: make asm work with -funroll-loops and the BANDS parameter
-		 *
-		 * per-band recursion:
-		 * 	y = 2 * (a * (x - x[-2]) - b * y[-2] + c * y[-1]) 
-		 */
-		d_sample process (d_sample s)
-			{
-				int z1 = h, z2 = h ^ 1;
-
-				float * y1 = y + z1 * BANDS;
-				float * y2 = y + z2 * BANDS;
-
-				/* load 0,0,0,0 into xmm4, holding the total sum */
-				asm ("xorps %xmm4, %xmm4"); 
-
-				/* load 2,2,2,2 into xmm3 */
-				asm ("movaps (%0), %%xmm3" : : "p" (two)); 
-
-				/* likewise, load (x - x[-2]) into xmm0 */
-				float x_x2 = s - x[z2];
-				asm ("movss %0, %%xmm0" : : "m" (x_x2)); 
-				asm ("shufps $0, %xmm0, %xmm0"); 
-
-				x[z2] = s;
-				h = z2;
-
-				/* this fails to compile with -funroll-loops */
-				for (int i = 0; i < BANDS; i += 4)
-				{
-					/* esi = y2 + i (we need it later) */
-					asm ("mov %0, %%esi" : : "p" (y2 + i) : "%esi");
-					/* edi = y1 + i (we need it later) */
-					asm ("mov %0, %%edi" : : "p" (y1 + i) : "%edi");
-					
-					asm ("
-							movaps %%xmm0, %%xmm1 	/* x - x[-2] into xmm1 */
-							movl %0, %%eax 					/* a + i into eax */
-							mulps (%%eax), %%xmm1		/* accu *= (x - x[-2]) */
-							addl %1, %%eax					/* eax += BANDS * sizeof (float) */
-							movaps (%%esi), %%xmm2	/* y[-2] into xmm2 */ 
-							mulps (%%eax), %%xmm2		/* xmm2 *= b */
-							addl %1, %%eax					/* eax += BANDS * sizeof (float) */
-							subps %%xmm2, %%xmm1    /* accu -= xmm2 */
-							movaps (%%edi), %%xmm2	/* y[-1] into xmm2 */
-							mulps (%%eax), %%xmm2		/* xmm2 *= c + i */
-							addps %%xmm2, %%xmm1		/* accu += xmm2 */
-							mulps %%xmm3, %%xmm1		/* accu *= 2 */
-							movaps %%xmm1, (%%esi)		/* store accu into y */
-							" : 
-							: "p" (a + i), "i" (BANDS * sizeof (float)) 
-							: "%eax", "%esi", "%edi");
-
-					asm ("
-							mov %0, %%eax						/* eax = gain + i */
-							mov %%eax, %%ebx				/* ebx = eax */
-							movaps (%%eax), %%xmm2	/* xmm2 = gain */
-							addl %1, %%eax					/* eax += BANDS * sizeof (float) = gf + i */
-							mulps %%xmm2, %%xmm1		/* accu *= gain */
-							mulps (%%eax), %%xmm2		/* gain *= gf */
-							movaps %%xmm2, (%%ebx)	/* store gain */
-							addps %%xmm1, %%xmm4		/* sum += accu */
-							" :
-							: "p" (gain + i), "i" (BANDS * sizeof (float))
-							: "%eax", "%ebx");
-				}
-				
-				asm ("
-						movaps %%xmm4, (%0)
-						flds (%0) 
-						fadds 4(%0)
-						fadds 8(%0)
-						fadds 12(%0)
-						fstps (%0)" : : "p" (temp) : "%st");
-				
-				return temp[0];
-			}
-#endif /* USE_SSE */
 };
 
 } /* namespace DSP */


More information about the Linux-audio-dev mailing list