redirect subtract through rv_sub
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Oct 2018 04:24:18 +0000 (05:24 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 14 Oct 2018 04:24:18 +0000 (05:24 +0100)
riscv/insns/sub.h
riscv/insns/subw.h
riscv/sv_insn_redirect.cc
riscv/sv_insn_redirect.h

index 9ed48f7449061acd822a616d24fb8b16303cb13b..ac1a2ff4cfa1467a615b5944eab405580ad3a02b 100644 (file)
@@ -1 +1 @@
-WRITE_RD(sext_xlen(RS1 - RS2));
+WRITE_RD(sext_xlen(rv_sub(RS1, RS2)));
index b4168efe824f608ff0ab3b841db92bd50f378bde..a17092b2d41596cf4951a8ac5cf6b3ca92512d9c 100644 (file)
@@ -1,3 +1,3 @@
 require_rv64;
-WRITE_RD(sext32(RS1 - RS2));
+WRITE_RD(sext32(rv_sub(RS1, RS2)));
 
index 519248e8780d0ce2de200c25b3284cb7f38d80af..f883a7b7c2bd7726ec8b628dd4e9c51be1a44ff1 100644 (file)
@@ -222,3 +222,8 @@ reg_t sv_proc_t::rv_add(reg_t lhs, reg_t rhs)
     return lhs + rhs;
 }
 
+reg_t sv_proc_t::rv_sub(reg_t lhs, reg_t rhs)
+{
+    return lhs - rhs;
+}
+
index aef52ee330e04526f4d724de14320fe2c2b327c9..05faf61dc8c226de7792484e6d77dcf595f9e49c 100644 (file)
@@ -95,6 +95,7 @@ public:
     reg_t (zext32)(reg_t v);
 
     reg_t rv_add(reg_t lhs, reg_t rhs);
+    reg_t rv_sub(reg_t lhs, reg_t rhs);
 
 #include "sv_insn_decl.h"
 };