qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Clément Chigot" <chigot@adacore.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH] target/sparc: use signed denominator in sdiv helper
Date: Thu, 6 Jun 2024 10:07:00 -0700	[thread overview]
Message-ID: <36f234ff-2928-406a-ab9c-848c54ed2f38@linaro.org> (raw)
In-Reply-To: <20240606144331.698361-1-chigot@adacore.com>

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);

Oops.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


  reply	other threads:[~2024-06-06 17:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 14:43 [PATCH] target/sparc: use signed denominator in sdiv helper Clément Chigot
2024-06-06 17:07 ` Richard Henderson [this message]
2024-06-06 17:34 ` Mark Cave-Ayland
2024-06-16 18:39 ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36f234ff-2928-406a-ab9c-848c54ed2f38@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=chigot@adacore.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).