aboutsummaryrefslogtreecommitdiff
path: root/machine/emulation.c
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2016-10-25 17:10:21 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2016-10-25 17:10:21 -0700
commit6c1d0604dcabf36a6a8d8d9a839b2d4634e202d2 (patch)
tree1fce6d9110fe4404663463a3457a45f71f384547 /machine/emulation.c
parentf81b722bf004177eadaf6f1b4b9e699e20257521 (diff)
downloadpk-6c1d0604dcabf36a6a8d8d9a839b2d4634e202d2.zip
pk-6c1d0604dcabf36a6a8d8d9a839b2d4634e202d2.tar.gz
pk-6c1d0604dcabf36a6a8d8d9a839b2d4634e202d2.tar.bz2
Use __riscv_flen macro to detect FP support
Diffstat (limited to 'machine/emulation.c')
-rw-r--r--machine/emulation.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/machine/emulation.c b/machine/emulation.c
index e574b99..d8e0f1e 100644
--- a/machine/emulation.c
+++ b/machine/emulation.c
@@ -10,7 +10,7 @@ void illegal_insn_trap(uintptr_t* regs, uintptr_t mcause, uintptr_t mepc)
asm (".pushsection .rodata\n"
"illegal_insn_trap_table:\n"
" .word truly_illegal_insn\n"
-#if !defined(__riscv_hard_float) && defined(PK_ENABLE_FP_EMULATION)
+#if !defined(__riscv_flen) && defined(PK_ENABLE_FP_EMULATION)
" .word emulate_float_load\n"
#else
" .word truly_illegal_insn\n"
@@ -22,7 +22,7 @@ void illegal_insn_trap(uintptr_t* regs, uintptr_t mcause, uintptr_t mepc)
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
" .word truly_illegal_insn\n"
-#if !defined(__riscv_hard_float) && defined(PK_ENABLE_FP_EMULATION)
+#if !defined(__riscv_flen) && defined(PK_ENABLE_FP_EMULATION)
" .word emulate_float_store\n"
#else
" .word truly_illegal_insn\n"
@@ -106,7 +106,7 @@ static inline int emulate_read_csr(int num, uintptr_t mstatus, uintptr_t* result
*result = *mtime >> 32;
return 0;
#endif
-#if !defined(__riscv_hard_float) && defined(PK_ENABLE_FP_EMULATION)
+#if !defined(__riscv_flen) && defined(PK_ENABLE_FP_EMULATION)
case CSR_FRM:
if ((mstatus & MSTATUS_FS) == 0) break;
*result = GET_FRM();
@@ -128,7 +128,7 @@ static inline int emulate_write_csr(int num, uintptr_t value, uintptr_t mstatus)
{
switch (num)
{
-#if !defined(__riscv_hard_float) && defined(PK_ENABLE_FP_EMULATION)
+#if !defined(__riscv_flen) && defined(PK_ENABLE_FP_EMULATION)
case CSR_FRM: SET_FRM(value); return 0;
case CSR_FFLAGS: SET_FFLAGS(value); return 0;
case CSR_FCSR: SET_FCSR(value); return 0;