infuzion ·
A: Oddson's Tuned Comb Filter produces ASM for their arrays like this: stage1; //ArrayIndex> sLeft=index //ArrayIndex> m_sAssignVar=mem movaps xmm0,index; maxps xmm0,smIntVarZero; minps xmm0,memmax; cvtps2dq xmm0,xmm0; movaps smIntVarArrayIndex,xmm0; //AssignmentArray> sLeft=in push eax; mov eax,smIntVarArrayIndex[0]; shl eax,4; fld in[0]; fstp mem[eax]; ...
However, drag & drop SM's Interpolated Delay from the toolbox, & you'll get this: stage1; //ArrayIndex> sLeft=index //ArrayIndex> m_sAssignVar=mem movaps xmm0,index; maxps xmm0,smIntVarZero; minps xmm0,memmax; movaps smIntVarTemp,xmm0; fld smIntVarTemp[0]; fistp smIntVarArrayIndex[0]; fld smIntVarTemp[1]; fistp smIntVarArrayIndex[1]; fld smIntVarTemp[2]; fistp smIntVarArrayIndex[2]; fld smIntVarTemp[3]; fistp smIntVarArrayIndex[3]; //AssignmentArray> sLeft=in push eax; mov eax,smIntVarArrayIndex[0]; shl eax,4; fld in[0]; fstp mem[eax]; ... I notice that Oddson's uses cvtps2dq, which is a SSE2+ opcode, while the other uses the SSE1 fistp workaround. I'd prefer the SSE2; that's why I have the SSE/2 option unchecked in the Advanced Option tab (to have my OSMs not backwards-compatible to give myself more speed). I may have the older version of the module in the toolbox on my HD since I tend to install-over-the-old (1.1.0). However, seeing that the same exact Code produces different ASM is very confusing, & may cause problems w/old non-SSE2 computers. Also it is disappointing & confusing that rndint() uses the frndint instead of the much faster cvtps2dq, even in Oddson's Code.
Workaround: Replace the Code by turning it into ASM & Hand-optimizing/downgrading. Ideal Solution: Drop SSE1-only backwards compatibility (5yr CPUs?!?, even the $350 laptops can handle atleast SEE2 if not 3) & have everything be SSE2. Compatible Solution: Fix the Advanced Options to have a visual toggle between SSE1 & SSE2 (the text is hard to understand to me), & have all Code output the said ASM level at runtime, not have the different SSE level be saved in the OSM.
B: Arrays use: maxps xmm0,smIntVarZero; minps xmm0,memmax; I'm assuming they're there to ensure not to read/write out of bounds... I'm also assuming they can be hand-removed if there is already index-range checks?
C: Interesting how smIntVarArrayIndex is declared as an integer, but smIntVarTemp & smIntVarZero are both declared as floats? Perhaps they should just be called smTemp/smZero?
D: The editors are still laggy with large texts, which it typical for my commented ASM code . I usually use an external editor for ASM, though for a quick change I will directly edit Code/ASM in SM, as do most people.
thanks for your time!