summaryrefslogtreecommitdiff
path: root/user/opencv/pmmx.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-08-01 17:40:41 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-08-01 17:40:41 -0500
commit879d0c8f29f4bfbe87e4a6572592d8a79bf55e6b (patch)
tree8d5ea6faf91969a5695568514d4996cddc420502 /user/opencv/pmmx.patch
parent26baf6ee4e010ad434c4b3c3d4bd4c7ebf981ecc (diff)
downloadpackages-879d0c8f29f4bfbe87e4a6572592d8a79bf55e6b.tar.gz
packages-879d0c8f29f4bfbe87e4a6572592d8a79bf55e6b.tar.bz2
packages-879d0c8f29f4bfbe87e4a6572592d8a79bf55e6b.tar.xz
packages-879d0c8f29f4bfbe87e4a6572592d8a79bf55e6b.zip
user/opencv: fix build on Intel platforms
Diffstat (limited to 'user/opencv/pmmx.patch')
-rw-r--r--user/opencv/pmmx.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/user/opencv/pmmx.patch b/user/opencv/pmmx.patch
new file mode 100644
index 000000000..f36d643cf
--- /dev/null
+++ b/user/opencv/pmmx.patch
@@ -0,0 +1,27 @@
+From 7dc162cb4252ccf461f1c63650abde3c8807b79c Mon Sep 17 00:00:00 2001
+From: Alexander Alekhin <alexander.alekhin@intel.com>
+Date: Mon, 9 Apr 2018 18:25:51 +0300
+Subject: [PATCH] core: fix mm_pause() for non-SSE i386 builds
+
+replaced to safe binary compatible 'rep; nop' asm instruction
+---
+ modules/core/src/parallel_impl.cpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/modules/core/src/parallel_impl.cpp b/modules/core/src/parallel_impl.cpp
+index 78d9eb63694..bc64fce7a81 100644
+--- a/modules/core/src/parallel_impl.cpp
++++ b/modules/core/src/parallel_impl.cpp
+@@ -49,7 +49,11 @@ DECLARE_CV_YIELD
+ DECLARE_CV_PAUSE
+ #endif
+ #ifndef CV_PAUSE
+-#if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
++# if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
++# if !defined(__SSE__)
++ static inline void cv_non_sse_mm_pause() { __asm__ __volatile__ ("rep; nop"); }
++# define _mm_pause cv_non_sse_mm_pause
++# endif
+ # define CV_PAUSE(v) do { for (int __delay = (v); __delay > 0; --__delay) { _mm_pause(); } } while (0)
+ # elif defined __GNUC__ && defined __aarch64__
+ # define CV_PAUSE(v) do { for (int __delay = (v); __delay > 0; --__delay) { asm volatile("yield" ::: "memory"); } } while (0)