summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorJiri Gaisler <jiri@gaisler.se>2020-04-06 23:10:03 +0200
committerJiri Gaisler <jiri@gaisler.se>2020-09-09 10:37:55 +0200
commitb477e9102a10813fe629633a48c877c9af46cd32 (patch)
tree4cbe638aedc330dcc1cb768511be16c392da81e1 /exec.c
parentd03731a245113bd4f9587dc9a64c1c06cd8c6a1a (diff)
Map RISC-V FPU CSR on host cpu using fenv.h
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index 3c9548d..0805b38 100644
--- a/exec.c
+++ b/exec.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
+#include <fenv.h>
int ext_irl[NCPU];
@@ -114,6 +115,13 @@ div64 (uint32 n1_hi, uint32 n1_low, uint32 n2, uint32 * result, int msigned)
*result = (uint32) (n1 & 0xffffffff);
}
+/* How to clear the accrued FPU exceptions */
+void
+clear_accex ()
+{
+ feclearexcept (FE_ALL_EXCEPT);
+}
+
void
init_regs (sregs)
struct pstate *sregs;
@@ -147,7 +155,6 @@ init_regs (sregs)
sregs[i].fsi = (int32 *) sregs[i].fd;
sregs[i].fsr = 0;
sregs[i].fpu_pres = !nfp;
- set_fsr (sregs[i].fsr);
sregs[i].ildreg = 0;
sregs[i].ildtime = 0;