redirect WRITE_FRD including different types (128/64/32)
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 12 Oct 2018 17:22:43 +0000 (18:22 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 12 Oct 2018 17:22:43 +0000 (18:22 +0100)
riscv/sv_insn_redirect.cc
riscv/sv_insn_redirect.h

index 0d8f899b807ecb704f1076f2f6d0f323e4adcda7..e8b18bafd3ff98d3d1f21e00032fa5440c0023f6 100644 (file)
@@ -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)
index 663164d3cd33ffbd4a3df5de0024eae7d90985ae..fc3cbb986f292e965acc9e7c7433aeafcfeab0f3 100644 (file)
@@ -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;