Skip to content

Commit

Permalink
Fix overflow issue of p-ext multiply instructions (#1053)
Browse files Browse the repository at this point in the history
  • Loading branch information
hope51607 authored Jul 28, 2022
1 parent 8d016bf commit 66fd65c
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion riscv/insns/smul16.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
P_MUL_LOOP(16, {
pd = ps1 * ps2;
pd = (int32_t)ps1 * (int32_t)ps2;
})
2 changes: 1 addition & 1 deletion riscv/insns/smul8.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
P_MUL_LOOP(8, {
pd = ps1 * ps2;
pd = (int16_t)ps1 * (int16_t)ps2;
})
2 changes: 1 addition & 1 deletion riscv/insns/smulx16.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
P_MUL_CROSS_LOOP(16, {
pd = ps1 * ps2;
pd = (int32_t)ps1 * (int32_t)ps2;
})
2 changes: 1 addition & 1 deletion riscv/insns/smulx8.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
P_MUL_CROSS_LOOP(8, {
pd = ps1 * ps2;
pd = (int16_t)ps1 * (int16_t)ps2;
})
2 changes: 1 addition & 1 deletion riscv/insns/umul16.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
P_MUL_ULOOP(16, {
pd = ps1 * ps2;
pd = (uint32_t)ps1 * (uint32_t)ps2;
})
2 changes: 1 addition & 1 deletion riscv/insns/umul8.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
P_MUL_ULOOP(8, {
pd = ps1 * ps2;
pd = (uint16_t)ps1 * (uint16_t)ps2;
})
2 changes: 1 addition & 1 deletion riscv/insns/umulx16.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
P_MUL_CROSS_ULOOP(16, {
pd = ps1 * ps2;
pd = (uint32_t)ps1 * (uint32_t)ps2;
})
2 changes: 1 addition & 1 deletion riscv/insns/umulx8.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
P_MUL_CROSS_ULOOP(8, {
pd = ps1 * ps2;
pd = (uint16_t)ps1 * (uint16_t)ps2;
})

0 comments on commit 66fd65c

Please sign in to comment.