~ubuntu-branches/ubuntu/vivid/atlas/vivid

« back to all changes in this revision

Viewing changes to src/threads/ATL_DecAtomicCount_ppc.S

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2013-06-11 15:58:16 UTC
  • mfrom: (1.1.3 upstream)
  • mto: (2.2.21 experimental)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: package-import@ubuntu.com-20130611155816-b72z8f621tuhbzn0
Tags: upstream-3.10.1
Import upstream version 3.10.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "atlas_asm.h"
 
2
.text
 
3
#ifdef ATL_AS_OSX_PPC
 
4
   .globl _ATL_DecAtomicCount
 
5
   _ATL_DecAtomicCount:
 
6
#else
 
7
   #if defined(ATL_USE64BITS)
 
8
/*
 
9
 *      Official Program Descripter section, seg fault w/o it on Linux/PPC64
 
10
 */
 
11
        .section        ".opd","aw"
 
12
        .align 2
 
13
        .globl  ATL_USERMM
 
14
        .align  3
 
15
ATL_DecAtomicCount:
 
16
        .quad   Mjoin(.,ATL_DecAtomicCount),.TOC.@tocbase,0
 
17
        .previous
 
18
        .type   Mjoin(.,ATL_DecAtomicCount),@function
 
19
        .text
 
20
        .globl  Mjoin(.,ATL_DecAtomicCount)
 
21
.ATL_DecAtomicCount:
 
22
   #else
 
23
        .globl  ATL_DecAtomicCount
 
24
ATL_DecAtomicCount:
 
25
   #endif
 
26
#endif
 
27
#error "Code is not reliable on PPC, don't know why"
 
28
/* r3                           r3  */
 
29
/* int ATL_DecAtomicCount(void *vp) */
 
30
RETRY:
 
31
   lwarx r5, 0, r3    /* Read int from mem, place reservation */
 
32
   addi  r5, r5, -1   /* decrement value */
 
33
   stwcx. r5, 0, r3   /* attempt to store decremented value back to mem */
 
34
   bne-  RETRY        /* If store failed, retry */
 
35
   mr r3, r5
 
36
   blr