aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns/kmmwb2.h
diff options
context:
space:
mode:
Diffstat (limited to 'riscv/insns/kmmwb2.h')
-rw-r--r--riscv/insns/kmmwb2.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/riscv/insns/kmmwb2.h b/riscv/insns/kmmwb2.h
new file mode 100644
index 0000000..8574aa5
--- /dev/null
+++ b/riscv/insns/kmmwb2.h
@@ -0,0 +1,9 @@
+P_LOOP(32, {
+ if((INT32_MIN != ps1) | (INT16_MIN != P_SH(ps2, 0))) {
+ int64_t mres = ((int64_t) ps1 * P_SH(ps2, 0)) << 1;
+ pd = mres >> 16;
+ } else {
+ pd = INT32_MAX;
+ P_SET_OV(1);
+ }
+}) \ No newline at end of file