qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 05/13] include/processor.h: define cpu_relax(


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v2 05/13] include/processor.h: define cpu_relax()
Date: Fri, 8 Apr 2016 11:33:17 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1

On 04/07/2016 10:32 AM, Emilio G. Cota wrote:
> Taken from the linux kernel.
> 
> Signed-off-by: Emilio G. Cota <address@hidden>
> ---
>  include/qemu/processor.h | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>  create mode 100644 include/qemu/processor.h

Reviewed-by: Richard Henderson  <address@hidden>


> +#if defined(__i386__) || defined(__x86_64__)
> +#define cpu_relax() asm volatile("rep; nop" ::: "memory")
> +#endif

Not that it matters much, but for the record there's an ICC inspired builtin in
<xmmintrin.h> for this: _mm_pause().  But so long as we're always using gcc or
clang, that's probably just an extra dependency to worry about.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]