nsprpub/pr/src/md/unix/os_Linux_ia64.s

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/nsprpub/pr/src/md/unix/os_Linux_ia64.s	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,71 @@
     1.4 +// -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 +// 
     1.6 +// This Source Code Form is subject to the terms of the Mozilla Public
     1.7 +// License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 +// file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.9 +
    1.10 +.text
    1.11 +
    1.12 +// PRInt32 _PR_ia64_AtomicIncrement(PRInt32 *val)
    1.13 +//
    1.14 +// Atomically increment the integer pointed to by 'val' and return
    1.15 +// the result of the increment.
    1.16 +//
    1.17 +        .align 16
    1.18 +        .global _PR_ia64_AtomicIncrement#
    1.19 +        .proc _PR_ia64_AtomicIncrement#
    1.20 +_PR_ia64_AtomicIncrement:
    1.21 +        fetchadd4.acq r8 = [r32], 1  ;;
    1.22 +        adds r8 = 1, r8
    1.23 +        br.ret.sptk.many b0
    1.24 +        .endp _PR_ia64_AtomicIncrement#
    1.25 +
    1.26 +// PRInt32 _PR_ia64_AtomicDecrement(PRInt32 *val)
    1.27 +//
    1.28 +// Atomically decrement the integer pointed to by 'val' and return
    1.29 +// the result of the decrement.
    1.30 +//
    1.31 +        .align 16
    1.32 +        .global _PR_ia64_AtomicDecrement#
    1.33 +        .proc _PR_ia64_AtomicDecrement#
    1.34 +_PR_ia64_AtomicDecrement:
    1.35 +        fetchadd4.rel r8 = [r32], -1  ;;
    1.36 +        adds r8 = -1, r8
    1.37 +        br.ret.sptk.many b0
    1.38 +        .endp _PR_ia64_AtomicDecrement#
    1.39 +
    1.40 +// PRInt32 _PR_ia64_AtomicAdd(PRInt32 *ptr, PRInt32 val)
    1.41 +//
    1.42 +// Atomically add 'val' to the integer pointed to by 'ptr'
    1.43 +// and return the result of the addition.
    1.44 +//
    1.45 +        .align 16
    1.46 +        .global _PR_ia64_AtomicAdd#
    1.47 +        .proc _PR_ia64_AtomicAdd#
    1.48 +_PR_ia64_AtomicAdd:
    1.49 +        ld4 r15 = [r32]  ;;
    1.50 +.L3:
    1.51 +        mov r14 = r15
    1.52 +        mov ar.ccv = r15
    1.53 +        add r8 = r15, r33  ;;
    1.54 +        cmpxchg4.acq r15 = [r32], r8, ar.ccv  ;;
    1.55 +        cmp4.ne p6, p7 =  r15, r14
    1.56 +        (p6) br.cond.dptk .L3
    1.57 +        br.ret.sptk.many b0
    1.58 +        .endp _PR_ia64_AtomicAdd#
    1.59 +
    1.60 +// PRInt32 _PR_ia64_AtomicSet(PRInt32 *val, PRInt32 newval)
    1.61 +//
    1.62 +// Atomically set the integer pointed to by 'val' to the new
    1.63 +// value 'newval' and return the old value.
    1.64 +//
    1.65 +        .align 16
    1.66 +        .global _PR_ia64_AtomicSet#
    1.67 +        .proc _PR_ia64_AtomicSet#
    1.68 +_PR_ia64_AtomicSet:
    1.69 +        xchg4 r8 = [r32], r33
    1.70 +        br.ret.sptk.many b0
    1.71 +        .endp _PR_ia64_AtomicSet#
    1.72 +
    1.73 +// Magic indicating no need for an executable stack
    1.74 +.section .note.GNU-stack, "", @progbits ; .previous

mercurial