target/openrisc: Explicitly set 2-NaN propagation rule
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 5 Nov 2024 10:09:57 +0000 (10:09 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 5 Nov 2024 10:09:57 +0000 (10:09 +0000)
Set the NaN propagation rule explicitly for the float_status word
used in the openrisc target.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20241025141254.2141506-20-peter.maydell@linaro.org

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

index 40cbb1ab73b5925142cca4dda649ec90e55b4c9a..ee5c73cad466f3439afca5193e7aa7edbce93db9 100644 (file)
@@ -407,7 +407,7 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls,
     || defined(TARGET_S390X) || defined(TARGET_PPC) || defined(TARGET_M68K) \
     || defined(TARGET_SPARC) || defined(TARGET_XTENSA) \
     || defined(TARGET_I386) || defined(TARGET_ALPHA) \
-    || defined(TARGET_MICROBLAZE)
+    || defined(TARGET_MICROBLAZE) || defined(TARGET_OPENRISC)
         g_assert_not_reached();
 #else
         rule = float_2nan_prop_x87;
index 6ec54ad7a6cf81a77b1e4e057021f7530641009f..b96561d1f265aa25006eba85455a2cd384a26703 100644 (file)
@@ -105,6 +105,12 @@ static void openrisc_cpu_reset_hold(Object *obj, ResetType type)
 
     set_float_detect_tininess(float_tininess_before_rounding,
                               &cpu->env.fp_status);
+    /*
+     * TODO: this is probably not the correct NaN propagation rule for
+     * this architecture.
+     */
+    set_float_2nan_prop_rule(float_2nan_prop_x87, &cpu->env.fp_status);
+
 
 #ifndef CONFIG_USER_ONLY
     cpu->env.picmr = 0x00000000;