title: Why mulh instruction in riscv32 gives 0?
body: <pre><code>Multiplier = 0xffffffff
  Multiplicand = 0xffffffff
  Result = 0xFFFFFFFE 00000001 (multiplier * multiplicand)
  </code></pre>
  <p><code>mulh</code> instruction is expected to give the upper XLEN bits of the result as per RISC-Vs pec. But when I run <code>mulh t0, a0, a1;</code> with multiplier  in <code>a0</code> and multiplicand in <code>a1</code>, the result in <code>t0</code> is 0. Can someone explain why?  I run this in RV32IMAC (FE310 core).</p>
  <p>assembly and C code below:</p>
  <pre><code>mulh_asm:
      mulh t0, a0, a1;
      addi a0, x0, 0; // **Break point here to watch t0 value**
  ret;
  
  mrest[0] = mulh_asm(0xffffffff,  0xffffffff);
  </code></pre>