diff --git a/modules/chowdsp_dsp/SIMD/chowdsp_SIMDUtils.h b/modules/chowdsp_dsp/SIMD/chowdsp_SIMDUtils.h index e31bad577..855aaca67 100644 --- a/modules/chowdsp_dsp/SIMD/chowdsp_SIMDUtils.h +++ b/modules/chowdsp_dsp/SIMD/chowdsp_SIMDUtils.h @@ -277,8 +277,15 @@ Based on: https://forum.juce.com/t/divide-by-simdregister/28968/18 template inline typename juce::dsp::SIMDRegister::vMaskType isnanSIMD (juce::dsp::SIMDRegister x) { + // For some reason, xsimd::isnan returns a batch of doubles when using SSE + // but returns a batch of unsigned ints when using ARM NEON. +#if JUCE_ARM + using MaskVec = typename juce::dsp::SIMDRegister::vMaskType; + return (MaskVec) xsimd::isnan ((x_type) x.value); +#else using Vec = juce::dsp::SIMDRegister; return Vec::notEqual ((Vec) xsimd::isnan ((x_type) x.value), (Vec) 0); +#endif } // Template specializations for NEON double precision