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_add.c
blob
e00212dad659d02d916878595f687b833d16cefe
1
#include <stdio.h>
2
3
int
main
(
void
)
4
{
5
float
a
,
b
;
6
float
res2
;
7
8
a
=
1.5
;
9
b
=
2.5
;
10
res2
=
4.0
;
11
__asm
12
(
"lf.add.s %0, %0, %1
\n\t
"
13
:
"+r"
(
a
)
14
:
"r"
(
b
)
15
);
16
if
(
a
!=
res2
) {
17
printf
(
"lf.add.s error, %f
\n
"
,
a
);
18
return
-
1
;
19
}
20
21
/* double c, d;
22
double res1;
23
24
c = 1.5;
25
d = 1.5;
26
res1 = 3.00;
27
__asm
28
("lf.add.d %0, %1, %2\n\t"
29
: "+r"(c)
30
: "r"(d)
31
);
32
33
if ((e - res1) > 0.002) {
34
printf("lf.add.d error, %f\n", e - res1);
35
return -1;
36
}*/
37
38
return
0
;
39
}