Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail From: mitchalsup@aol.com (MitchAlsup1) Newsgroups: comp.arch Subject: Re: Arm ldaxr / stxr loop question Date: Sun, 10 Nov 2024 01:26:22 +0000 Organization: Rocksolid Light Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: i2pn2.org; logging-data="1752666"; mail-complaints-to="usenet@i2pn2.org"; posting-account="o5SwNDfMfYu6Mv4wwLiW6e/jbA93UAdzFodw5PEa6eU"; User-Agent: Rocksolid Light X-Spam-Checker-Version: SpamAssassin 4.0.0 X-Rslight-Site: $2y$10$2TSMfGEHCbf/fuXDXllY5eOZXkd6USxqJiDCKmg1b8xLUBuYUTs6m X-Rslight-Posting-User: cb29269328a20fe5719ed6a1c397e21f651bda71 Bytes: 1991 Lines: 28 On Sat, 9 Nov 2024 23:18:14 +0000, Scott Lurndal wrote: > "Chris M. Thomasson" writes: >>On 11/8/2024 6:19 AM, Scott Lurndal wrote: >>> Lawrence D'Oliveiro writes: > >>> >>> A real world example from the linux kernel: >>> >>> static __always_inline s64 >>> __ll_sc_atomic64_dec_if_positive(atomic64_t *v) >>> { >>> s64 result; >>> unsigned long tmp; >>> >>> asm volatile("// atomic64_dec_if_positive\n" >>> " prfm pstl1strm, %2\n" >>> "1: ldxr %0, %2\n" >>> " subs %0, %0, #1\n" >>> " b.lt 2f\n" >>> " stlxr %w1, %0, %2\n" >>> " cbnz %w1, 1b\n" >>> " dmb ish\n" >> >>"dmb ish" is interesting to me for some reason... > > Data Memory Barrior - inner sharable coherency domain It reads better without explanation ...