Consider SIMD width 2 as "native" on all platforms

This commit is contained in:
Matthias Hochsteger 2023-07-28 11:55:26 +02:00
parent 32320a48c1
commit a3ac409add

View File

@ -18,16 +18,10 @@ namespace ngcore
{ {
#if defined __AVX512F__ #if defined __AVX512F__
#define NETGEN_DEFAULT_SIMD_SIZE 8 #define NETGEN_DEFAULT_SIMD_SIZE 8
#define NETGEN_NATIVE_SIMD_SIZE 8
#elif defined __AVX__ #elif defined __AVX__
#define NETGEN_DEFAULT_SIMD_SIZE 4 #define NETGEN_DEFAULT_SIMD_SIZE 4
#define NETGEN_NATIVE_SIMD_SIZE 4
#elif defined NETGEN_ARCH_AMD64
#define NETGEN_DEFAULT_SIMD_SIZE 2
#define NETGEN_NATIVE_SIMD_SIZE 2
#else #else
#define NETGEN_DEFAULT_SIMD_SIZE 2 #define NETGEN_DEFAULT_SIMD_SIZE 2
#define NETGEN_NATIVE_SIMD_SIZE 1
#endif #endif
constexpr int GetDefaultSIMDSize() { constexpr int GetDefaultSIMDSize() {
@ -36,9 +30,7 @@ namespace ngcore
constexpr bool IsNativeSIMDSize(int n) { constexpr bool IsNativeSIMDSize(int n) {
if(n==1) return true; if(n==1) return true;
#if defined NETGEN_ARCH_AMD64 || defined __SSE__ || defined __aarch64__
if(n==2) return true; if(n==2) return true;
#endif
#if defined __AVX__ #if defined __AVX__
if(n==4) return true; if(n==4) return true;
#endif #endif