On Tue, 8 Sep 2026 16:07:40 +0100
Mark Rutland [off-list ref] wrote:
On Sat, Sep 05, 2026 at 10:03:19AM +0100, David Laight wrote:
quoted
On Fri, 4 Sep 2026 17:17:53 +0100
Mark Rutland [off-list ref] wrote:
quoted
Use the PCPU GPR infrastructure to implement all of the RMW ops which do
not return a value.
...
quoted
#define __PERCPU_OP_CASE(w, sfx, name, sz, op_llsc, op_lse) \
Isn't this definition exactly the same as __PERCPU_RET_OP_CASE() except
for s/tmp/ret/ and the 'return ret'?
Not exactly the same; the __PERCPU_RET_OP_CASE() assembly also performs
an additional instruction at the end in order to generate the RETURN
value.
I had missed that - it is only in the LSE atomics alternative.
However it also replaces a nop so wouldn't affect code size or
execution speed.
David
quoted
Since the compiler will just ignore the unwanted return value
there is not point replicating the definition.
We could consider sharing the assembly, but it's not quite that simple,
so I'm going to leave this as-is for now.
Mark.