[bug] Problem with SIMDregister masking (juce 5.4.3 xcode 10.1 macos 10.14.4)


Hi everyone,
I get a strange error, but I’m new in SIMD, so it might be something obvious…

The following limiter code compiles correctly:
auto mask = dsp::SIMDRegister< float >::greaterThan(accu,halfVector);
accu = ( halfVector & mask) + ( accu & (~mask));

But the linker quits with an error:
Undefined symbols for architecture x86_64:

EDIT: I must add that sofar the rest of my SIMD code works fine (and fast): it is only this mask creation that creates a link error on kAllBitsSet



Which SIMD implementation is being used? Are any of juce_dsp/native/juce_avx_SIMDNativeOps.h, juce_dsp/native/juce_sse_SIMDNativeOps.h, or juce_dsp/native/juce_neon_SIMDNativeOps.h being included?

1 Like


juce_dsp/native/juce_sse_SIMDNativeOps.h is included by Juce.



a bit more info: The error is caused by the ~ operator.

“juce::dsp::SIMDNativeOps::kAllBitsSet”, referenced from:
juce::dsp::SIMDRegister::operator~() const in lto.o
ld: symbol(s) not found for architecture x86_64

In SIMS Register.h the ~ is declared like this:

inline SIMDRegister JUCE_VECTOR_CALLTYPE operator ~() const noexcept { return { NativeOps::bit_not (value) }; }

this references the SSE function in juce_sse_SIMDNativeOps.h), where kAllBitsSet is referenced:

static forcedinline __m128 JUCE_VECTOR_CALLTYPE bit_not (__m128 a) noexcept { return bit_notand (a, _mm_loadu_ps ((float*) kAllBitsSet)); }

kAllBitsSet is however declared on the same page like this:

DECLARE_SSE_SIMD_CONST (int32_t, kAllBitsSet);

So I can not see the reason why kAllBitsSet isn’t defined…