aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/mulh.h
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/insns/mulh.h')
-rw-r--r--riscv/insns/mulh.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/riscv/insns/mulh.h b/riscv/insns/mulh.h
new file mode 100644
index 0000000..f771a62
--- /dev/null
+++ b/riscv/insns/mulh.h
@@ -0,0 +1,8 @@
+if(xpr64)
+{
+ int64_t a = RS1;
+ int64_t b = RS2;
+ RD = (int128_t(a) * int128_t(b)) >> 64;
+}
+else
+ RD = sext32((sext32(RS1) * sext32(RS2)) >> 32);