From: Luke Kenneth Casson Leighton Date: Fri, 12 Oct 2018 17:22:43 +0000 (+0100) Subject: redirect WRITE_FRD including different types (128/64/32) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6868fb1e170d99e76c49d72f070b651529503ba6;p=riscv-isa-sim.git redirect WRITE_FRD including different types (128/64/32) --- diff --git a/riscv/sv_insn_redirect.cc b/riscv/sv_insn_redirect.cc index 0d8f899..e8b18ba 100644 --- a/riscv/sv_insn_redirect.cc +++ b/riscv/sv_insn_redirect.cc @@ -1,9 +1,22 @@ #include "sv_insn_redirect.h" #include "processor.h" +void (sv_proc_t::WRITE_FRD)(float32_t value) +{ + fprintf(stderr, "WRITE_FRD float32_t %f\n", (float)value.v); + DO_WRITE_FREG( insn->rd(), freg(value) ); +} + +void (sv_proc_t::WRITE_FRD)(float64_t value) +{ + fprintf(stderr, "WRITE_FRD float64_t %g\n", (double)value.v); + DO_WRITE_FREG( insn->rd(), freg(value) ); +} + void (sv_proc_t::WRITE_FRD)(freg_t value) { - WRITE_FREG( insn->rd(), value ); + fprintf(stderr, "WRITE_FRD freg_t %lx\n", value.v); + DO_WRITE_FREG( insn->rd(), freg(value) ); } void (sv_proc_t::WRITE_RD)(reg_t value) diff --git a/riscv/sv_insn_redirect.h b/riscv/sv_insn_redirect.h index 663164d..fc3cbb9 100644 --- a/riscv/sv_insn_redirect.h +++ b/riscv/sv_insn_redirect.h @@ -10,6 +10,8 @@ #undef RS3 #undef FRS1 #undef FRS2 +#undef WRITE_FRD +#undef WRITE_RD class processor_t; class insn_t; @@ -37,6 +39,8 @@ public: sv_proc_t(processor_t *_p) : p(_p), insn(NULL), xlen(0) {} void (WRITE_RD)(reg_t value); void (WRITE_FRD)(freg_t value); + void (WRITE_FRD)(float64_t value); + void (WRITE_FRD)(float32_t value); //reg_t (READ_REG)(uint64_t i); processor_t *p;