[Gc] Patch for atomic_ops GCC sparc support

Boehm, Hans hans.boehm at hp.com
Tue Sep 1 14:52:30 PDT 2009


I believe the code came from Patrick Marlier.  I checked it in after wrapping most of it in a #ifndef NO_SPARC_V9, to allow an easier override if someone has really old hardware.  (I have a machine that may need it :-( )

Sorry about the long delay on this, and belated thanks.

I did not test.  Someone with a modern SPARC probably should.

I suspect this could use further improvement:

- Some of the comments now look obsolete.

- The old file assumed TSO.  I suspect that's the right assumption.  Especially under TSO, I'm suspicious that the membar's aren't needed for compare_and_swap?  However, it would probably help a lot to define AO_nop_full() as membar #StoreLoad (or stronger, though I suspect that doesn't matter for TSO?).

Hans



> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Ivan Maidanski
> Sent: Wednesday, August 05, 2009 9:42 AM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] Patch for atomic_ops GCC sparc support
> 
> Hi!
> 
> The attached patch adds CAS for sparc[v9] and fixes 
> test_and_set for sparcv9. The original author is unknown (it 
> comes from sf.net bdwgc Tracker/Patches), I did only some 
> code reformatting. Neither compiled nor tested by me.
> 
> libatomic_ops ChangeLog entries:
> 	* src/atomic_ops/sysdeps/gcc/sparc.h (AO_test_and_set_full): Use
> 	AO_TS_VAL_t for "oldval" (for 64-bit support).
> 	* src/atomic_ops/sysdeps/gcc/sparc.h (AO_compare_and_swap_full):
> 	New function implemented.
> 
> Bye.
> 


More information about the Gc mailing list