From a5ee9c9d4f286ebf8c71f794ac48a21142304d1e Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 22 Jan 2023 20:54:20 +0000 Subject: [PATCH] cpu pause instruction for RISV-64 compatible gcc/clang. --- src/common/frame.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/frame.c b/src/common/frame.c index fdb38bba..7b36d3d9 100644 --- a/src/common/frame.c +++ b/src/common/frame.c @@ -95,6 +95,8 @@ static YQ2_ATTR_INLINE void Sys_CpuPause(void) asm volatile("yield"); #elif defined(__powerpc__) || defined(__powerpc64__) asm volatile("or 27,27,27"); +#elif defined(__riscv) && __riscv_xlen == 64 + asm volatile(".insn i 0x0F, 0, x0, x0, 0x010"); #endif #elif defined(_MSC_VER) #if defined(_M_IX86) || defined(_M_X64)