Re: [Qemu-devel] [PATCH v2] atomics: Use __atomic_*_n() variant primitives

2016-08-30 Thread Richard Henderson
On 08/29/2016 10:17 AM, Pranith Kumar wrote: #define atomic_read(ptr) \ ({\ QEMU_BUILD_BUG_ON(sizeof(*ptr) > sizeof(void *)); \ -typeof_strip_qual(*ptr) _val; \ - __atomic_load(ptr,

Re: [Qemu-devel] [PATCH v2] atomics: Use __atomic_*_n() variant primitives

2016-08-30 Thread Paolo Bonzini
On 29/08/2016 19:17, Pranith Kumar wrote: > Use the __atomic_*_n() primitives which take the value as argument. It > is not necessary to store the value locally before calling the > primitive, hence saving us a stack store and load. > > Signed-off-by: Pranith Kumar > --- > include/qemu/atomic.

[Qemu-devel] [PATCH v2] atomics: Use __atomic_*_n() variant primitives

2016-08-29 Thread Pranith Kumar
Use the __atomic_*_n() primitives which take the value as argument. It is not necessary to store the value locally before calling the primitive, hence saving us a stack store and load. Signed-off-by: Pranith Kumar --- include/qemu/atomic.h | 24 1 file changed, 8 inserti