riscv-isa-sim
riscv-isa-sim copied to clipboard
Custom Instruction MAC issue
WRITE_RD(sext_xlen(RS1*RS2 + READ_REG(insn.rd())));
I am trying to create a custom instruction mac(multiply and accumulate) where I multiply the two operands and add the result with the destination register and store it back in the destination register. When I am trying to do the same by defining the mac instuction in riscv-isa-sim/riscv/insn/mac.h by using the above line I am getting som floating values as output instead of rs1*rs2 + rd. What am I doing wrong?