qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] target/sparc: use signed denominator in sdiv helper


From: Richard Henderson
Subject: Re: [PATCH] target/sparc: use signed denominator in sdiv helper
Date: Sun, 16 Jun 2024 11:39:28 -0700
User-agent: Mozilla Thunderbird

On 6/6/24 07:43, Clément Chigot wrote:
The result has to be done with the signed denominator (b32) instead of
the unsigned value passed in argument (b).

Fixes: 1326010322d6 ("target/sparc: Remove CC_OP_DIV")
Signed-off-by: Clément Chigot <chigot@adacore.com>
---
  target/sparc/helper.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/sparc/helper.c b/target/sparc/helper.c
index 2247e243b5..7846ddd6f6 100644
--- a/target/sparc/helper.c
+++ b/target/sparc/helper.c
@@ -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);
      }
- a64 /= b;
+    a64 /= b32;
      r = a64;
      if (unlikely(r != a64)) {
          return (uint32_t)(a64 < 0 ? INT32_MIN : INT32_MAX) | (-1ull << 32);

Queued, thanks.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]