diff options
Diffstat (limited to 'riscv/insns/vsmul_vx.h')
-rw-r--r-- | riscv/insns/vsmul_vx.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/riscv/insns/vsmul_vx.h b/riscv/insns/vsmul_vx.h index 4326d8f..cf4b511 100644 --- a/riscv/insns/vsmul_vx.h +++ b/riscv/insns/vsmul_vx.h @@ -1,7 +1,7 @@ -// vsmul +// vsmul.vx vd, vs2, rs1 VRM xrm = P.VU.get_vround_mode(); -int64_t int_max = (uint64_t(1) << (P.VU.vsew - 1)) - 1; -int64_t int_min = - (1 << (P.VU.vsew - 1)); +int64_t int_max = INT64_MAX >> (64 - P.VU.vsew); +int64_t int_min = INT64_MIN >> (64 - P.VU.vsew); int64_t sign_mask = uint64_t(1) << (P.VU.vsew - 1); VI_VX_LOOP @@ -26,7 +26,7 @@ VI_VX_LOOP // max saturation if (overflow) { result = int_max; - P.VU.vxsat = 1; + P.VU.vxsat |= 1; } vd = result; |