Re: [PATCH v1 2/2] powerpc/atomics: Use immediate operand when possible

2021-04-13 Thread Christophe Leroy
Le 13/04/2021 à 00:08, Segher Boessenkool a écrit : Hi! On Thu, Apr 08, 2021 at 03:33:45PM +, Christophe Leroy wrote: +#define ATOMIC_OP(op, asm_op, dot, sign) \ static __inline__ void atomic_##op(int a, atomic_t *v) \ {

Re: [PATCH v1 2/2] powerpc/atomics: Use immediate operand when possible

2021-04-12 Thread Segher Boessenkool
Hi! On Thu, Apr 08, 2021 at 03:33:45PM +, Christophe Leroy wrote: > +#define ATOMIC_OP(op, asm_op, dot, sign) \ > static __inline__ void atomic_##op(int a, atomic_t *v) > \ > {

[PATCH v1 2/2] powerpc/atomics: Use immediate operand when possible

2021-04-08 Thread Christophe Leroy
Today we get the following code generation for atomic operations: c001bb2c: 39 20 00 01 li r9,1 c001bb30: 7d 40 18 28 lwarx r10,0,r3 c001bb34: 7d 09 50 50 subfr8,r9,r10 c001bb38: 7d 00 19 2d stwcx. r8,0,r3