add WRITE_FRD macro redirect
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 12 Oct 2018 17:05:04 +0000 (18:05 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 12 Oct 2018 17:05:04 +0000 (18:05 +0100)
riscv/insn_template_sv.cc
riscv/sv_insn_redirect.cc
riscv/sv_insn_redirect.h

index 4c1c161de853c4633633b57ef21cc2877b9be353..46d0887e3c762937368f97b3bb2ee1f33a4434e3 100644 (file)
@@ -114,7 +114,7 @@ reg_t sv_proc_t::FN(processor_t* p, insn_t s_insn, reg_t pc)
   bool zeroingtarg = false;
 #endif
   sv_insn_t insn(p, sv_enabled, bits, floatintmap, PRED_ARGS, OFFS_ARGS);
-  p->s.set_insn(&insn);
+  p->s.set_insn(&insn, xlen);
 #ifdef USING_NOREGS
   #include INCLUDEFILE
 #else
index 05c55d130a84a8286c5f188fca31da3d7bb43c50..0d8f899b807ecb704f1076f2f6d0f323e4adcda7 100644 (file)
@@ -1,6 +1,11 @@
 #include "sv_insn_redirect.h"
 #include "processor.h"
 
+void (sv_proc_t::WRITE_FRD)(freg_t value)
+{
+    WRITE_FREG( insn->rd(), value );
+}
+
 void (sv_proc_t::WRITE_RD)(reg_t value)
 {
     WRITE_REG( insn->rd(), value );
index 95550ba8eb5cc227689363e7c655671a8d4c2f09..663164d3cd33ffbd4a3df5de0024eae7d90985ae 100644 (file)
@@ -34,15 +34,18 @@ class RS2 {
 class sv_proc_t
 {
 public:
-    sv_proc_t(processor_t *_p) : p(_p), insn(NULL) {}
+    sv_proc_t(processor_t *_p) : p(_p), insn(NULL), xlen(0) {}
     void (WRITE_RD)(reg_t value);
+    void (WRITE_FRD)(freg_t value);
     //reg_t (READ_REG)(uint64_t i);
 
     processor_t *p;
     sv_insn_t *insn;
+    int xlen;
 
-    void set_insn(sv_insn_t *i) {
+    void set_insn(sv_insn_t *i, int x) {
         this->insn = i;
+        this->xlen = x;
     }
 
     reg_t get_rs1();