Code & Deploy
siGit Code
Git Hosting
Toggle menu
Code
Code Review
Models
Repos
Sign in
Sign in
@samitouri
/
QOSamiQemu
QOSamiQemu
/
tests
/
tcg
/
loongarch64
/
test_fcsr.c
Code
Commits
Issues
Pulls
Sessions
CI/CD
master
master
c
15 lines
279 Bytes
Copy permalink
Copy
Raw
1
#include
<assert.h>
2
3
int
main
()
4
{
5
unsigned
fcsr
;
6
7
asm
(
"movgr2fcsr $r0,$r0
\n\t
"
8
"movgr2fr.d $f0,$r0
\n\t
"
9
"fdiv.d $f0,$f0,$f0
\n\t
"
10
"movfcsr2gr %0,$r0"
11
:
"=r"
(
fcsr
)
:
:
"f0"
);
12
13
assert
(
fcsr
&
(
16
<<
16
));
/* Invalid */
14
return
0
;
15
}