Warning, file /include/QtCore/qyieldcpu.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005 #ifndef QYIELDCPU_H
0006 #define QYIELDCPU_H
0007
0008 #include <QtCore/qcompilerdetection.h>
0009 #include <QtCore/qprocessordetection.h>
0010 #include <QtCore/qtconfigmacros.h>
0011
0012 #ifdef Q_CC_MSVC_ONLY
0013
0014
0015 # ifdef __cplusplus
0016 # include <atomic>
0017 extern "C"
0018 # endif
0019 void _mm_pause(void);
0020 #endif
0021
0022 QT_BEGIN_NAMESPACE
0023
0024 #ifdef Q_CC_GNU
0025 __attribute__((artificial))
0026 #endif
0027 Q_ALWAYS_INLINE void qYieldCpu(void) Q_DECL_NOEXCEPT;
0028
0029 void qYieldCpu(void)
0030 #ifdef __cplusplus
0031 noexcept
0032 #endif
0033 {
0034 #if __has_builtin(__yield)
0035 __yield();
0036 #elif defined(_YIELD_PROCESSOR) && defined(Q_CC_MSVC)
0037 _YIELD_PROCESSOR();
0038
0039 #elif __has_builtin(__builtin_ia32_pause)
0040 __builtin_ia32_pause();
0041 #elif defined(Q_PROCESSOR_X86) && defined(Q_CC_GNU)
0042
0043 __builtin_ia32_pause();
0044 #elif defined(Q_PROCESSOR_X86) && defined(Q_CC_MSVC)
0045 _mm_pause();
0046 #elif defined(Q_PROCESSOR_X86)
0047 asm("pause");
0048
0049 #elif __has_builtin(__builtin_arm_yield)
0050 __builtin_arm_yield();
0051 #elif defined(Q_PROCESSOR_ARM) && Q_PROCESSOR_ARM >= 7 && defined(Q_CC_GNU)
0052 asm("yield");
0053
0054 #elif defined(Q_PROCESSOR_RISCV)
0055 asm(".word 0x0100000f");
0056
0057 #elif defined(_YIELD_PROCESSOR) && defined(Q_CC_GHS)
0058 _YIELD_PROCESSOR;
0059 #endif
0060 }
0061
0062 QT_END_NAMESPACE
0063
0064 #endif