diff --git a/include/Portable.h b/include/Portable.h index 090a25065..59b6dc840 100644 --- a/include/Portable.h +++ b/include/Portable.h @@ -26,8 +26,31 @@ typedef struct {float a; float b; float c; float d;} __m128; typedef struct {int a; int b; int c; int d;} __m128i; typedef struct {double a; double b;} __m128d; #endif +#elif defined(__powerpc64__) +#ifdef __CUDACC__ +#undef USE_VSX // Doesn't work with nvcc, undefined symbols +#else +#include +#undef USE_VSX // Not yet implemented +#endif +#undef USE_AVX // x86_64 only +#undef USE_AVX2 // x86_64 only +#undef USE_SSE2 // x86_64 only +#undef USE_SSE41 // x86_64 only +#undef USE_SSE42 // x86_64 only +#undef USE_FMA // x86_64 only +#ifdef USE_VSX +typedef vector float __m128; +typedef vector signed int __m128i; +typedef vector double __m128d; +#else +typedef struct {float a; float b; float c; float d;} __m128; +typedef struct {int a; int b; int c; int d;} __m128i; +typedef struct {double a; double b;} __m128d; +#endif #else #undef USE_NEON // ARM64 only +#undef USE_VSX // PPC only #ifdef __FMA__ #define USE_FMA #endif diff --git a/include/SIMD.h b/include/SIMD.h index 9d1410c73..6222af04f 100644 --- a/include/SIMD.h +++ b/include/SIMD.h @@ -41,7 +41,7 @@ template <> struct InstrFloatTraits } } -#if !defined(__aarch64__) +#if !defined(__aarch64__) && !defined(__powerpc64__) #ifdef USE_SSE42 #ifndef _MSC_VER #include diff --git a/include/Type.h b/include/Type.h index 16bf3e3ae..2c0ab6ed6 100644 --- a/include/Type.h +++ b/include/Type.h @@ -10,7 +10,7 @@ using std::size_t; namespace BinSearch { -enum InstrSet { Scalar, SSE, AVX, Neon }; +enum InstrSet { Scalar, SSE, AVX, Neon, VSX }; #define ALGOENUM(x, b) x, enum Algos