Commit 23ece2805f for qemu.org

commit 23ece2805f9a3f90f317aac1b49ee45783b57636
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Thu May 21 13:29:13 2026 +0100

    target/arm: Set correct fp flags for FLOGB when FPCR.AH = 1

    Our implementation of the FLOGB insn does the operations entirely
    in the helper function, without needing to use fpu functions.
    This means it needs to handle all the fp status flags itself.
    We aren't setting float_flag_input_denormal_used when we
    use (i.e. do not flush to zero) an input denormal, which means
    that FPCR.IDC isn't set when it should be for FPCR.AH=1.
    We missed this when we added float_flag_input_denormal_used
    and made the fpu/ code set it.

    Add the missing float_raise().

    Cc: qemu-stable@nongnu.org
    Fixes: d38a57a3f ("target/arm: Enable FEAT_AFP for '-cpu max'")
    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Message-id: 20260521122913.1565011-4-peter.maydell@linaro.org

diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c
index 179cbd74fb..d884ba474f 100644
--- a/target/arm/tcg/sve_helper.c
+++ b/target/arm/tcg/sve_helper.c
@@ -5036,6 +5036,7 @@ static int16_t do_float16_logb_as_int(float16 a, float_status *s)
         if (frac != 0) {
             if (!get_flush_inputs_to_zero(s)) {
                 /* denormal: bias - fractional_zeros */
+                float_raise(float_flag_input_denormal_used, s);
                 return -15 - clz32(frac);
             }
             /* flush to zero */
@@ -5064,6 +5065,7 @@ static int32_t do_float32_logb_as_int(float32 a, float_status *s)
         if (frac != 0) {
             if (!get_flush_inputs_to_zero(s)) {
                 /* denormal: bias - fractional_zeros */
+                float_raise(float_flag_input_denormal_used, s);
                 return -127 - clz32(frac);
             }
             /* flush to zero */
@@ -5092,6 +5094,7 @@ static int64_t do_float64_logb_as_int(float64 a, float_status *s)
         if (frac != 0) {
             if (!get_flush_inputs_to_zero(s)) {
                 /* denormal: bias - fractional_zeros */
+                float_raise(float_flag_input_denormal_used, s);
                 return -1023 - clz64(frac);
             }
             /* flush to zero */