about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fenv/riscv64/fenv.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fenv/riscv64/fenv.S b/src/fenv/riscv64/fenv.S
index f149003d..0ea78bf9 100644
--- a/src/fenv/riscv64/fenv.S
+++ b/src/fenv/riscv64/fenv.S
@@ -45,8 +45,11 @@ fegetenv:
 .global fesetenv
 .type fesetenv, %function
 fesetenv:
+	li t2, -1
+	li t1, 0
+	beq a0, t2, 1f
 	lw t1, 0(a0)
-	fscsr t0, t1
+1:	fscsr t1
 	li a0, 0
 	ret