fix wrong simd operators

This commit is contained in:
Matthias Hochsteger 2020-12-14 12:47:45 +01:00
parent fc44eb95df
commit 248145bbf0

View File

@ -338,7 +338,7 @@ namespace ngcore
template <typename T, int N>
NETGEN_INLINE SIMD<T,N> operator- (SIMD<T,N> a, SIMD<T,N> b) {
if constexpr(N==1) return a.Data()-b.Data();
else return { a.Lo()-b.Lo(), a.Hi()+b.Hi() };
else return { a.Lo()-b.Lo(), a.Hi()-b.Hi() };
}
template <typename T, int N>
NETGEN_INLINE SIMD<T,N> operator- (SIMD<T,N> a) {
@ -349,13 +349,13 @@ namespace ngcore
template <typename T, int N>
NETGEN_INLINE SIMD<T,N> operator* (SIMD<T,N> a, SIMD<T,N> b) {
if constexpr(N==1) return a.Data()*b.Data();
else return { a.Lo()*b.Lo(), a.Hi()+b.Hi() };
else return { a.Lo()*b.Lo(), a.Hi()*b.Hi() };
}
template <typename T, int N>
NETGEN_INLINE SIMD<T,N> operator/ (SIMD<T,N> a, SIMD<T,N> b) {
if constexpr(N==1) return a.Data()/b.Data();
else return { a.Lo()/b.Lo(), a.Hi()+b.Hi() };
else return { a.Lo()/b.Lo(), a.Hi()/b.Hi() };
}
template <typename T, int N>