diff --git a/riscv/insns/smul16.h b/riscv/insns/smul16.h index 8f87612d34..7e0f08abb6 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 155e50e08d..a4a3ed93f9 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 14ae047f48..58e9a08d0e 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 b5ae41ca5f..9270ce361c 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 860f9420e8..09b839ca90 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 04d7a6ef04..29cae88500 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 5abe9cf812..3f0cce8ba7 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 a2b073dee4..848b5d588d 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; })