@@ -19,21 +19,19 @@ pg_atomic_cas:
1919!"cas" only works on sparcv9 chips,and requies a compiler
2020! that is targeting sparcv9. It will fail on a compiler
2121! targeting sparcv8,and of course willnot be understood
22- ! by a sparcv8 CPU. If this fails on existing Solaris
23- ! systems, we need to use a !defined(__sparcv9)test
24- ! to fall back to the old"ldstub" call for sparcv8 compiles.
25- ! gcc continues to use"ldstub" because there is no indication
26- ! which sparc version it is targeting.
22+ ! by a sparcv8 CPU. gcc continues to use"ldstub" because
23+ ! there is no indication which sparc version it is targeting.
2724!
2825! There actually is a trick for embedding"cas" for a compiler
2926! that is targetingsparcv8:
3027!
3128!http: //cvs.opensolaris.org/source/xref/on/usr/src/lib/libc/sparc/threads/sparc.il
32- !
33- ! This might work forsparc8:
34- ! ldstub [%o0],%o1! moves only a byte
3529
30+ #ifdef __sparcv9
3631cas [%o0],%o2,%o1
32+ #else
33+ ldstub [%o0],%o1
34+ #endif
3735mov %o1,%o0
3836retl
3937nop