repo.or.cz
/
qemu
/
armbru.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git]
/
tests
/
tcg
/
openrisc
/
test_sfgtsi.c
blob
7366e1292c51e09d9d01ce443e76705312e1ec0b
1
#include <stdio.h>
2
3
int
main
(
void
)
4
{
5
int
a
,
b
;
6
int
result
;
7
8
a
=
0
;
9
result
=
1
;
10
__asm
11
(
"1:
\n\t
"
12
"l.addi %0, %0, 1
\n\t
"
13
"l.sfgtsi %0, 0x3
\n\t
"
14
"l.bf 1b
\n\t
"
15
"l.nop
\n\t
"
16
:
"+r"
(
a
)
17
);
18
if
(
a
!=
result
) {
19
printf
(
"sfgtsi error
\n
"
);
20
return
-
1
;
21
}
22
23
a
=
0xff
;
24
b
=
1
;
25
result
=
3
;
26
__asm
27
(
"1:
\n\t
"
28
"l.sub %0, %0, %1
\n\t
"
29
"l.sfgtsi %0, 0x3
\n\t
"
30
"l.bf 1b
\n\t
"
31
"l.nop
\n\t
"
32
:
"+r"
(
a
)
33
:
"r"
(
b
)
34
);
35
if
(
a
!=
result
) {
36
printf
(
"sfgtsi error
\n
"
);
37
return
-
1
;
38
}
39
40
return
0
;
41
}