Skip to content

Commit

Permalink
Initial support for ppc64le (#1316)
Browse files Browse the repository at this point in the history
Signed-off-by: mgiessing <[email protected]>
  • Loading branch information
mgiessing authored Aug 22, 2024
1 parent a685654 commit 432a4f4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions include/Portable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <altivec.h>
#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
Expand Down
2 changes: 1 addition & 1 deletion include/SIMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ template <> struct InstrFloatTraits<Scalar, double>
}
}

#if !defined(__aarch64__)
#if !defined(__aarch64__) && !defined(__powerpc64__)
#ifdef USE_SSE42
#ifndef _MSC_VER
#include <popcntintrin.h>
Expand Down
2 changes: 1 addition & 1 deletion include/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 432a4f4

Please sign in to comment.