Skip to content

Commit 432a4f4

Browse files
authored
Initial support for ppc64le (#1316)
Signed-off-by: mgiessing <marvin.giessing@gmail.com>
1 parent a685654 commit 432a4f4

3 files changed

Lines changed: 25 additions & 2 deletions

File tree

include/Portable.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,31 @@ typedef struct {float a; float b; float c; float d;} __m128;
2626
typedef struct {int a; int b; int c; int d;} __m128i;
2727
typedef struct {double a; double b;} __m128d;
2828
#endif
29+
#elif defined(__powerpc64__)
30+
#ifdef __CUDACC__
31+
#undef USE_VSX // Doesn't work with nvcc, undefined symbols
32+
#else
33+
#include <altivec.h>
34+
#undef USE_VSX // Not yet implemented
35+
#endif
36+
#undef USE_AVX // x86_64 only
37+
#undef USE_AVX2 // x86_64 only
38+
#undef USE_SSE2 // x86_64 only
39+
#undef USE_SSE41 // x86_64 only
40+
#undef USE_SSE42 // x86_64 only
41+
#undef USE_FMA // x86_64 only
42+
#ifdef USE_VSX
43+
typedef vector float __m128;
44+
typedef vector signed int __m128i;
45+
typedef vector double __m128d;
46+
#else
47+
typedef struct {float a; float b; float c; float d;} __m128;
48+
typedef struct {int a; int b; int c; int d;} __m128i;
49+
typedef struct {double a; double b;} __m128d;
50+
#endif
2951
#else
3052
#undef USE_NEON // ARM64 only
53+
#undef USE_VSX // PPC only
3154
#ifdef __FMA__
3255
#define USE_FMA
3356
#endif

include/SIMD.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ template <> struct InstrFloatTraits<Scalar, double>
4141
}
4242
}
4343

44-
#if !defined(__aarch64__)
44+
#if !defined(__aarch64__) && !defined(__powerpc64__)
4545
#ifdef USE_SSE42
4646
#ifndef _MSC_VER
4747
#include <popcntintrin.h>

include/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using std::size_t;
1010

1111
namespace BinSearch {
1212

13-
enum InstrSet { Scalar, SSE, AVX, Neon };
13+
enum InstrSet { Scalar, SSE, AVX, Neon, VSX };
1414

1515
#define ALGOENUM(x, b) x,
1616
enum Algos

0 commit comments

Comments
 (0)