// Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors. // All rights reserved. // Code licensed under the BSD License. // http://www.anki3d.org/LICENSE #pragma once #include #if ANKI_SIMD_SSE # include #elif ANKI_SIMD_NEON # include #elif !ANKI_SIMD_NONE # error "See file" #endif namespace anki { /// Template class that holds SIMD info for the math classes. template class MathSimd { public: using Type = T[N]; static constexpr U ALIGNMENT = alignof(T); }; #if ANKI_SIMD_SSE // Specialize for F32 template<> class MathSimd { public: using Type = __m128; static constexpr U ALIGNMENT = 16; }; #elif ANKI_SIMD_NEON // Specialize for F32 template<> class MathSimd { public: using Type = float32x4_t; static constexpr U ALIGNMENT = 16; }; #endif } // end namespace anki