diff options
Diffstat (limited to 'riscv/insns/vmulh_vx.h')
-rw-r--r-- | riscv/insns/vmulh_vx.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/riscv/insns/vmulh_vx.h b/riscv/insns/vmulh_vx.h index a7bf7aa..1898950 100644 --- a/riscv/insns/vmulh_vx.h +++ b/riscv/insns/vmulh_vx.h @@ -1,5 +1,9 @@ // vmulh +reg_t vsew = STATE.VU.vsew; +uint64_t lo_mask = ((uint64_t)1 << vsew) - 1; + VI_VX_LOOP ({ - vd = vsext((rs1 * vs2) >> (sew/2), sew); + int64_t result = (int64_t)rs1 * (int64_t)vs2; + vd = (result >> sew) & lo_mask; }) |