Re: spinlock support on loongarch64

2022-11-02 Thread Andres Freund
On 2022-11-02 17:37:04 -0400, Tom Lane wrote: > Andres Freund writes: > > On 2022-11-02 14:55:04 -0400, Tom Lane wrote: > >> After actually testing (by removing the ARM stanza on a macOS machine), > >> it seems that placement doesn't work, because of the default definition > >> of S_UNLOCK at the

Re: spinlock support on loongarch64

2022-11-02 Thread Tom Lane
Andres Freund writes: > On 2022-11-02 14:55:04 -0400, Tom Lane wrote: >> After actually testing (by removing the ARM stanza on a macOS machine), >> it seems that placement doesn't work, because of the default definition >> of S_UNLOCK at the bottom of the "#if defined(__GNUC__)" stuff. Putting >>

Re: spinlock support on loongarch64

2022-11-02 Thread Andres Freund
Hi, On 2022-11-02 14:55:04 -0400, Tom Lane wrote: > I wrote: > > So about like this, then. > > After actually testing (by removing the ARM stanza on a macOS machine), > it seems that placement doesn't work, because of the default definition > of S_UNLOCK at the bottom of the "#if defined(__GNUC__

Re: spinlock support on loongarch64

2022-11-02 Thread Tom Lane
I wrote: > So about like this, then. After actually testing (by removing the ARM stanza on a macOS machine), it seems that placement doesn't work, because of the default definition of S_UNLOCK at the bottom of the "#if defined(__GNUC__)" stuff. Putting it inside that test works, and seems like it

Re: spinlock support on loongarch64

2022-11-02 Thread Tom Lane
Andres Freund writes: > On 2022-11-02 11:37:35 -0400, Tom Lane wrote: >> I wonder if we shouldn't just do that (ie, try to use >> __sync_lock_test_and_set) as a generic fallback on any unsupported >> architecture. We could get rid of the separate stanza for RISC-V >> that way. The main thing tha

Re: spinlock support on loongarch64

2022-11-02 Thread Andres Freund
Hi, On 2022-11-02 11:37:35 -0400, Tom Lane wrote: > =?gb2312?B?zuLRx7fJ?= writes: > > add spinlock support on loongarch64. > > I wonder if we shouldn't just do that (ie, try to use > __sync_lock_test_and_set) as a generic fallback on any unsupported > architecture. We could get rid of the separ

Re: spinlock support on loongarch64

2022-11-02 Thread Tom Lane
=?gb2312?B?zuLRx7fJ?= writes: > add spinlock support on loongarch64. I wonder if we shouldn't just do that (ie, try to use __sync_lock_test_and_set) as a generic fallback on any unsupported architecture. We could get rid of the separate stanza for RISC-V that way. The main thing that an arch-sp