> The first four patches simply do the conversion, a piece at a time, > assuming the RMO for all cpus.
The new form of the membar_v8 insn looks a bit strange since operand 1 is disregarded. If this is as intended, a comment would be in order. > 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. "memory model" is used consistently in the manual so, if the triple m is deemed too disturbing, -mmemory-model would be a little better. In any case, I don't expect it to be used at all in practice. And memory_order should be renamed into sparc_memory_model (or sparc_memmodel?) and the enum constants prefixed with MM (which is the name of the PSTATE register holding the value). > 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. We should probably default to TSO for V8/V9 at this point. This builds fine on Solaris, 32-bit and 64-bit, but I guess I'm seeing the ICE Dave reported. Do you have a patchlet for it? -- Eric Botcazou