1! sparc-v9.s
2! Copyright 2006 Parrot Foundation
3
4! Contains atomic-ops support routines for Sparc chips supporting a compare-and-swap instruction.
5
6        .section ".text"
7        .align 4
8
9! successp [%r8] = parrot_sparc_cas32(address [%r8], old [%r9], new [%r10])
10parrot_sparc_cas32:
11        cas [%r8],%r9,%r10
12	or %g0, 1, %r8
13        cmp %r9, %r10
14        retl    ! return from leaf
15	movne %icc, %g0, %r8 ! delay slot
16        .global parrot_sparc_cas32
17
18parrot_sparc_cas64:
19        casx [%r8],%r9,%r10
20        or %g0, 1, %r8
21        cmp %r9, %r10
22        retl    ! return from leaf
23	movne %icc, %g0, %r8 ! delay slot
24        .global parrot_sparc_cas64
25