File: POWERPC32.asm

package info (click to toggle)
openmpi 1.6.5-9.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 91,628 kB
  • ctags: 44,305
  • sloc: ansic: 408,966; cpp: 44,454; sh: 27,828; makefile: 10,486; asm: 3,882; python: 1,239; lex: 805; perl: 549; csh: 253; fortran: 232; f90: 126; tcl: 12
file content (168 lines) | stat: -rw-r--r-- 3,050 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
START_FILE
	TEXT

	ALIGN(4)
START_FUNC(opal_atomic_mb)
	sync
	blr
END_FUNC(opal_atomic_mb)


START_FUNC(opal_atomic_rmb)
	lwsync
	blr
END_FUNC(opal_atomic_rmb)


START_FUNC(opal_atomic_wmb)
	eieio
	blr
END_FUNC(opal_atomic_wmb)


START_FUNC(opal_atomic_cmpset_32)
	LSYM(1) lwarx   r0, 0, r3  
	   cmpw    0, r0, r4  
	   bne-    REFLSYM(2)
	   stwcx.  r5, 0, r3  
	   bne-    REFLSYM(1)
	LSYM(2)
	xor r3,r0,r4
	subfic r5,r3,0
	adde r3,r5,r3
	blr
END_FUNC(opal_atomic_cmpset_32)


START_FUNC(opal_atomic_cmpset_acq_32)
	LSYM(3) lwarx   r0, 0, r3  
	   cmpw    0, r0, r4  
	   bne-    REFLSYM(4)         
	   stwcx.  r5, 0, r3  
	   bne-    REFLSYM(3)
	sync 
	LSYM(4)
	xor r3,r0,r4
	subfic r5,r3,0
	adde r3,r5,r3
	lwsync
	blr
END_FUNC(opal_atomic_cmpset_acq_32)


START_FUNC(opal_atomic_cmpset_rel_32)
	eieio
	LSYM(5) lwarx   r0, 0, r3  
	   cmpw    0, r0, r4  
	   bne-    REFLSYM(6)
	   stwcx.  r5, 0, r3  
	   bne-    REFLSYM(5)
	sync 
	LSYM(6)
	xor r3,r0,r4
	subfic r5,r3,0
	adde r3,r5,r3
	blr
END_FUNC(opal_atomic_cmpset_rel_32)

#START_64BIT
START_FUNC(opal_atomic_cmpset_64)
	stw r4,-32(r1)
	stw r5,-28(r1)
	stw r6,-24(r1)
	stw r7,-20(r1)
	ld r5,-32(r1)
	ld r7,-24(r1)
	LSYM(7) ldarx   r9, 0, r3  
	   cmpd    0, r9, r5  
	   bne-    REFLSYM(8)         
	   stdcx.  r7, 0, r3
	   bne-    REFLSYM(7)
	LSYM(8)
	xor r3,r5,r9
	subfic r5,r3,0
	adde r3,r5,r3
	blr
END_FUNC(opal_atomic_cmpset_64)


START_FUNC(opal_atomic_cmpset_acq_64)
        stw r4,-32(r1)
        stw r5,-28(r1)
        stw r6,-24(r1)
        stw r7,-20(r1)
        ld r5,-32(r1)
        ld r7,-24(r1)

        LSYM(9) ldarx   r9, 0, r3  
           cmpd    0, r9, r5
           bne-    REFLSYM(10)         
           stdcx.  r7, 0, r3  
           bne-    REFLSYM(9)
        LSYM(10)
        xor r3,r5,r9
        subfic r5,r3,0
        adde r3,r5,r3
        blr
        lwsync
        blr
END_FUNC(opal_atomic_cmpset_acq_64)


START_FUNC(opal_atomic_cmpset_rel_64)
        stw r4,-32(r1)
        stw r5,-28(r1)
        stw r6,-24(r1)
        stw r7,-20(r1)
        ld r5,-32(r1)
        ld r7,-24(r1)

        eieio
        LSYM(11) ldarx   r9, 0, r3  
           cmpd    0, r9, r5  
           bne-    REFLSYM(12)         
           stdcx.  r7, 0, r3  
           bne-    REFLSYM(11)
        LSYM(12)
        xor r3,r5,r9
        subfic r5,r3,0
        adde r3,r5,r3
        blr
        lwsync
        blr
END_FUNC(opal_atomic_cmpset_rel_64)
#END_64BIT


START_FUNC(opal_atomic_add_32)
	LSYM(13)   lwarx r0, 0, r3 
	     add  r0, r4, r0                
	     stwcx.   r0, 0, r3              
	     bne-  REFLSYM(13)
	mr	r3,r0
	blr
END_FUNC(opal_atomic_add_32)


START_FUNC(opal_atomic_sub_32)
	LSYM(14)   lwarx r0,0,r3
	     subf  r0,r4,r0                
	     stwcx.   r0,0,r3              
	     bne-  REFLSYM(14)             
	mr	r3,r0
	blr
END_FUNC(opal_atomic_sub_32)

START_FUNC(opal_sys_timer_get_cycles)
	LSYM(15)
	mftbu r0
	mftb r11
	mftbu r2
	cmpw cr7,r2,r0
	bne+ cr7,REFLSYM(15)
	li r4,0
	li r9,0
	or r3,r2,r9
	or r4,r4,r11
	blr
END_FUNC(opal_sys_timer_get_cycles)