Support for the TSO memory model on Arm CPUs
Support for the TSO memory model on Arm CPUs
Posted Apr 30, 2024 17:04 UTC (Tue) by anton (subscriber, #25547)In reply to: Support for the TSO memory model on Arm CPUs by ringerc
Parent article: Support for the TSO memory model on Arm CPUs
My understanding of AMD64 is that the regular memory accesses (those in the ordinary mov instructions and that are part of load-and-operate and RMW instructions) behave according to TSO. There are some special instructions with worse semantics, but you have to choose them to be bitten by them. So it's not bad. If you don't want to be bitten, don't use these instructions. And, concerning farnz' comment, the same goes for compilers: avoid those that provide worse memory ordering than can be had on the hardware the code is running on.
If by "not fully ordered" you refer to TSO being weaker than sequential consistency, that's true, and I would prefer sequential consistency. But that's just whataboutism. The issue at hand is about TSO vs. ARM's variant of weak memory ordering.
There is no one right choice - "100% ordered all the time" just isn't feasible with concurrent execution with shared-anythingWhat evidence do you have for that? Is it the same evidence that the Alpha people gave for rejecting byte and word accesses (which they added to the architecture later) and for rejecting precise exceptions?
Anyway, whatever you mean by "100% ordered all the time" (sequential consistency?), the issue at hand is TSO, and TSO is obviously feasible, as evidenced by all the hardware that implement TSO; and given that this includes even hardware designed for supercomputers (the Fujitsu A64FX), and it's not optional there, the tradeoff is obviously not one of horses for courses, but one of better (TSO) vs. worse (weaker memory models).
