From 9c0dbec8c99288138a1dbaadc4461d0e6980e041 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Tue, 15 Dec 2020 15:31:17 +0100 Subject: [PATCH] Fix SIMD ctor and Unpack --- libsrc/core/simd_generic.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libsrc/core/simd_generic.hpp b/libsrc/core/simd_generic.hpp index c83b5348..5846ad4c 100644 --- a/libsrc/core/simd_generic.hpp +++ b/libsrc/core/simd_generic.hpp @@ -76,7 +76,7 @@ namespace ngcore SIMD hi; public: - SIMD (int i) : lo(i), hi(i-N1) { ; } + SIMD (size_t i) : lo(i), hi(i>N1 ? i-N1 : 0) { ; } SIMD (SIMD lo_, SIMD hi_) : lo(lo_), hi(hi_) { ; } SIMD Lo() const { return lo; } SIMD Hi() const { return hi; } @@ -664,6 +664,11 @@ namespace ngcore { return std::make_tuple(SIMD{a.Data()}, SIMD{b.Data()} ); } + else if constexpr(N==2) + { + return std::make_tuple(SIMD{ a.Lo(), b.Lo() }, + SIMD{ a.Hi(), b.Hi() }); + } else { auto [a1,b1] = Unpack(a.Lo(), b.Lo());