1 !-------------------------------------------------------------------------
4 ! compare
and swap for Sun Studio on Sparc
6 ! Portions Copyright
(c
) 1996-2009, PostgreSQL Global Development Group
7 ! Portions Copyright
(c
) 1994, Regents of the University of California
12 !-------------------------------------------------------------------------
14 ! Fortunately the Sun compiler can process cpp conditionals with
-P
16 ! '/' is the comment for x86
, while
'!' is the comment for Sparc
18 #if defined(__sparcv9) || defined(__sparc)
28 ! "cas" only works on sparcv9
and sparcv8plus chips
, and
29 ! requies
a compiler targeting these CPUs. It will fail
30 ! on
a compiler targeting sparcv8
, and of course will
not
31 ! be understood by
a sparcv8 CPU. gcc continues to use
32 ! "ldstub" because it targets sparcv7.
34 ! There is actually
a trick for embedding
"cas" in
a
35 ! sparcv8-targeted compiler
, but it can only
be run
36 ! on
a sparcv8plus
/v9 cpus
:
38 ! http
://cvs.opensolaris.org
/source
/xref
/on
/usr
/src
/lib
/libc
/sparc
/threads
/sparc.il
41 #if defined(__sparcv9) || defined(__sparcv8plus)
50 .size pg_atomic_cas,(.-pg_atomic_cas)