patching gcc 4.0.1 to use CAS on Solaris/sparc (part of the sun v8plus arch)

Andrew B. Lundgren lundgren@byu.net
Tue Aug 30 16:46:00 GMT 2005


I modified the file: ./libstdc++-v3/config/cpu/sparc/atomicity.h
to use the 32bit equivalent CAS/LD instructions from the arch64 bit in 
the arch32.

I then built the code using the -mv8plus option in the (xxx)FLAGS and 
all is happy.

However, the code will no longer compile without the v9 32bit CAS/LD code.

What is the preferred way of doing this for GCC code?

Is there a macro I can ifdef on to check to see if I can use the v8plus 
instructions, otherwise use the existing spinlock implementation?

I would like to submit this and get it mainstreamed, but I am not sure 
how to proceed here.

Thanks!

--
Andrew



More information about the Gcc-patches mailing list