repo.or.cz
/
qemu
/
ar7.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
tap: factor out common tap initialization
[qemu/ar7.git]
/
tests
/
tcg
/
openrisc
/
test_lf_div.c
blob
70b5d1c17b3284ddb6ee62dbcda8eed054de945d
1
#include <stdio.h>
2
3
int
main
(
void
)
4
{
5
float
a
,
b
,
c
;
6
float
result
;
7
8
b
=
1.5
;
9
c
=
0.5
;
10
result
=
3.0
;
11
__asm
12
(
"lf.div.s %0, %1, %2
\n\t
"
13
:
"=r"
(
a
)
14
:
"r"
(
b
),
"r"
(
c
)
15
);
16
if
(
a
!=
result
) {
17
printf
(
"lf.div.s error
\n
"
);
18
return
-
1
;
19
}
20
21
/* double a, b, c, res;
22
23
b = 0x80000000;
24
c = 0x40;
25
result = 0x2000000;
26
__asm
27
("lf.div.d %0, %1, %2\n\t"
28
: "=r"(a)
29
: "r"(b), "r"(c)
30
);
31
if (a != result) {
32
printf("lf.div.d error\n");
33
return -1;
34
}*/
35
36
return
0
;
37
}