aboutsummaryrefslogtreecommitdiff
path: root/riscv/insns
diff options
context:
space:
mode:
authorChunPing Chung <cpchung@pllab.cs.nthu.edu.tw>2022-07-29 03:01:26 +0800
committerGitHub <noreply@github.com>2022-07-28 12:01:26 -0700
commit66fd65c0d2ebc84bd8d8f82258e0988fdca07719 (patch)
tree038e79517c0a9278b28f04b6cb6093e2cee4000f /riscv/insns
parent8d016bffdbc8d7cbeb253cc4f2ee9e5d4bf0a626 (diff)
downloadriscv-isa-sim-66fd65c0d2ebc84bd8d8f82258e0988fdca07719.zip
riscv-isa-sim-66fd65c0d2ebc84bd8d8f82258e0988fdca07719.tar.gz
riscv-isa-sim-66fd65c0d2ebc84bd8d8f82258e0988fdca07719.tar.bz2
Fix overflow issue of p-ext multiply instructions (#1053)
Diffstat (limited to 'riscv/insns')
-rw-r--r--riscv/insns/smul16.h2
-rw-r--r--riscv/insns/smul8.h2
-rw-r--r--riscv/insns/smulx16.h2
-rw-r--r--riscv/insns/smulx8.h2
-rw-r--r--riscv/insns/umul16.h2
-rw-r--r--riscv/insns/umul8.h2
-rw-r--r--riscv/insns/umulx16.h2
-rw-r--r--riscv/insns/umulx8.h2
8 files changed, 8 insertions, 8 deletions
diff --git a/riscv/insns/smul16.h b/riscv/insns/smul16.h
index 8f87612..7e0f08a 100644
--- a/riscv/insns/smul16.h
+++ b/riscv/insns/smul16.h
@@ -1,3 +1,3 @@
P_MUL_LOOP(16, {
- pd = ps1 * ps2;
+ pd = (int32_t)ps1 * (int32_t)ps2;
})
diff --git a/riscv/insns/smul8.h b/riscv/insns/smul8.h
index 155e50e..a4a3ed9 100644
--- a/riscv/insns/smul8.h
+++ b/riscv/insns/smul8.h
@@ -1,3 +1,3 @@
P_MUL_LOOP(8, {
- pd = ps1 * ps2;
+ pd = (int16_t)ps1 * (int16_t)ps2;
})
diff --git a/riscv/insns/smulx16.h b/riscv/insns/smulx16.h
index 14ae047..58e9a08 100644
--- a/riscv/insns/smulx16.h
+++ b/riscv/insns/smulx16.h
@@ -1,3 +1,3 @@
P_MUL_CROSS_LOOP(16, {
- pd = ps1 * ps2;
+ pd = (int32_t)ps1 * (int32_t)ps2;
})
diff --git a/riscv/insns/smulx8.h b/riscv/insns/smulx8.h
index b5ae41c..9270ce3 100644
--- a/riscv/insns/smulx8.h
+++ b/riscv/insns/smulx8.h
@@ -1,3 +1,3 @@
P_MUL_CROSS_LOOP(8, {
- pd = ps1 * ps2;
+ pd = (int16_t)ps1 * (int16_t)ps2;
})
diff --git a/riscv/insns/umul16.h b/riscv/insns/umul16.h
index 860f942..09b839c 100644
--- a/riscv/insns/umul16.h
+++ b/riscv/insns/umul16.h
@@ -1,3 +1,3 @@
P_MUL_ULOOP(16, {
- pd = ps1 * ps2;
+ pd = (uint32_t)ps1 * (uint32_t)ps2;
})
diff --git a/riscv/insns/umul8.h b/riscv/insns/umul8.h
index 04d7a6e..29cae88 100644
--- a/riscv/insns/umul8.h
+++ b/riscv/insns/umul8.h
@@ -1,3 +1,3 @@
P_MUL_ULOOP(8, {
- pd = ps1 * ps2;
+ pd = (uint16_t)ps1 * (uint16_t)ps2;
})
diff --git a/riscv/insns/umulx16.h b/riscv/insns/umulx16.h
index 5abe9cf..3f0cce8 100644
--- a/riscv/insns/umulx16.h
+++ b/riscv/insns/umulx16.h
@@ -1,3 +1,3 @@
P_MUL_CROSS_ULOOP(16, {
- pd = ps1 * ps2;
+ pd = (uint32_t)ps1 * (uint32_t)ps2;
})
diff --git a/riscv/insns/umulx8.h b/riscv/insns/umulx8.h
index a2b073d..848b5d5 100644
--- a/riscv/insns/umulx8.h
+++ b/riscv/insns/umulx8.h
@@ -1,3 +1,3 @@
P_MUL_CROSS_ULOOP(8, {
- pd = ps1 * ps2;
+ pd = (uint16_t)ps1 * (uint16_t)ps2;
})