Spike, a RISC-V ISA Simulator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

7 lines
184 B

require_extension('P');
require_rv32;
if ((RS1 != (reg_t)INT32_MIN) || (RS2 != (reg_t)INT32_MIN)) {
WRITE_RD((((RS1 * RS2) >> 30) + 1) >> 1);
} else {
WRITE_RD(INT32_MAX);
}