mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 19:24:07 +08:00
core: fix mm_pause() for non-SSE i386 builds
replaced to safe binary compatible 'rep; nop' asm instruction
This commit is contained in:
parent
474a23bda5
commit
7dc162cb42
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user