From 144e14f2f5848ac7dcba4c05727dd0c1b3fb0611 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Mon, 12 Apr 2021 17:28:17 -0400 Subject: [PATCH] Fix simd_sse on WIN32 --- .gitignore | 5 ++++- include/athena/simd/simd_sse.hpp | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index c45fbfc..3a97bc9 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,7 @@ PKGBUILD **/doc **/obj **/Makefile - +/build +/out +/cmake-build-* +/.idea \ No newline at end of file diff --git a/include/athena/simd/simd_sse.hpp b/include/athena/simd/simd_sse.hpp index 6e4866c..052b057 100644 --- a/include/athena/simd/simd_sse.hpp +++ b/include/athena/simd/simd_sse.hpp @@ -31,7 +31,7 @@ public: using storage_type = __m128; storage_type __storage_{}; [[nodiscard]] inline float __get(size_t __index) const noexcept { -#if _MSC_VER && !defined(__clang__) +#if _MSC_VER alignas(16) std::array sse_data; _mm_store_ps(sse_data.data(), __storage_); return sse_data[__index]; @@ -40,7 +40,7 @@ public: #endif } inline void __set(size_t __index, float __val) noexcept { -#if _MSC_VER && !defined(__clang__) +#if _MSC_VER alignas(16) std::array sse_data; _mm_store_ps(sse_data.data(), __storage_); sse_data[__index] = __val; @@ -210,7 +210,7 @@ public: using storage_type = std::array<__m128d, 2>; storage_type __storage_{}; [[nodiscard]] inline double __get(size_t __index) const noexcept { -#if _MSC_VER && !defined(__clang__) +#if _MSC_VER alignas(16) std::array sse_data; _mm_store_pd(sse_data.data(), __storage_[__index / 2]); return sse_data[__index % 2]; @@ -219,13 +219,13 @@ public: #endif } inline void __set(size_t __index, double __val) noexcept { -#if _MSC_VER && !defined(__clang__) +#if _MSC_VER alignas(16) std::array sse_data; _mm_store_pd(sse_data.data(), __storage_[__index / 2]); sse_data[__index % 2] = __val; __storage_[__index / 2] = _mm_load_pd(sse_data.data()); #else - __storage_[__index / 2][__index % 2] = __val; + __storage_[__index / 2][__index % 2] = __val; #endif } // Make GCC happy