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_mulu.c
blob
2d1e97d16e202d578c2a7c9e2ac4a30b58d15121
1
#include <stdio.h>
2
3
int
main
(
void
)
4
{
5
int
a
,
b
,
c
;
6
int
result
;
7
8
b
=
0x4
;
9
c
=
0x1
;
10
result
=
0x4
;
11
__asm
12
(
"l.mulu %0, %1, %2
\n\t
"
13
:
"=r"
(
a
)
14
:
"r"
(
b
),
"r"
(
c
)
15
);
16
if
(
a
!=
result
) {
17
printf
(
"mulu error
\n
"
);
18
return
-
1
;
19
}
20
21
b
=
0x1
;
22
c
=
0x0
;
23
result
=
0x0
;
24
__asm
25
(
"l.mulu %0, %1, %2
\n\t
"
26
:
"=r"
(
a
)
27
:
"r"
(
b
),
"r"
(
c
)
28
);
29
if
(
a
!=
result
) {
30
printf
(
"mulu error
\n
"
);
31
return
-
1
;
32
}
33
34
b
=
0x1
;
35
c
=
0xff
;
36
result
=
0xff
;
37
__asm
38
(
"l.mulu %0, %1, %2
\n\t
"
39
:
"=r"
(
a
)
40
:
"r"
(
b
),
"r"
(
c
)
41
);
42
if
(
a
!=
result
) {
43
printf
(
"mulu error
\n
"
);
44
return
-
1
;
45
}
46
47
return
0
;
48
}