target/riscv: Fixup saturate subtract function
commit65606f21243a796537bfe4708720a9bf4bb50169
authorLIU Zhiwei <zhiwei_liu@c-sky.com>
Fri, 12 Feb 2021 15:02:21 +0000 (12 23:02 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 11 May 2021 10:02:06 +0000 (11 20:02 +1000)
tree4eddd62d2c56a4f6f0e128fa40ec14871e2ebe95
parent11c27c6ded4d41bf0d100c8b5b49d5056204c911
target/riscv: Fixup saturate subtract function

The overflow predication ((a - b) ^ a) & (a ^ b) & INT64_MIN is right.
However, when the predication is ture and a is 0, it should return maximum.

Signed-off-by: LIU Zhiwei <zhiwei_liu@c-sky.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20210212150256.885-4-zhiwei_liu@c-sky.com
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/vector_helper.c