25#include "../vctr/vctr.h"
26#include <juce_dsp/juce_dsp.h>
58template <is::anyVctr Src>
61 using SIMDRegister = juce::dsp::SIMDRegister<typename Src::value_type>;
63 VCTR_ASSERT (src.size() == SIMDRegister::SIMDNumElements);
65 if constexpr (Config::archARM)
67 return SIMDRegister { src.getNeon (0).value };
71 constexpr size_t registerSize = SIMDRegister::SIMDRegisterSize;
73 if constexpr (registerSize == 32)
75 return SIMDRegister { src.getAVX (0).value };
78 return SIMDRegister { src.getSSE (0).value };
98template <
class SampleType>
101 auto numSamples = block.getNumSamples();
102 return Span { block.getChannelPointer (channelIdx), numSamples };
112template <
class SampleType>
115 auto numSamples = block.getNumSamples();
116 return Span { block.getChannelPointer (channelIdx), numSamples, simdAlignedSpanStorageInfo<SampleType>() };
The view type.
Definition: Span.h:51
Helper functions to integrate vctr into dsp code written with JUCE (https://github....
Definition: vctr_juce_helpers.h:33
auto blockChannelAsSpanSIMDAligned(const juce::dsp::AudioBlock< SampleType > &block, size_t channelIdx)
Returns a Span that views a single channel of a juce::dsp::AudioBlock, expecting SIMD aligned memory.
Definition: vctr_juce_helpers.h:113
auto blockChannelAsSpan(const juce::dsp::AudioBlock< SampleType > &block, size_t channelIdx)
Returns a Span that views a single channel of a juce::dsp::AudioBlock.
Definition: vctr_juce_helpers.h:99
auto toSIMDRegister(const Src &src)
Loads the first elements of src into a juce::SIMDRegister.
Definition: vctr_juce_helpers.h:59