target/xtensa: Set FloatInfZeroNaNRule explicitly
authorPeter Maydell <peter.maydell@linaro.org>
Wed, 11 Dec 2024 15:30:55 +0000 (15:30 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Wed, 11 Dec 2024 15:30:55 +0000 (15:30 +0000)
Set the FloatInfZeroNaNRule explicitly for the xtensa target,
so we can remove the ifdef from pickNaNMulAdd().

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241202131347.498124-11-peter.maydell@linaro.org

fpu/softfloat-specialize.c.inc
target/xtensa/cpu.c

index 7e57e85348bcd383109b302d806f1f53f9379813..3062d19402dc9ea68c59640935bd4ac8d515ec1f 100644 (file)
@@ -489,7 +489,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_cls,
         /*
          * Temporarily fall back to ifdef ladder
          */
-#if defined(TARGET_XTENSA) || defined(TARGET_HPPA) || \
+#if defined(TARGET_HPPA) || \
     defined(TARGET_I386) || defined(TARGET_LOONGARCH)
         /*
          * For LoongArch systems that conform to IEEE754-2008, the (inf,zero,nan)
index 6f9039abaeedb73a42e31fe1ca0eb2a9cd5b66fc..3163b758235db80758585d00adf0ca4ae1f6c2e8 100644 (file)
@@ -133,6 +133,8 @@ static void xtensa_cpu_reset_hold(Object *obj, ResetType type)
     reset_mmu(env);
     cs->halted = env->runstall;
 #endif
+    /* For inf * 0 + NaN, return the input NaN */
+    set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status);
     set_no_signaling_nans(!dfpu, &env->fp_status);
     xtensa_use_first_nan(env, !dfpu);
 }