Re: __atomic_test_and_set() and mips o32 - help wanted

Jason Thorpe <[email protected]> Tue, 18 Nov 2025 22:26:58 +0100
Newsgroups gmane.os.netbsd.ports.alpha,gmane.os.netbsd.ports.mips.devel,gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
+ port-alpha

> On Nov 18, 2025, at 10:00=E2=80=AFPM, Maciej W. Rozycki =
<[email protected]> wrote:
>=20
> On Tue, 18 Nov 2025, Mouse wrote:
>=20
>>> Just trap and emulate LL/SC in the kernel for user software;
>>=20
>> I'm not sure the smartest option is to place the emulation load most =
on
>> the machines with the least computational resources to spare.
>=20
> Well, you need to trap into the kernel anyway to emulate the operation=20=

> required, so you might as well make it benefit hardware such as MIPS =
III,=20
> which (as David has also observed) is very much legacy now too, having=20=

> reached 30+ years of age.  And with the alternative syscall approach =
all=20
> the parties lose, as even hardware that has atomics support available =
has=20
> to trap.

There are actually other ways to do this.  This is a situation where an =
ifunc would be beneficial, or some other run-time fix-up to the correct =
implementation.  A restartable atomic sequence is incredibly cheap.

> I have also saved the VAX GCC backend from being dropped and now =
non-BWX=20
> (pre-EV56) Alpha support is at risk as the old register allocator is =
being=20
> removed right away, along with all the backends that still rely on it, =
and=20
> sadly I've been running out of resources to get that sorted, so you =
are=20
> welcome (as is anyone) to step in and assist.

No everyone knows about the impending dooms, alas.  It=E2=80=99s a real =
shame that non-BWX support is on the chopping block (aside: how on earth =
can that have such a huge impact on the register allocator???) =E2=80=A6 =
there are quite a few non-BWX machines still out there (at least at chez =
moi, there are 3 + a parts machine), and for someone wanting to dabble =
in Alpha hardware, the BWX-supporting systems fetch top dollar on the =
used market (compared to merely more-than-I-should-spend for an =
EV4-class system) - people still gaga to run VMS I guess - making the =
non-BWX systems a lot more accessible.

Emulation of BWX would be ***incredibly*** slow.  Like, slow enough that =
pre-BWX systems would be unusable, I=E2=80=99m afraid.

I=E2=80=99m not in a position to directly contribute to the =
typing-of-code effort to help save the pre-BWX Alpha back-end, but what =
else can I (and others) do to help?

-- thorpej