Re: __atomic_test_and_set() and mips o32 - help wanted
"Maciej W. Rozycki" <[email protected]> Wed, 19 Nov 2025 09:53:38 +0000 (GMT)
| Newsgroups | gmane.os.netbsd.ports.alpha,gmane.os.netbsd.ports.mips.devel,gmane.os.netbsd.devel.toolchain |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 19 Nov 2025, Jason Thorpe wrote: > > Conversely the compiler is happy to inline LL/SC sequences as they map > > directly to RTL and at worst you need to maintain emulation. It seems > > like a good compromise. > > I’m not disagreeing that inline ll/sc is more efficient on systems that > support it. But if the compiler is targeted at a MIPS-I target, this is > generally considered an acceptable compromise. Sure, if you build with > -mmips3 or whatever the flag is, inline it. But if -mmips1, a libcall > doesn’t seem unreasonable. Nothing wrong with it in principle, especially if you do want to optimise for MIPS I. Traps are cheap on MIPS however, and even more so with MIPS I and its simple four-stage execution pipeline, so it might be the case of perfect being the enemy of good enough. There is a balance to be found here. Maciej