mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-29 13:01:52 -06:00
target/sparc: use signed denominator in sdiv helper
The result has to be done with the signed denominator (b32) instead of the unsigned value passed in argument (b). Cc: qemu-stable@nongnu.org Fixes:1326010322
("target/sparc: Remove CC_OP_DIV") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2319 Signed-off-by: Clément Chigot <chigot@adacore.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20240606144331.698361-1-chigot@adacore.com> Signed-off-by: Richard Henderson <richard.henderson@linaro.org> (cherry picked from commit6b4965373e
) Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
parent
0556f5fc13
commit
c8fdbb5bab
1 changed files with 1 additions and 1 deletions
|
@ -121,7 +121,7 @@ uint64_t helper_sdiv(CPUSPARCState *env, target_ulong a, target_ulong b)
|
||||||
return (uint32_t)(b32 < 0 ? INT32_MAX : INT32_MIN) | (-1ull << 32);
|
return (uint32_t)(b32 < 0 ? INT32_MAX : INT32_MIN) | (-1ull << 32);
|
||||||
}
|
}
|
||||||
|
|
||||||
a64 /= b;
|
a64 /= b32;
|
||||||
r = a64;
|
r = a64;
|
||||||
if (unlikely(r != a64)) {
|
if (unlikely(r != a64)) {
|
||||||
return (uint32_t)(a64 < 0 ? INT32_MIN : INT32_MAX) | (-1ull << 32);
|
return (uint32_t)(a64 < 0 ? INT32_MIN : INT32_MAX) | (-1ull << 32);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue