• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#ifdef __riscv_flen
2
3.global feclearexcept
4.type feclearexcept, %function
5feclearexcept:
6	csrc fflags, a0
7	li a0, 0
8	ret
9
10.global feraiseexcept
11.type feraiseexcept, %function
12feraiseexcept:
13	csrs fflags, a0
14	li a0, 0
15	ret
16
17.global fetestexcept
18.type fetestexcept, %function
19fetestexcept:
20	frflags t0
21	and a0, t0, a0
22	ret
23
24.global fegetround
25.type fegetround, %function
26fegetround:
27	frrm a0
28	ret
29
30.global __fesetround
31.type __fesetround, %function
32__fesetround:
33	fsrm t0, a0
34	li a0, 0
35	ret
36
37.global fegetenv
38.type fegetenv, %function
39fegetenv:
40	frcsr t0
41	sw t0, 0(a0)
42	li a0, 0
43	ret
44
45.global fesetenv
46.type fesetenv, %function
47fesetenv:
48	li t2, -1
49	li t1, 0
50	beq a0, t2, 1f
51	lw t1, 0(a0)
521:	fscsr t1
53	li a0, 0
54	ret
55
56#endif
57