From: Luke Kenneth Casson Leighton Date: Sun, 14 Oct 2018 04:24:18 +0000 (+0100) Subject: redirect subtract through rv_sub X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b59a9219ce4468151a21b3267e54af7533c4e9ef;p=riscv-isa-sim.git redirect subtract through rv_sub --- diff --git a/riscv/insns/sub.h b/riscv/insns/sub.h index 9ed48f7..ac1a2ff 100644 --- a/riscv/insns/sub.h +++ b/riscv/insns/sub.h @@ -1 +1 @@ -WRITE_RD(sext_xlen(RS1 - RS2)); +WRITE_RD(sext_xlen(rv_sub(RS1, RS2))); diff --git a/riscv/insns/subw.h b/riscv/insns/subw.h index b4168ef..a17092b 100644 --- a/riscv/insns/subw.h +++ b/riscv/insns/subw.h @@ -1,3 +1,3 @@ require_rv64; -WRITE_RD(sext32(RS1 - RS2)); +WRITE_RD(sext32(rv_sub(RS1, RS2))); diff --git a/riscv/sv_insn_redirect.cc b/riscv/sv_insn_redirect.cc index 519248e..f883a7b 100644 --- a/riscv/sv_insn_redirect.cc +++ b/riscv/sv_insn_redirect.cc @@ -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; +} + diff --git a/riscv/sv_insn_redirect.h b/riscv/sv_insn_redirect.h index aef52ee..05faf61 100644 --- a/riscv/sv_insn_redirect.h +++ b/riscv/sv_insn_redirect.h @@ -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" };