The pause instruction is part of SSE2 extensions.
Note that some compilers define _mm_pause as "rep; nop" instead of "pause".
For compatible processors, they are equivalent.
http://www.intel.com/Assets/PDF/manual/325383.pdf:
"
When executing a spin-wait loop, a Pentium 4 or Intel Xeon processor suffers
a severe performance penalty when exiting the loop because it detects a
possible memory order violation.
The PAUSE instruction provides a hint to the processor that the code sequence
is a spin-wait loop. The processor uses this hint to avoid the memory order
violation in most situations, which greatly improves processor performance.
"
Signed-off-by: Intel
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
-#include <emmintrin.h>
/*********** Macros to eliminate unused variable warnings ********/
/*********** Other general functions / macros ********/
+#ifdef __SSE2__
+#include <emmintrin.h>
/**
* PAUSE instruction for tight loops (avoid busy waiting)
*/
{
_mm_pause();
}
+#else
+static inline void
+rte_pause(void) {}
+#endif
/**
* Searches the input parameter for the least significant set bit