@@ -19,21 +19,19 @@ pg_atomic_cas:
19
19
!"cas" only works on sparcv9 chips,and requies a compiler
20
20
! that is targeting sparcv9. It will fail on a compiler
21
21
! 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.
27
24
!
28
25
! There actually is a trick for embedding"cas" for a compiler
29
26
! that is targetingsparcv8:
30
27
!
31
28
!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
35
29
30
+ #ifdef __sparcv9
36
31
cas [%o0],%o2,%o1
32
+ #else
33
+ ldstub [%o0],%o1
34
+ #endif
37
35
mov %o1,%o0
38
36
retl
39
37
nop