Re: [Mixxx-devel] [PATCH] Add SSE3 optimized version of EngineFilterIIR

2011-01-06 Thread Owen Williams
Building on linux I get:

src/engine/enginefilteriir.cpp:93: error: expected ‘,’ or ‘...’ before ‘FILTER’

referring to: 

EngineFilterIIR::EngineFilterIIR(const double *pCoefs, int iOrder FILTER)



Owen


On Wed, 2011-01-05 at 23:49 -0600, Gabriel M. Beddingfield wrote:
 Below was originally sent 12/5 -- but because I flubbed up 
 my ML subscription... it didn't make it to you...
 ==
 
 Hello,
 
 Attached is a patch against 1.8.1 to add version of the 
 EngineFilterIIR that is SSE3 optimized.  Yes, it needs more 
 comments... but here's what I have for now.
 
 Brief explanation of the implementation:
 
 0. I used assert() a lot... so to get it to compile right
use: -O3 -DNDEBUG -msse -msse2 -msse3 -ffast-math
 -funroll-loops
 
 1. Left and Right channels are calculated in parallel.
(This is mostly the point of doing the SSE3 opts.)
 
 2. The buffer of the previous N samples is converted
to a ring buffer in order to avoid the data shuffling.
 
  x[0] = x[1]; x[1] = x[2]; // ... etc ...
 
 3. To replace the shuffling, the X and Y coefficients are
put in an NxN matrix that has them pre-shuffled.  The
two matrices are put together side-by-side so that we
can span rows by simple pointer increments.  E.g. for
the 4th order:
 
CXY = [ [ X coeffs ] [ Y coeffs ] ]
 
CXY = [ [ 1.0,  c1,  c2,  c1, /**/ c3, c4, c5, c6 ],
[  c1,  c2,  c1, 1.0, /**/ c4, c5, c6, c3 ],
[  c2,  c1, 1.0,  c1, /**/ c5, c6, c3, c4 ],
[  c1, 1.0,  c1,  c2, /**/ c6, c3, c4, c5 ] ];
 
 4. Several things are converted to local variables in
the process() method so that the compiler to avoid
cache/memory slow-downs.
 
 5. The implementation is templated... which should reduce
maintenance and still allow for hard-coded N values
to be optimized.
 
 Thanks,
 Gabriel
 --
 Learn how Oracle Real Application Clusters (RAC) One Node allows customers
 to consolidate database storage, standardize their database environment, and, 
 should the need arise, upgrade to a full multi-node Oracle RAC database 
 without downtime or disruption
 http://p.sf.net/sfu/oracle-sfdevnl
 ___ Mixxx-devel mailing list 
 Mixxx-devel@lists.sourceforge.net 
 https://lists.sourceforge.net/lists/listinfo/mixxx-devel



--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel


Re: [Mixxx-devel] [PATCH] Add SSE3 optimized version of EngineFilterIIR

2011-01-06 Thread Gabriel M. Beddingfield


On Thu, 6 Jan 2011, Albert Santoni wrote:

 Thanks for the patch Gabriel. Great stuff.

 Has anyone benchmarked this vs. -O2 and -O3?

Yes.  I'll send my test setup where I tested speeds as well 
as fidelity.

Long story short... I get about 20-50% performance boost on 
the filter.  (Atom gets about a 20% boost, a Core2 gets 
about a 40-50% performance boost)

-gabriel


--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel


Re: [Mixxx-devel] [PATCH] Add SSE3 optimized version of EngineFilterIIR

2011-01-06 Thread Gabriel M. Beddingfield


Gentlemen:

On Thu, 6 Jan 2011, Owen Williams wrote:


Building on linux I get:

src/engine/enginefilteriir.cpp:93: error: expected ‘,’ or ‘...’ before ‘FILTER’

referring to:

EngineFilterIIR::EngineFilterIIR(const double *pCoefs, int iOrder FILTER)


Please disregard this patch.  It does not work.  Sorry for 
the noise.  :-/


The long story short is this:  I moved the filter code to 
a test environment in order to isolate and profile it 
better.  When complete, I put the patch into my RPM spec 
file to create a package.  The finished package sounded 
and performed awesome.


Unfortunately, because of a small 1-line thinko... the patch 
wasn't actually _applied_ when built.  I thought I had been 
testing the patch for a month.  In truth, I have not been 
and the patch actually sounds like poo.


Sorry!

Peace,
Gabriel--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl___
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel


Re: [Mixxx-devel] [PATCH] Add SSE3 optimized version of EngineFilterIIR

2011-01-06 Thread Philip Whelan
This work needs to be done, so thanks a lot for taking a stab at it.
Hopefully with time you can finally get it right.

I'll see what I can do with it, although unfortunately this stuff is
not my forte.

--
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
___
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel


Re: [Mixxx-devel] [PATCH] Add SSE3 optimized version of EngineFilterIIR

2011-01-06 Thread Sean M. Pappalardo - D.J. Pegasus
Waitasec, if your patch was not being applied, how were you seeing speed 
improvements? Differences in optimization options?

--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel


Re: [Mixxx-devel] [PATCH] Add SSE3 optimized version of EngineFilterIIR

2011-01-06 Thread Gabriel M. Beddingfield
On Friday, January 07, 2011 01:05:18 am Sean M. Pappalardo - 
D.J. Pegasus wrote:
 Waitasec, if your patch was not being applied, how were
 you seeing speed improvements? Differences in
 optimization options?

I isolated enginefilteriir.cpp and wrote a test program for 
it and any new versions of it.  That's how I saw speed 
improvements.  I'll post this test environment after fixing 
the patch.

When I rebuilt the Mixxx package, the patch went in along 
with some important compiler switches (like --ffast-math and 
-O3), which by themselves will yield a performance 
improvement.

FYI, I've fixed the patch and am now putting it through its 
paces.

-gabriel

--
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
___
Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel