require_extension('M');
-WRITE_RD(sext_xlen(RS1 * RS2));
+WRITE_RD(sext_xlen(rv_mul(RS1, RS2)));
if (xlen == 64)
WRITE_RD(mulh(RS1, RS2));
else
- WRITE_RD(sext32((sext32(RS1) * sext32(RS2)) >> 32));
+ WRITE_RD(sext32((rv_mul(sext32(RS1), sext32(RS2))) >> 32));
if (xlen == 64)
WRITE_RD(mulhsu(RS1, RS2));
else
- WRITE_RD(sext32((sext32(RS1) * reg_t((uint32_t)RS2)) >> 32));
+ WRITE_RD(sext32((rv_mul(sext32(RS1), reg_t((uint32_t)RS2))) >> 32));
if (xlen == 64)
WRITE_RD(mulhu(RS1, RS2));
else
- WRITE_RD(sext32(((uint64_t)(uint32_t)RS1 * (uint64_t)(uint32_t)RS2) >> 32));
+ WRITE_RD(sext32((rv_mul((uint64_t)(uint32_t)RS1,
+ (uint64_t)(uint32_t)RS2)) >> 32));
return lhs / rhs;
}
+reg_t sv_proc_t::rv_mul(reg_t lhs, reg_t rhs)
+{
+ return lhs * rhs;
+}
+
reg_t rv_sub(reg_t lhs, reg_t rhs);
reg_t rv_div(reg_t lhs, reg_t rhs);
sreg_t rv_div(sreg_t lhs, sreg_t rhs);
+ reg_t rv_mul(reg_t lhs, reg_t rhs);
#include "sv_insn_decl.h"
};