From 8707ba6161b00b582e1789148aabbbc64de59402 Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 22 Aug 2019 23:43:10 +0200 Subject: [PATCH] Cleanups --- sources/InterleavedStereoBuffer.h | 48 ------------------------------- sources/Intrinsics.h | 11 ------- sources/SIMDSSE.cpp | 10 ++++++- 3 files changed, 9 insertions(+), 60 deletions(-) delete mode 100644 sources/InterleavedStereoBuffer.h delete mode 100644 sources/Intrinsics.h diff --git a/sources/InterleavedStereoBuffer.h b/sources/InterleavedStereoBuffer.h deleted file mode 100644 index 07c7b98b..00000000 --- a/sources/InterleavedStereoBuffer.h +++ /dev/null @@ -1,48 +0,0 @@ -#include "Globals.h" -template -class InterleavedStereoBuffer -{ -public: - static constexpr int numChannels { 2 }; - InterleavedStereoBuffer() = default; - InterleavedStereoBuffer(int numFrames) - { - resize(numFrames); - } - - bool resize(int numFrames) - { - // should have a positive number of frames... - ASSERT(numFrames >= 0); - if (buffer.resize(static_cast(2*numFrames))) - { - this->numFrames = numFrames; - return true; - } - return false; - } - - struct Frame - { - Type left; - Type right; - }; - - Frame& getFrame(int frameIndex) - { - return *static_cast(buffer.data() + 2 * frameIndex); - } - - int getNumFrames() const noexcept { return numFrames; } - int getNumChannels() const noexcept { return numChannels; } - bool empty() const noexcept { return numFrames == 0; } -private: - static constexpr auto TypeAlignment { Alignment / sizeof(Type) }; - static constexpr auto TypeAlignmentMask { TypeAlignment - 1 }; - static_assert(TypeAlignment * sizeof(Type) == Alignment, "The alignment does not appear to be divided by the size of the Type"); - int numFrames { 0 }; - int totalSize { 0 }; - int padding { 0 }; - Buffer buffer {}; - Type trash { 0 }; -}; \ No newline at end of file diff --git a/sources/Intrinsics.h b/sources/Intrinsics.h deleted file mode 100644 index fb89449e..00000000 --- a/sources/Intrinsics.h +++ /dev/null @@ -1,11 +0,0 @@ -#if HAVE_X86INTRIN_H -#include -#endif - -#if HAVE_INTRIN_H -#include -#endif - -#if HAVE_ARM_NEON_H -#include -#endif \ No newline at end of file diff --git a/sources/SIMDSSE.cpp b/sources/SIMDSSE.cpp index 0180eecb..5864883b 100644 --- a/sources/SIMDSSE.cpp +++ b/sources/SIMDSSE.cpp @@ -1,6 +1,14 @@ #include "SIMDHelpers.h" #include "Helpers.h" -#include "x86intrin.h" + +#if HAVE_X86INTRIN_H +#include +#endif + +#if HAVE_INTRIN_H +#include +#endif + #include "mathfuns/sse_mathfun.h" using Type = float;