message: Fix various bugs in the MUL extension
diff: @@ -308,7 +308,7 @@ instrState Runner::execOpInstr(Instruction instr) {
  case 0b001:
  if (fields[0] == 0b0000001) {
  // MULH
  - int64_t res = (int32_t)m_reg[fields[1]] * (int32_t)m_reg[fields[2]];
  + int64_t res = signextend<int64_t, 32>(m_reg[fields[1]]) * signextend<int64_t, 32>(m_reg[fields[2]]);
  res >>= 32;
  m_reg[fields[4]] = res;
  break;
  @@ -320,7 +320,7 @@ instrState Runner::execOpInstr(Instruction instr) {
  case 0b010:
  if (fields[0] == 0b0000001) {
  // MULHSU
  - int64_t res = (int32_t)m_reg[fields[1]] * (uint32_t)m_reg[fields[2]];
  + int64_t res = m_reg[fields[1]] * signextend<int64_t, 32>(m_reg[fields[2]]);
  res >>= 32;
  m_reg[fields[4]] = res;
  break;
  @@ -356,8 +356,7 @@ instrState Runner::execOpInstr(Instruction instr) {
  // Overflow
  m_reg[fields[4]] = -pow(2, 31);
  break;
  - }
  - else {
  + } else {
  m_reg[fields[4]] = (int32_t)m_reg[fields[2]] / (int32_t)m_reg[fields[1]];
  break;
  }
  @@ -380,8 +379,7 @@ instrState Runner::execOpInstr(Instruction instr) {
  // Divison by zero
  m_reg[fields[4]] = pow(2, 31) - 1;
  break;
  - }
  - else {
  + } else {
  m_reg[fields[4]] = m_reg[fields[2]] / m_reg[fields[1]];
  break;
  }
  @@ -399,8 +397,7 @@ instrState Runner::execOpInstr(Instruction instr) {
  // Overflow
  m_reg[fields[4]] = 0;
  break;
  - }
  - else {
  + } else {
  m_reg[fields[4]] = (int32_t)m_reg[fields[2]] % (int32_t)m_reg[fields[1]];
  break;
  }
  