if you recently have seen my topics, you might have got the idea that I'm entering into the darkside of intrinsics and vectorized programming (what a pain)
I'm faced in front of lots of intrinsics and different instruction sets for C++, and I'm not able to decide which one to use.
I'm "developing" right now for Windows based machine, both 32 and 64 bit.
Which instruction sets are more suited in 2018 for developing plugins?
That can be also a bit "retro compatible" with non-very recent CPU.
AVX? SSE2? MMX? Which Intrinsics suite better for the choice?
I'm about to try to vectorize sin and exp function; I've seen mkl.h and vsSin (even if I'm not really able to include it).
Somethings like this (keeping or removing sin code) introduce +2% CPU, running 16 voices:
Code: Select all
for (int sampleIndex = 0; sampleIndex < blockSize; sampleIndex++) {
double value = (sin(phase)) * pParamGain->GetProcessedVoiceValue(voiceIndex, sampleIndex);
*left++ += value;
*right++ += value;
// next phase
phase += BOUNDED(mRadiansPerSample * (bp0 * pParamPitch->GetProcessedVoiceValue(voiceIndex, sampleIndex) + pParamOffset->GetProcessedVoiceValue(voiceIndex, sampleIndex)), 0, PI);
while (phase >= TWOPI) { phase -= TWOPI; }
}
Any suggestions?
What do you use for your audio plug?
Or do you simply delegate to the smartness of Auto-vectorization?
Thanks