110 lines
No EOL
4 KiB
C++
110 lines
No EOL
4 KiB
C++
// Copyright (c) 2019, Paul Ferrand
|
|
// All rights reserved.
|
|
|
|
// Redistribution and use in source and binary forms, with or without
|
|
// modification, are permitted provided that the following conditions are met:
|
|
|
|
// 1. Redistributions of source code must retain the above copyright notice, this
|
|
// list of conditions and the following disclaimer.
|
|
// 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
// this list of conditions and the following disclaimer in the documentation
|
|
// and/or other materials provided with the distribution.
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#include "Helpers.h"
|
|
#include "SIMDHelpers.h"
|
|
|
|
template <>
|
|
void readInterleaved<float, true>(absl::Span<const float> input, absl::Span<float> outputLeft, absl::Span<float> outputRight) noexcept
|
|
{
|
|
readInterleaved<float, false>(input, outputLeft, outputRight);
|
|
}
|
|
|
|
template <>
|
|
void writeInterleaved<float, true>(absl::Span<const float> inputLeft, absl::Span<const float> inputRight, absl::Span<float> output) noexcept
|
|
{
|
|
writeInterleaved<float, false>(inputLeft, inputRight, output);
|
|
}
|
|
|
|
template <>
|
|
void fill<float, true>(absl::Span<float> output, float value) noexcept
|
|
{
|
|
fill<float, false>(output, value);
|
|
}
|
|
|
|
template <>
|
|
void exp<float, true>(absl::Span<const float> input, absl::Span<float> output) noexcept
|
|
{
|
|
exp<float, false>(input, output);
|
|
}
|
|
|
|
template <>
|
|
void log<float, true>(absl::Span<const float> input, absl::Span<float> output) noexcept
|
|
{
|
|
log<float, false>(input, output);
|
|
}
|
|
|
|
template <>
|
|
void sin<float, true>(absl::Span<const float> input, absl::Span<float> output) noexcept
|
|
{
|
|
sin<float, false>(input, output);
|
|
}
|
|
|
|
template <>
|
|
void cos<float, true>(absl::Span<const float> input, absl::Span<float> output) noexcept
|
|
{
|
|
cos<float, false>(input, output);
|
|
}
|
|
|
|
template <>
|
|
void applyGain<float, true>(float gain, absl::Span<const float> input, absl::Span<float> output) noexcept
|
|
{
|
|
applyGain<float, false>(gain, input, output);
|
|
}
|
|
|
|
template <>
|
|
void applyGain<float, true>(absl::Span<const float> gain, absl::Span<const float> input, absl::Span<float> output) noexcept
|
|
{
|
|
applyGain<float, false>(gain, input, output);
|
|
}
|
|
|
|
template <>
|
|
float loopingSFZIndex<float, true>(absl::Span<const float> jumps, absl::Span<float> leftCoeff, absl::Span<float> rightCoeff, absl::Span<int> indices, float floatIndex, float loopEnd, float loopStart) noexcept
|
|
{
|
|
return loopingSFZIndex<float, false>(jumps, leftCoeff, rightCoeff, indices, floatIndex, loopEnd, loopStart);
|
|
}
|
|
|
|
template <>
|
|
float saturatingSFZIndex<float, true>(absl::Span<const float> jumps, absl::Span<float> leftCoeff, absl::Span<float> rightCoeff, absl::Span<int> indices, float floatIndex, float loopEnd) noexcept
|
|
{
|
|
return saturatingSFZIndex<float, false>(jumps, leftCoeff, rightCoeff, indices, floatIndex, loopEnd);
|
|
}
|
|
|
|
|
|
template <>
|
|
float linearRamp<float, true>(absl::Span<float> output, float start, float step) noexcept
|
|
{
|
|
return linearRamp<float, false>(output, start, step);
|
|
}
|
|
|
|
template <>
|
|
float multiplicativeRamp<float, true>(absl::Span<float> output, float start, float step) noexcept
|
|
{
|
|
return multiplicativeRamp<float, false>(output, start, step);
|
|
}
|
|
|
|
template <>
|
|
void add<float, true>(absl::Span<const float> input, absl::Span<float> output) noexcept
|
|
{
|
|
add<float, false>(input, output);
|
|
} |