void-packages/srcpkgs/rspamd/patches/vsx.patch

63 lines
2.2 KiB
Diff

commit a6f43886153bfa63a609720e02bcc9c6f4a50140
Author: q66 <daniel@octaforge.org>
Date: Mon Jan 6 00:48:43 2020 +0100
Disable VSX on platforms without it
diff --git contrib/lua-torch/torch7/lib/TH/THVector.c contrib/lua-torch/torch7/lib/TH/THVector.c
index 4410578..c972b13 100644
--- contrib/lua-torch/torch7/lib/TH/THVector.c
+++ contrib/lua-torch/torch7/lib/TH/THVector.c
@@ -6,7 +6,7 @@
#include "vector/NEON.c"
#endif
-#ifdef __PPC64__
+#if defined(__PPC64__) && defined(__VSX__)
#include "vector/VSX.c"
#endif
diff --git contrib/lua-torch/torch7/lib/TH/generic/THVectorDispatch.c contrib/lua-torch/torch7/lib/TH/generic/THVectorDispatch.c
index 5b88852..8ab4f67 100644
--- contrib/lua-torch/torch7/lib/TH/generic/THVectorDispatch.c
+++ contrib/lua-torch/torch7/lib/TH/generic/THVectorDispatch.c
@@ -20,7 +20,7 @@ static FunctionDescription THVector_(fill_DISPATCHTABLE)[] = {
#endif
#endif
- #if defined(__PPC64__)
+ #if defined(__PPC64__) && defined(__VSX__)
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
FUNCTION_IMPL(THVector_(fill_VSX), SIMDExtension_VSX),
#endif
@@ -85,7 +85,7 @@ static FunctionDescription THVector_(adds_DISPATCHTABLE)[] = {
#endif
#endif
- #if defined(__PPC64__)
+ #if defined(__PPC64__) && defined(__VSX__)
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
FUNCTION_IMPL(THVector_(adds_VSX), SIMDExtension_VSX),
#endif
@@ -146,7 +146,7 @@ static FunctionDescription THVector_(muls_DISPATCHTABLE)[] = {
#endif
#endif
- #if defined(__PPC64__)
+ #if defined(__PPC64__) && defined(__VSX__)
#if defined(TH_REAL_IS_DOUBLE) || defined(TH_REAL_IS_FLOAT)
FUNCTION_IMPL(THVector_(muls_VSX), SIMDExtension_VSX),
#endif
diff --git contrib/lua-torch/torch7/lib/TH/generic/simd/simd.h contrib/lua-torch/torch7/lib/TH/generic/simd/simd.h
index 83c4c56..0919f73 100644
--- contrib/lua-torch/torch7/lib/TH/generic/simd/simd.h
+++ contrib/lua-torch/torch7/lib/TH/generic/simd/simd.h
@@ -43,7 +43,7 @@ enum SIMDExtensions
{
#if defined(__NEON__)
SIMDExtension_NEON = 0x1,
-#elif defined(__PPC64__)
+#elif defined(__PPC64__) && defined(__VSX__)
SIMDExtension_VSX = 0x1,
#else
SIMDExtension_AVX2 = 0x1,