aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/pmhracc_h.h
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/insns/pmhracc_h.h')
-rw-r--r--riscv/insns/pmhracc_h.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/riscv/insns/pmhracc_h.h b/riscv/insns/pmhracc_h.h
new file mode 100644
index 00000000..1c79a71a
--- /dev/null
+++ b/riscv/insns/pmhracc_h.h
@@ -0,0 +1,5 @@
+P_RD_RS1_RS2_LOOP(16,16,16, {
+ int32_t mres = sext(p_rs1,32) * sext(p_rs2,32);
+ int16_t round = ((mres >> 15) + 1) >> 1;
+ p_rd += round;
+}) \ No newline at end of file