I’ve started porting some of my code to the JUCE DSP framework and have realized that I need some operations in the SIMDRegister class that do not exist yet (things like bit shift operations etc.). For now I’m simply editing juce_SIMDRegister.h, as well as all the juce_xxx_SIMDNativeOps.h files.
However, that seems a bit awkward. Is there any better approach? Would subclassing SIMDRegister negatively impact performance?
I also have some specific questions regarding SIMDRegister:
Certain intrinsics work only with immediate values (constants known at compile time). Is there a way to implement for example a shift right method for SIMDRegister that takes a constant argument? I tried all sorts of combinations of keywords but didn’t succeed so far to make the compiler understand that an argument must be a compile-time constant…
Is there a way to implement a method in SIMDRegister that computes a value v based on the register’s current value, then changes the register’s value and returns v? When I try to implement this, it fails because I can’t return a reference to a local variable (v).
Thanks in advance for any help with this!