aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/pmhraccsu_w.h
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/insns/pmhraccsu_w.h')
-rw-r--r--riscv/insns/pmhraccsu_w.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/riscv/insns/pmhraccsu_w.h b/riscv/insns/pmhraccsu_w.h
new file mode 100644
index 00000000..7f1d648d
--- /dev/null
+++ b/riscv/insns/pmhraccsu_w.h
@@ -0,0 +1,7 @@
+require_rv64;
+P_RD_RS1_RS2_SULOOP(32,32,32, {
+ sreg_t mres = sext(p_rs1,64) * zext(p_rs2,64);
+ int32_t round = ((mres >> 31) + 1) >> 1;
+ p_rd += round;
+}
+)