| 1 | #ifdef __riscv_flen |
| 2 | |
| 3 | .global feclearexcept |
| 4 | .type feclearexcept, %function |
| 5 | feclearexcept: |
| 6 | 	csrc fflags, a0 |
| 7 | 	li a0, 0 |
| 8 | 	ret |
| 9 | |
| 10 | .global feraiseexcept |
| 11 | .type feraiseexcept, %function |
| 12 | feraiseexcept: |
| 13 | 	csrs fflags, a0 |
| 14 | 	li a0, 0 |
| 15 | 	ret |
| 16 | |
| 17 | .global fetestexcept |
| 18 | .type fetestexcept, %function |
| 19 | fetestexcept: |
| 20 | 	frflags t0 |
| 21 | 	and a0, t0, a0 |
| 22 | 	ret |
| 23 | |
| 24 | .global fegetround |
| 25 | .type fegetround, %function |
| 26 | fegetround: |
| 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 |
| 39 | fegetenv: |
| 40 | 	frcsr t0 |
| 41 | 	sw t0, 0(a0) |
| 42 | 	li a0, 0 |
| 43 | 	ret |
| 44 | |
| 45 | .global fesetenv |
| 46 | .type fesetenv, %function |
| 47 | fesetenv: |
| 48 | 	li t2, -1 |
| 49 | 	li t1, 0 |
| 50 | 	beq a0, t2, 1f |
| 51 | 	lw t1, 0(a0) |
| 52 | 1:	fscsr t1 |
| 53 | 	li a0, 0 |
| 54 | 	ret |
| 55 | |
| 56 | #endif |