Re: [RFC][PATCH 02/31] locking,alpha: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}()

2016-04-22 Thread Peter Zijlstra
On Fri, Apr 22, 2016 at 09:57:04AM -0700, Richard Henderson wrote: > On 04/22/2016 02:04 AM, Peter Zijlstra wrote: > > + "1: ldl_l %0,%1\n" \ > > + " mov %0,%2\n"\ > > + " " #asm_op "

Re: [RFC][PATCH 02/31] locking,alpha: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}()

2016-04-22 Thread Peter Zijlstra
On Fri, Apr 22, 2016 at 09:57:04AM -0700, Richard Henderson wrote: > On 04/22/2016 02:04 AM, Peter Zijlstra wrote: > > + "1: ldl_l %0,%1\n" \ > > + " mov %0,%2\n"\ > > + " " #asm_op "

Re: [RFC][PATCH 02/31] locking,alpha: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}()

2016-04-22 Thread Richard Henderson
On 04/22/2016 02:04 AM, Peter Zijlstra wrote: > + "1: ldl_l %0,%1\n" \ > + " mov %0,%2\n"\ > + " " #asm_op " %0,%3,%0\n" \ > + " stl_c %0,%1\n"

Re: [RFC][PATCH 02/31] locking,alpha: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}()

2016-04-22 Thread Richard Henderson
On 04/22/2016 02:04 AM, Peter Zijlstra wrote: > + "1: ldl_l %0,%1\n" \ > + " mov %0,%2\n"\ > + " " #asm_op " %0,%3,%0\n" \ > + " stl_c %0,%1\n"

[RFC][PATCH 02/31] locking,alpha: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}()

2016-04-22 Thread Peter Zijlstra
Implement FETCH-OP atomic primitives, these are very similar to the existing OP-RETURN primitives we already have, except they return the value of the atomic variable _before_ modification. This is especially useful for irreversible operations -- such as bitops (because it becomes impossible to

[RFC][PATCH 02/31] locking,alpha: Implement atomic{,64}_fetch_{add,sub,and,andnot,or,xor}()

2016-04-22 Thread Peter Zijlstra
Implement FETCH-OP atomic primitives, these are very similar to the existing OP-RETURN primitives we already have, except they return the value of the atomic variable _before_ modification. This is especially useful for irreversible operations -- such as bitops (because it becomes impossible to