[SOLVED] SIMDRegister bitwise-NOT not working

Hi there,
I’m looking for an answer to something that is really bugging me,
I cant get comparisons running in SIMDRegister.
My compiler (Xcode 10.1) says:

Undefined symbols for architecture x86_64:
“juce::dsp::SIMDNativeOps::kAllBitsSet”, referenced from:
juce::dsp::SIMDNativeOps::bit_not(long long vector[2]) in libGainPlugin.a(Main.o)
ld: symbol(s) not found for architecture x86_64

Here is a simple nonsense processblock to generate the error.
If anyone can check this (and help me fix it…), that would be really great.

Add at top of file:
#include <juce_dsp/juce_dsp.h>

Then add this processBlock:

void processBlock (AudioBuffer<float>& buffer, MidiBuffer& midiMessages) override
        // get some input
        auto* audioData = buffer.getWritePointer (0);
        // make 2 vectors filled with the first bytes
        auto inVector1 = dsp::SIMDRegister<float>::expand(audioData[0]);
        auto inVector2 = dsp::SIMDRegister<float>::expand(audioData[1]);
        auto mask = (dsp::SIMDRegister<float>::lessThan(inVector1, inVector2)) ;
        // the following bitwise NOT function goes wrong ( Juce 5.4.3)
        // macos xcode 10.1
        auto notmask = ~mask;
        auto outputVector = ( inVector1 & mask) + ( inVector2 & (notmask));
        // write back the (admittedly) useless result
        audioData[0]= outputVector[0];

I found that the error is in the line " auto notmask = ~mask; "
The ~ operator here is not working, it references a none existing kAllbitsSet.
I tried to trace back more, but it is basically over my head.

did you include the juce_dsp module in the projucer?

1 Like

thank you! that was the solution.
I’m not used to this kind of module includes… lesson learned!

Speaking of double, you don’t need to include any JUCE headers in your code, it is all included with the one JuceHeader.h, which is assembled by the Projucer when saving the project.

ah ok! I was the one doing double stuff and wrongly…
I’m just not deep enough into the whole JUCE framework, 've been just concentrating on the algorhythms and basically blending out the rest…thanks again!