1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-07 04:10:08 +00:00

New method: FloatVectorOperations::enableFlushToZeroMode()

This commit is contained in:
jules 2013-09-23 11:17:43 +01:00
parent 5051b2ffcc
commit 239c15845a
2 changed files with 14 additions and 0 deletions

View file

@ -332,3 +332,12 @@ float JUCE_CALLTYPE FloatVectorOperations::findMaximum (const float* src, int nu
return juce::findMaximum (src, num);
#endif
}
void JUCE_CALLTYPE FloatVectorOperations::enableFlushToZeroMode (bool shouldEnable) noexcept
{
#if JUCE_USE_SSE_INTRINSICS
if (FloatVectorHelpers::isSSE2Available())
_MM_SET_FLUSH_ZERO_MODE (shouldEnable ? _MM_FLUSH_ZERO_ON : _MM_FLUSH_ZERO_OFF);
#endif
(void) shouldEnable;
}

View file

@ -73,6 +73,11 @@ public:
/** Finds the maximum value in the given array. */
static float JUCE_CALLTYPE findMaximum (const float* src, int numValues) noexcept;
/** On Intel CPUs, this method enables or disables the SSE flush-to-zero mode.
Effectively, this is a wrapper around a call to _MM_SET_FLUSH_ZERO_MODE
*/
static void JUCE_CALLTYPE enableFlushToZeroMode (bool shouldEnable) noexcept;
};