redirect add to rv_add
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Oct 2018 04:22:18 +0000 (05:22 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Oct 2018 04:22:18 +0000 (05:22 +0100)
riscv/insns/add.h
riscv/insns/addi.h
riscv/insns/addiw.h
riscv/sv_insn_redirect.cc
riscv/sv_insn_redirect.h

index 895e2b1867dbf29aee59a86fc68fcbad5e2535f1..4e289ef0214ffe15fd6788d6bf3b3d04b821dc83 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xlen(RS1 + RS2));
+WRITE_RD(sext_xlen(rv_add(RS1, RS2)));
index 1bb5dcedfa8e3c1269cd2f37697c090535e70d04..231aef8ef27dce3c0d24c57c05e20ddf3030071a 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xlen(RS1 + insn.i_imm()));
+WRITE_RD(sext_xlen(rv_add(RS1, insn.i_imm())));
index 4263eada244bb6f2f43f88df926600ece25a3dca..9f1cdd45163d85952ca62ef2417791cebf366bd0 100644 (file)
@@ -1,2 +1,2 @@
 require_rv64;
-WRITE_RD(sext32(insn.i_imm() + RS1));
+WRITE_RD(sext32(rv_add(insn.i_imm(), RS1)));
index 02edba51b015ff80dbb5ce0552fc2aa0ce454f6c..519248e8780d0ce2de200c25b3284cb7f38d80af 100644 (file)
@@ -217,3 +217,8 @@ sv_reg_t::operator reg_t ()
     return y;
 }
 */
+reg_t sv_proc_t::rv_add(reg_t lhs, reg_t rhs)
+{
+    return lhs + rhs;
+}
+
index 29f680dc74788bcec7a1383dcca6fddf44a8b519..aef52ee330e04526f4d724de14320fe2c2b327c9 100644 (file)
@@ -94,6 +94,8 @@ public:
     //reg_t (sext32)(sv_reg_t &v);
     reg_t (zext32)(reg_t v);
 
+    reg_t rv_add(reg_t lhs, reg_t rhs);
+
 #include "sv_insn_decl.h"
 };