Skip to content

Commit 6b49653

Browse files
Helflymrth7680
authored andcommitted
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: [email protected] Fixes: 1326010 ("target/sparc: Remove CC_OP_DIV") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2319 Signed-off-by: Clément Chigot <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent 54b2792 commit 6b49653

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

target/sparc/helper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ uint64_t helper_sdiv(CPUSPARCState *env, target_ulong a, target_ulong b)
121121
return (uint32_t)(b32 < 0 ? INT32_MAX : INT32_MIN) | (-1ull << 32);
122122
}
123123

124-
a64 /= b;
124+
a64 /= b32;
125125
r = a64;
126126
if (unlikely(r != a64)) {
127127
return (uint32_t)(a64 < 0 ? INT32_MIN : INT32_MAX) | (-1ull << 32);

0 commit comments

Comments
 (0)