20#ifndef SEQAN3_HAS_MM_PAUSE
21# if defined(__SSE2__) && __has_include(<xmmintrin.h>)
22# include <xmmintrin.h>
23# define SEQAN3_HAS_MM_PAUSE 1
25# define SEQAN3_HAS_MM_PAUSE 0
30namespace seqan3::detail
49 constexpr spin_delay() noexcept = default;
50 constexpr spin_delay(spin_delay const &) noexcept = default;
51 constexpr spin_delay(spin_delay &&) noexcept = default;
52 constexpr spin_delay & operator=(spin_delay const &) noexcept = default;
53 constexpr spin_delay & operator=(spin_delay &&) noexcept = default;
54 ~spin_delay() noexcept = default;
67 if (current <= max_repetitions)
69 for (int_fast32_t i = 0; i < current; ++i)
81 void pause_processor()
83#if SEQAN3_HAS_MM_PAUSE
85#elif defined(__armel__) || defined(__ARMEL__)
86 asm volatile(
"nop" :::
"memory");
87#elif defined(__arm__) || defined(__aarch64__)
88 __asm__ __volatile__(
"yield" :::
"memory");
89#elif defined(__ia64__)
90 __asm__ __volatile__(
"hint @pause");
91#elif defined(__powerpc__) || defined(__ppc__) || defined(__PPC__) || defined(__ppc64__)
92# if defined(__APPLE__)
93 __asm__
volatile(
"or r27,r27,r27" :::
"memory");
95 __asm__ __volatile__(
"or 27,27,27" :::
"memory");
98 asm volatile(
"nop" :::
"memory");
103 static constexpr int_fast32_t max_repetitions{16};
105 int_fast32_t current{1};