[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for-10.0 13/25] target/hppa: Set FloatInfZeroNaNRule explicitly
From: |
Peter Maydell |
Subject: |
[PATCH for-10.0 13/25] target/hppa: Set FloatInfZeroNaNRule explicitly |
Date: |
Thu, 28 Nov 2024 10:42:58 +0000 |
Set the FloatInfZeroNaNRule explicitly for the HPPA target,
so we can remove the ifdef from pickNaNMulAdd().
As this is the last target to be converted to explicitly setting
the rule, we can remove the fallback code in pickNaNMulAdd()
entirely.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/hppa/fpu_helper.c | 2 ++
fpu/softfloat-specialize.c.inc | 13 +------------
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/target/hppa/fpu_helper.c b/target/hppa/fpu_helper.c
index 0e44074ba82..393cae33bf9 100644
--- a/target/hppa/fpu_helper.c
+++ b/target/hppa/fpu_helper.c
@@ -55,6 +55,8 @@ void HELPER(loaded_fr0)(CPUHPPAState *env)
* HPPA does note implement a CPU reset method at all...
*/
set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->fp_status);
+ /* For inf * 0 + NaN, return the input NaN */
+ set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status);
}
void cpu_hppa_loaded_fr0(CPUHPPAState *env)
diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc
index 05dec2fcb4c..3e4ec938b25 100644
--- a/fpu/softfloat-specialize.c.inc
+++ b/fpu/softfloat-specialize.c.inc
@@ -475,8 +475,6 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls,
static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_cls,
bool infzero, float_status *status)
{
- FloatInfZeroNaNRule rule = status->float_infzeronan_rule;
-
/*
* We guarantee not to require the target to tell us how to
* pick a NaN if we're always returning the default NaN.
@@ -485,21 +483,12 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass
b_cls, FloatClass c_cls,
*/
assert(!status->default_nan_mode);
- if (rule == float_infzeronan_none) {
- /*
- * Temporarily fall back to ifdef ladder
- */
-#if defined(TARGET_HPPA)
- rule = float_infzeronan_dnan_never;
-#endif
- }
-
if (infzero) {
/*
* Inf * 0 + NaN -- some implementations return the default NaN here,
* and some return the input NaN.
*/
- switch (rule) {
+ switch (status->float_infzeronan_rule) {
case float_infzeronan_dnan_never:
return 2;
case float_infzeronan_dnan_always:
--
2.34.1
- [PATCH for-10.0 04/25] tests/fp: Explicitly set inf-zero-nan rule, (continued)
- [PATCH for-10.0 04/25] tests/fp: Explicitly set inf-zero-nan rule, Peter Maydell, 2024/11/28
- [PATCH for-10.0 05/25] target/arm: Set FloatInfZeroNaNRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 06/25] target/s390: Set FloatInfZeroNaNRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 07/25] target/ppc: Set FloatInfZeroNaNRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 10/25] target/xtensa: Set FloatInfZeroNaNRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 14/25] softfloat: Allow runtime choice of NaN propagation for muladd, Peter Maydell, 2024/11/28
- [PATCH for-10.0 20/25] target/sparc: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 09/25] target/sparc: Set FloatInfZeroNaNRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 11/25] target/x86: Set FloatInfZeroNaNRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 08/25] target/mips: Set FloatInfZeroNaNRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 13/25] target/hppa: Set FloatInfZeroNaNRule explicitly,
Peter Maydell <=
- [PATCH for-10.0 15/25] tests/fp: Explicitly set 3-NaN propagation rule, Peter Maydell, 2024/11/28
- [PATCH for-10.0 19/25] target/s390x: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 18/25] target/ppc: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 16/25] target/arm: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 25/25] fpu: Remove use_first_nan field from float_status, Peter Maydell, 2024/11/28
- [PATCH for-10.0 23/25] target/i386: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 12/25] target/loongarch: Set FloatInfZeroNaNRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 24/25] target/hppa: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 17/25] target/loongarch: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/11/28
- [PATCH for-10.0 22/25] target/xtensa: Set Float3NaNPropRule explicitly, Peter Maydell, 2024/11/28