fmaddsub intrinsics (avx2+avx512)

This commit is contained in:
Joachim Schoeberl 2022-11-20 19:10:30 +01:00
parent c18229535a
commit 2d022013ad
2 changed files with 23 additions and 1 deletions

View File

@ -220,7 +220,17 @@ namespace ngcore
}
#endif
#if defined(__FMA__)
NETGEN_INLINE auto FMAddSub (SIMD<double,4> a, SIMD<double,4> b, SIMD<double,4> c)
{
return _mm256_fmaddsub_pd(a,b,c);
}
#endif
NETGEN_INLINE auto SwapPairs (SIMD<double,4> a)
{
reutrn _mm256_shuffle_pd (a.Data(), a.Data(), 0b0101);
}
NETGEN_INLINE SIMD<mask64,4> operator<= (SIMD<double,4> a , SIMD<double,4> b)
@ -308,6 +318,8 @@ namespace ngcore
{ return _mm256_castpd_si256(_mm256_blendv_pd(_mm256_castsi256_pd(c.Data()), _mm256_castsi256_pd(b.Data()),
_mm256_castsi256_pd(a.Data()))); }
}
#endif // NETGEN_CORE_SIMD_AVX_HPP

View File

@ -259,6 +259,16 @@ namespace ngcore
return _mm512_fnmadd_pd (_mm512_set1_pd(a), b.Data(), c.Data());
}
NETGEN_INLINE auto FMAddSub (SIMD<double,8> a, SIMD<double,8> b, SIMD<double,8> c)
{
return _mm512_fmaddsub_pd(a,b,c);
}
NETGEN_INLINE auto SwapPairs (SIMD<double,8> a)
{
reutrn _mm512_shuffle_pd (a.Data(), a.Data(), 0b01010101);
}
}
#endif // NETGEN_CORE_SIMD_AVX512_HPP