public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
* [PATCH] target/arm/tcg/vfp_helper: Fix incorrect bit field deposition in rsqrte_f64
@ 2025-12-26  6:42 Li-Hang Lin
  2025-12-26 15:19 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Li-Hang Lin @ 2025-12-26  6:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, Li-Hang Lin

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.

Signed-off-by: Li-Hang Lin <lihang.lin@gmail.com>
---
 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);
-- 
2.52.0.351.gbe84eed79e-goog



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-03-22 14:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox