repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[committed] ft32 doesn't support trampolines.
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.target
/
mips
/
20140928.c
blob
1b55bdd357cd4fc233acccb743136215a1497f67
1
/* { dg-do compile } */
2
3
NOMIPS16
int
NoBarrier_AtomicIncrement
(
volatile
int
*
ptr
,
int
increment
) {
4
int
temp
,
temp2
;
5
__asm__
__volatile__
(
".set push
\n
"
6
".set noreorder
\n
"
7
"1:
\n
"
8
"ll %0, 0(%3)
\n
"
9
"addu %1, %0, %2
\n
"
10
"sc %1, 0(%3)
\n
"
11
"beqz %1, 1b
\n
"
12
"nop
\n
"
13
"addu %1, %0, %2
\n
"
14
".set pop
\n
"
15
:
"=&r"
(
temp
),
"=&r"
(
temp2
)
16
:
"Ir"
(
increment
),
"r"
(
ptr
)
17
:
"memory"
);
18
19
return
temp2
;
20
}