Re: [PATCH] tile: Provide atomic_{or,xor,and}

Peter Zijlstra
2015-07-09T20:50:25Z

On Thu, Jul 09, 2015 at 04:38:17PM -0400, Chris Metcalf wrote:
> Implement atomic logic ops -- atomic_{or,xor,and}.
>
> For tilegx, these are relatively straightforward; the architecture
> provides atomic "or" and "and", both 32-bit and 64-bit. To support
> xor we provide a loop using "cmpexch".
>
> For the older 32-bit tilepro architecture, we have to extend
> the set of low-level assembly routines to include 32-bit "and",
> as well as all three 64-bit routines. Somewhat confusingly,
> some 32-bit versions are already used by the bitops inlines, with
> parameter types appropriate for bitops, so we have to do a bit of
> casting to match "int" to "unsigned long".
>
> Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
> ---
> Peter, I'm guessing you should just take this into your series,
> rather than my pushing it through the tile tree.

Awesome, thanks! Yeah, I'll collect the lot.