From: Lin Li-Hang <lihang.lin@gmail.com>
To: mjt@tls.msk.ru
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH] target/arm/tcg/vfp_helper: Fix incorrect bit field deposition in rsqrte_f64
Date: Sun, 22 Mar 2026 22:37:21 +0800 [thread overview]
Message-ID: <CAPR+-WG1cDA0iqqKrxDpA0OB6h3iy1nxDCtoeFQmEOSqn9Yxmg@mail.gmail.com> (raw)
In-Reply-To: <35aa3161-0b34-4c0e-adee-975fb8cf24ba@tls.msk.ru>
[-- Attachment #1: Type: text/plain, Size: 1605 bytes --]
Hi mjt,
After discussing with Peter, I did further debugging.
The original code is harmless even with the wrong bit position placement.
My patch is not perfect and Peter suggested refactoring those snippets.
Cheers
On Sun, Mar 22, 2026 at 2:20 PM Michael Tokarev <mjt@tls.msk.ru> wrote:
> On 26.12.2025 09:42, Li-Hang Lin wrote:
> > Fix an error in rsqrte_f64() where the sign bit was being
> > placed incorrectly. Specifically, ensure f64_sign is deposited
> > into bit 63.
> >
> > Additionally, update the comments regarding the exponent (exp) bit
> > width to reflect the correct double-precision specifications.
>
> Ping? Or is this patch not needed anymore?
>
> Thanks,
>
> /mjt
>
> > target/arm/tcg/vfp_helper.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/target/arm/tcg/vfp_helper.c b/target/arm/tcg/vfp_helper.c
> > index e156e3774a..60188b2c7e 100644
> > --- a/target/arm/tcg/vfp_helper.c
> > +++ b/target/arm/tcg/vfp_helper.c
> > @@ -1078,8 +1078,8 @@ float64 HELPER(rsqrte_f64)(float64 input,
> float_status *s)
> >
> > f64_frac = recip_sqrt_estimate(&f64_exp, 3068, f64_frac, false);
> >
> > - /* result = sign : result_exp<4:0> : estimate<7:0> : Zeros(44) */
> > - val = deposit64(0, 61, 1, f64_sign);
> > + /* result = sign : result_exp<10:0> : estimate<7:0> : Zeros(44) */
> > + val = deposit64(0, 63, 1, f64_sign);
> > val = deposit64(val, 52, 11, f64_exp);
> > val = deposit64(val, 44, 8, extract64(f64_frac, 52 - 8, 8));
> > return make_float64(val);
>
>
[-- Attachment #2: Type: text/html, Size: 2282 bytes --]
prev parent reply other threads:[~2026-03-22 14:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-26 6:42 [PATCH] target/arm/tcg/vfp_helper: Fix incorrect bit field deposition in rsqrte_f64 Li-Hang Lin
2025-12-26 15:19 ` Philippe Mathieu-Daudé
2025-12-28 8:13 ` Michael Tokarev
2025-12-28 17:15 ` Peter Maydell
2025-12-29 4:19 ` Lin Li-Hang
2026-01-08 1:11 ` Lin Li-Hang
2026-01-12 14:36 ` Peter Maydell
2026-01-13 3:34 ` Lin Li-Hang
2026-03-22 6:20 ` Michael Tokarev
2026-03-22 14:37 ` Lin Li-Hang [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=CAPR+-WG1cDA0iqqKrxDpA0OB6h3iy1nxDCtoeFQmEOSqn9Yxmg@mail.gmail.com \
--to=lihang.lin@gmail.com \
--cc=mjt@tls.msk.ru \
--cc=peter.maydell@linaro.org \
--cc=philmd@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