Re: [Qemu-devel] [PATCH v6 13/35] tcg: Add atomic helpers

2016-10-16 Thread Emilio G. Cota
On Sun, Oct 16, 2016 at 18:40:05 -0700, Richard Henderson wrote: > On 10/16/2016 03:17 PM, Emilio G. Cota wrote: > >>+#if DATA_SIZE == 1 > >>> +# define END > >>> +#elif defined(HOST_WORDS_BIGENDIAN) > >>> +# define END _be > >>> +#else > >>> +# define END _le > >>> +#endif > >It took me a while

Re: [Qemu-devel] [PATCH v6 13/35] tcg: Add atomic helpers

2016-10-16 Thread Richard Henderson
On 10/16/2016 03:17 PM, Emilio G. Cota wrote: +#if DATA_SIZE == 1 > +# define END > +#elif defined(HOST_WORDS_BIGENDIAN) > +# define END _be > +#else > +# define END _le > +#endif It took me a while to figure out that ATOMIC_NAME needs END (ATOMIC_NAME is defined later in the patch). It might

Re: [Qemu-devel] [PATCH v6 13/35] tcg: Add atomic helpers

2016-10-16 Thread Richard Henderson
On 10/16/2016 03:17 PM, Emilio G. Cota wrote: > +/* Note that for addition, we need to use a separate cmpxchg loop instead > + of bswaps for the reverse-host-endian helpers. */ > +ABI_TYPE ATOMIC_NAME(fetch_add)(CPUArchState *env, target_ulong addr, > + ABI_TYPE val EXT

Re: [Qemu-devel] [PATCH v6 13/35] tcg: Add atomic helpers

2016-10-16 Thread Emilio G. Cota
On Tue, Oct 11, 2016 at 14:40:39 -0500, Richard Henderson wrote: > Add all of cmpxchg, op_fetch, fetch_op, and xchg. > Handle both endian-ness, and sizes up to 8. > Handle expanding non-atomically, when emulating in serial. > > Signed-off-by: Richard Henderson > --- > Makefile.objs | 2

Re: [Qemu-devel] [PATCH v6 13/35] tcg: Add atomic helpers

2016-10-12 Thread Alex Bennée
Richard Henderson writes: > Add all of cmpxchg, op_fetch, fetch_op, and xchg. > Handle both endian-ness, and sizes up to 8. > Handle expanding non-atomically, when emulating in serial. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée > --- > Makefile.objs | 2 +- > Ma

[Qemu-devel] [PATCH v6 13/35] tcg: Add atomic helpers

2016-10-11 Thread Richard Henderson
Add all of cmpxchg, op_fetch, fetch_op, and xchg. Handle both endian-ness, and sizes up to 8. Handle expanding non-atomically, when emulating in serial. Signed-off-by: Richard Henderson --- Makefile.objs | 2 +- Makefile.target | 1 + atomic_template.h | 173 +++