about summary refs log tree commit diff
path: root/src/fenv/riscv64/fenv.S
blob: f149003d2eeade71c05fd188d913d2256f918f43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifdef __riscv_flen

.global feclearexcept
.type feclearexcept, %function
feclearexcept:
	csrc fflags, a0
	li a0, 0
	ret

.global feraiseexcept
.type feraiseexcept, %function
feraiseexcept:
	csrs fflags, a0
	li a0, 0
	ret

.global fetestexcept
.type fetestexcept, %function
fetestexcept:
	frflags t0
	and a0, t0, a0
	ret

.global fegetround
.type fegetround, %function
fegetround:
	frrm a0
	ret

.global __fesetround
.type __fesetround, %function
__fesetround:
	fsrm t0, a0
	li a0, 0
	ret

.global fegetenv
.type fegetenv, %function
fegetenv:
	frcsr t0
	sw t0, 0(a0)
	li a0, 0
	ret

.global fesetenv
.type fesetenv, %function
fesetenv:
	lw t1, 0(a0)
	fscsr t0, t1
	li a0, 0
	ret

#endif