17 #if defined(__SSE2__) // AMD and Intel
18 #include <xmmintrin.h>
23 namespace seqan3::detail
42 constexpr spin_delay() noexcept = default;
43 constexpr spin_delay(spin_delay const &) noexcept = default;
44 constexpr spin_delay(spin_delay &&) noexcept = default;
45 constexpr spin_delay & operator=(spin_delay const &) noexcept = default;
46 constexpr spin_delay & operator=(spin_delay &&) noexcept = default;
47 ~spin_delay() noexcept = default;
59 if (current <= max_repetitions)
61 for (int_fast32_t i = 0; i < current; ++i)
74 void pause_processor()
76 #if defined(__SSE2__) // AMD and Intel
78 #elif defined(__armel__) || defined(__ARMEL__) // arm, but broken? ; repeat of default case as armel also defines __arm__
79 asm volatile (
"nop" :::
"memory");
80 #elif defined(__arm__) || defined(__aarch64__) // arm big endian / arm64
81 __asm__ __volatile__ (
"yield" :::
"memory");
82 #elif defined(__ia64__) // IA64
83 __asm__ __volatile__ (
"hint @pause");
84 #elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) // PowerPC
85 __asm__ __volatile__ (
"or 27,27,27" :::
"memory");
86 #else // everything else.
87 asm volatile (
"nop" :::
"memory");
92 static constexpr int_fast32_t max_repetitions{16};
94 int_fast32_t current{1};