The first four patches simply do the conversion, a piece at a time, assuming the RMO for all cpus.
The fifth patch adds the ability to explicitly set the memory model for the program, and to adjust the barriers emitted based on that memory model. If we agree on the spelling of that option (3 m's in a row seems fairly harsh) I'll write some documentation for it. An unwritten sixth patch would allow the default memory model to be set by the operating system, as Dave tells me that Linux always uses TSO. And I guess when generating code specifically for Ultra-III, which doesn't implement the more relaxed models. This has so far been tested via cross-compile and qemu. I'm just starting a build on the GCC compile farm, which will take a while. Dave and Eric, can you please double-check everything and also test on Solaris (i.e. RMO). This is available at git://repo.or.cz/gcc/rth.git rth/atomic/sparc for convenience. r~ Richard Henderson (5): sparc: Convert to mem_thread_fence. sparc: Convert to atomic_load/store. sparc: Convert to atomic_compare_and_swap. sparc: Convert to atomic_exchange. sparc: Add -mmmodel command-line option. gcc/config/sparc/constraints.md | 5 +- gcc/config/sparc/predicates.md | 9 ++ gcc/config/sparc/sparc-opts.h | 10 ++ gcc/config/sparc/sparc-protos.h | 4 +- gcc/config/sparc/sparc.c | 147 ++++++++++++++++++++++++- gcc/config/sparc/sparc.md | 1 + gcc/config/sparc/sparc.opt | 22 ++++ gcc/config/sparc/sync.md | 233 +++++++++++++++++++++++--------------- 8 files changed, 333 insertions(+), 98 deletions(-) -- 1.7.4.4