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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 // -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 //
michael@0 3 // This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 // License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 6
michael@0 7 .text
michael@0 8
michael@0 9 // PRInt32 _PR_ia64_AtomicIncrement(PRInt32 *val)
michael@0 10 //
michael@0 11 // Atomically increment the integer pointed to by 'val' and return
michael@0 12 // the result of the increment.
michael@0 13 //
michael@0 14 .align 16
michael@0 15 .global _PR_ia64_AtomicIncrement#
michael@0 16 .proc _PR_ia64_AtomicIncrement#
michael@0 17 _PR_ia64_AtomicIncrement:
michael@0 18 fetchadd4.acq r8 = [r32], 1 ;;
michael@0 19 adds r8 = 1, r8
michael@0 20 br.ret.sptk.many b0
michael@0 21 .endp _PR_ia64_AtomicIncrement#
michael@0 22
michael@0 23 // PRInt32 _PR_ia64_AtomicDecrement(PRInt32 *val)
michael@0 24 //
michael@0 25 // Atomically decrement the integer pointed to by 'val' and return
michael@0 26 // the result of the decrement.
michael@0 27 //
michael@0 28 .align 16
michael@0 29 .global _PR_ia64_AtomicDecrement#
michael@0 30 .proc _PR_ia64_AtomicDecrement#
michael@0 31 _PR_ia64_AtomicDecrement:
michael@0 32 fetchadd4.rel r8 = [r32], -1 ;;
michael@0 33 adds r8 = -1, r8
michael@0 34 br.ret.sptk.many b0
michael@0 35 .endp _PR_ia64_AtomicDecrement#
michael@0 36
michael@0 37 // PRInt32 _PR_ia64_AtomicAdd(PRInt32 *ptr, PRInt32 val)
michael@0 38 //
michael@0 39 // Atomically add 'val' to the integer pointed to by 'ptr'
michael@0 40 // and return the result of the addition.
michael@0 41 //
michael@0 42 .align 16
michael@0 43 .global _PR_ia64_AtomicAdd#
michael@0 44 .proc _PR_ia64_AtomicAdd#
michael@0 45 _PR_ia64_AtomicAdd:
michael@0 46 ld4 r15 = [r32] ;;
michael@0 47 .L3:
michael@0 48 mov r14 = r15
michael@0 49 mov ar.ccv = r15
michael@0 50 add r8 = r15, r33 ;;
michael@0 51 cmpxchg4.acq r15 = [r32], r8, ar.ccv ;;
michael@0 52 cmp4.ne p6, p7 = r15, r14
michael@0 53 (p6) br.cond.dptk .L3
michael@0 54 br.ret.sptk.many b0
michael@0 55 .endp _PR_ia64_AtomicAdd#
michael@0 56
michael@0 57 // PRInt32 _PR_ia64_AtomicSet(PRInt32 *val, PRInt32 newval)
michael@0 58 //
michael@0 59 // Atomically set the integer pointed to by 'val' to the new
michael@0 60 // value 'newval' and return the old value.
michael@0 61 //
michael@0 62 .align 16
michael@0 63 .global _PR_ia64_AtomicSet#
michael@0 64 .proc _PR_ia64_AtomicSet#
michael@0 65 _PR_ia64_AtomicSet:
michael@0 66 xchg4 r8 = [r32], r33
michael@0 67 br.ret.sptk.many b0
michael@0 68 .endp _PR_ia64_AtomicSet#
michael@0 69
michael@0 70 // Magic indicating no need for an executable stack
michael@0 71 .section .note.GNU-stack, "", @progbits ; .previous

mercurial