mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-27 15:41:46 +00:00
[libc] Add PAUSE instruction for the RPC spin loop
The other architectures use a brief sleep to defer work during this spin loop that checks the RPC mailboxes. This patch adds one for x64 to improve usage when running the server. Reviewed By: tianshilei1992 Differential Revision: https://reviews.llvm.org/D156566
This commit is contained in:
parent
4f52210a56
commit
9ffde19d11
@ -26,6 +26,8 @@ LIBC_INLINE void sleep_briefly() {
|
||||
LIBC_INLINE_ASM("nanosleep.u32 64;" ::: "memory");
|
||||
#elif defined(LIBC_TARGET_ARCH_IS_AMDGPU)
|
||||
__builtin_amdgcn_s_sleep(2);
|
||||
#elif defined(LIBC_TARGET_ARCH_IS_X86)
|
||||
__builtin_ia32_pause();
|
||||
#else
|
||||
// Simply do nothing if sleeping isn't supported on this platform.
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user