rl ·
Once again I tried to push SM to the max. I know that I did some "not officially supported" things, but I thought I share my observations:
In order to play sampled data through the code component I wrote a small program that transforms wave files into float arrays.
The result looks like this:
monoout o;
float samples[6699]; stage(0) { samples [0] = -0.00895691; samples [1] = -0.01460266; samples [2] = -0.01992798; samples [3] = -0.01992798; samples [4] = -0.01205444; samples [5] = 0.00076294; samples [6] = 0.01417542; samples [7] = 0.02403259; ..... samples [6698] = ....
On the first naive attempt to cut&paste the 6699 initializations into the code component SM hang - according to the task manager it was busy allocating memory - so I tried with smaller chunks. Starting with 100 lines SM then slowed remarkably down, at 200 lines it was almost unusable.
more observations: Viewing the assembled code SM creates temporary variables for each float literal
float temp=0.0; int arrayindex=0; float smzero=0; float samplesmax=6698.000000; float F0P000000=0.000000; float FM0P008957=-0.008957; float F1P000000=1.000000; float FM0P014603=-0.014603; float F2P000000=2.000000; float FM0P019928=-0.019928; ...
after creating lots of literals the array ist filled:
float samples[6699]; stage0; //ArrayIndex> sLeft=F0P000000 //ArrayIndex> m_sAssignVar=samples movaps xmm0,F0P000000; maxps xmm0,smzero; minps xmm0,samplesmax; movaps temp,xmm0; fld temp[0]; fistp arrayindex[0]; fld temp[1]; fistp arrayindex[1]; fld temp[2]; fistp arrayindex[2]; fld temp[3]; fistp arrayindex[3];
I don't know, whether this has some impact on performance. Also note that SSE registers are filled, but at this stage the code only has a monoout connector.
Q: - are there soft/hard limits on lines of code, array sizes, max indices? - are there best practices with array initialization?