|
16 | 16 | .global pg_atomic_cas
|
17 | 17 | pg_atomic_cas:
|
18 | 18 |
|
19 |
| -!"cas" only works on sparcv9chips,andrequies a compiler |
20 |
| -!that istargetingsparcv9. It will fail on a compiler |
21 |
| -! targeting sparcv8,and of course willnot be understood |
22 |
| -! by a sparcv8 CPU. gcc continues to use"ldstub" because |
23 |
| -!there is no indication which sparc versionitis targeting. |
| 19 | +!"cas" only works on sparcv9andsparcv8plus chips,and |
| 20 | +!requies a compilertargetingthese CPUs. It will fail |
| 21 | +!on a compilertargeting sparcv8,and of course willnot |
| 22 | +!be understoodby a sparcv8 CPU. gcc continues to use |
| 23 | +!"ldstub" becauseittargets sparcv7. |
24 | 24 | !
|
25 |
| -! It is actually possible to use"cas" for sparcv8 binaries if |
26 |
| -! -xarch=v8plus is used for compilation. There is actually a |
27 |
| -! trick for embedding"cas"in a sparcv8-targeted compiler, but |
28 |
| -! it can only be run on a sparcv8pluscpus: |
| 25 | +! There is actually a trick for embedding"cas"in a |
| 26 | +! sparcv8-targeted compiler, but it can only be run |
| 27 | +! on a sparcv8plus/v9cpus: |
29 | 28 | !
|
30 | 29 | !http://cvs.opensolaris.org/source/xref/on/usr/src/lib/libc/sparc/threads/sparc.il
|
31 | 30 | !
|
32 | 31 |
|
33 |
| -#ifdef__sparcv9 |
| 32 | +#if defined(__sparcv9) || defined(__sparcv8plus) |
34 | 33 | cas [%o0],%o2,%o1
|
35 | 34 | #else
|
36 | 35 | ldstub [%o0],%o1
|
|