[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/21] target/openrisc: Explicitly set 2-NaN propagation rule
From: |
Peter Maydell |
Subject: |
[PATCH 19/21] target/openrisc: Explicitly set 2-NaN propagation rule |
Date: |
Fri, 25 Oct 2024 15:12:52 +0100 |
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>
---
target/openrisc/cpu.c | 6 ++++++
fpu/softfloat-specialize.c.inc | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c
index 6ec54ad7a6c..b96561d1f26 100644
--- a/target/openrisc/cpu.c
+++ b/target/openrisc/cpu.c
@@ -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;
diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc
index 40cbb1ab73b..ee5c73cad46 100644
--- a/fpu/softfloat-specialize.c.inc
+++ b/fpu/softfloat-specialize.c.inc
@@ -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;
--
2.34.1
- [PATCH 13/21] target/xtensa: Factor out calls to set_use_first_nan(), (continued)
- [PATCH 13/21] target/xtensa: Factor out calls to set_use_first_nan(), Peter Maydell, 2024/10/25
- [PATCH 12/21] target/sparc: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/10/25
- [PATCH 15/21] target/i386: Set 2-NaN propagation rule explicitly, Peter Maydell, 2024/10/25
- [PATCH 17/21] target/microblaze: Move setting of float rounding mode to reset, Peter Maydell, 2024/10/25
- [PATCH 19/21] target/openrisc: Explicitly set 2-NaN propagation rule,
Peter Maydell <=
- [PATCH 18/21] target/microblaze: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/10/25
- [PATCH 20/21] target/rx: Explicitly set 2-NaN propagation rule, Peter Maydell, 2024/10/25
- [PATCH 21/21] softfloat: Remove fallback rule from pickNaN(), Peter Maydell, 2024/10/25