qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Subject: Re: [PATCH] hvf: arm: sign extend when SSE=1
Date: Sun, 9 Feb 2025 11:19:45 -0800	[thread overview]
Message-ID: <96710e26-9cb3-43de-b739-a67670faa93e@linaro.org> (raw)
In-Reply-To: <20250209025358.43533-1-j@getutm.app>

On 2/8/25 18:53, Joelle van Dyne wrote:
> According to the ARM manual, when SSE=1 the data item must be sign
> extended.
> 
> Signed-off-by: Joelle van Dyne <j@getutm.app>
> ---
>   target/arm/hvf/hvf.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c
> index 0afd96018e..28886970c9 100644
> --- a/target/arm/hvf/hvf.c
> +++ b/target/arm/hvf/hvf.c
> @@ -1876,6 +1876,11 @@ static void hvf_sync_vtimer(CPUState *cpu)
>       }
>   }
>   
> +static inline uint64_t sign_extend(uint64_t value, uint32_t bits)
> +{
> +    return (uint64_t)((int64_t)(value << (64 - bits)) >> (64 - bits));
> +}

This is sextract64(value, 0, bits).

r~


      reply	other threads:[~2025-02-09 19:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-09  2:53 [PATCH] hvf: arm: sign extend when SSE=1 Joelle van Dyne
2025-02-09 19:19 ` Richard Henderson [this message]

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=96710e26-9cb3-43de-b739-a67670faa93e@linaro.org \
    --to=richard.henderson@linaro.org \
    --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).