void-packages/srcpkgs/rspamd/patches/vsx.patch
Đoàn Trần Công Danh 103ab731ab srcpkgs/r*: convert patches to -Np1
* runit is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

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
--- a/contrib/lua-torch/torch7/lib/TH/THVector.c
+++ b/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
--- a/contrib/lua-torch/torch7/lib/TH/generic/THVectorDispatch.c
+++ b/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
--- a/contrib/lua-torch/torch7/lib/TH/generic/simd/simd.h
+++ b/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,