* [PATCH] target/sparc: don't set FSR_NVA when comparing unordered floats
@ 2025-04-25 9:35 Clément Chigot
2025-05-11 11:56 ` Mark Cave-Ayland
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Clément Chigot @ 2025-04-25 9:35 UTC (permalink / raw)
To: qemu-devel; +Cc: atar4qemu, mark.cave-ayland, Clément Chigot
FSR_NVA should be set when one of the operands is a signaling NaN or
when using FCMPEx instructions. But those cases are already handled
within check_ieee_exception or floatxx_compare functions.
Otherwise, it should be left untouched.
FTR, this was detected by inf-compare-[5678] tests within gcc
testsuites.
Signed-off-by: Clément Chigot <chigot@adacore.com>
---
target/sparc/fop_helper.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c
index c25097d07f..b57da7c9ea 100644
--- a/target/sparc/fop_helper.c
+++ b/target/sparc/fop_helper.c
@@ -446,7 +446,6 @@ static uint32_t finish_fcmp(CPUSPARCState *env, FloatRelation r, uintptr_t ra)
case float_relation_greater:
return 2;
case float_relation_unordered:
- env->fsr |= FSR_NVA;
return 3;
}
g_assert_not_reached();
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] target/sparc: don't set FSR_NVA when comparing unordered floats
2025-04-25 9:35 [PATCH] target/sparc: don't set FSR_NVA when comparing unordered floats Clément Chigot
@ 2025-05-11 11:56 ` Mark Cave-Ayland
2025-05-11 20:43 ` Richard Henderson
2025-05-27 19:22 ` Mark Cave-Ayland
2 siblings, 0 replies; 4+ messages in thread
From: Mark Cave-Ayland @ 2025-05-11 11:56 UTC (permalink / raw)
To: Clément Chigot, qemu-devel; +Cc: atar4qemu, Richard Henderson
On 25/04/2025 10:35, Clément Chigot wrote:
(added Richard on CC)
> FSR_NVA should be set when one of the operands is a signaling NaN or
> when using FCMPEx instructions. But those cases are already handled
> within check_ieee_exception or floatxx_compare functions.
> Otherwise, it should be left untouched.
>
> FTR, this was detected by inf-compare-[5678] tests within gcc
> testsuites.
>
> Signed-off-by: Clément Chigot <chigot@adacore.com>
> ---
> target/sparc/fop_helper.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c
> index c25097d07f..b57da7c9ea 100644
> --- a/target/sparc/fop_helper.c
> +++ b/target/sparc/fop_helper.c
> @@ -446,7 +446,6 @@ static uint32_t finish_fcmp(CPUSPARCState *env, FloatRelation r, uintptr_t ra)
> case float_relation_greater:
> return 2;
> case float_relation_unordered:
> - env->fsr |= FSR_NVA;
> return 3;
> }
> g_assert_not_reached();
I don't really use floating point in my SPARC images, but if Richard is happy then I
don't mind giving:
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
ATB,
Mark.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target/sparc: don't set FSR_NVA when comparing unordered floats
2025-04-25 9:35 [PATCH] target/sparc: don't set FSR_NVA when comparing unordered floats Clément Chigot
2025-05-11 11:56 ` Mark Cave-Ayland
@ 2025-05-11 20:43 ` Richard Henderson
2025-05-27 19:22 ` Mark Cave-Ayland
2 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2025-05-11 20:43 UTC (permalink / raw)
To: qemu-devel
On 4/25/25 02:35, Clément Chigot wrote:
> FSR_NVA should be set when one of the operands is a signaling NaN or
> when using FCMPEx instructions. But those cases are already handled
> within check_ieee_exception or floatxx_compare functions.
> Otherwise, it should be left untouched.
>
> FTR, this was detected by inf-compare-[5678] tests within gcc
> testsuites.
>
> Signed-off-by: Clément Chigot <chigot@adacore.com>
> ---
> target/sparc/fop_helper.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c
> index c25097d07f..b57da7c9ea 100644
> --- a/target/sparc/fop_helper.c
> +++ b/target/sparc/fop_helper.c
> @@ -446,7 +446,6 @@ static uint32_t finish_fcmp(CPUSPARCState *env, FloatRelation r, uintptr_t ra)
> case float_relation_greater:
> return 2;
> case float_relation_unordered:
> - env->fsr |= FSR_NVA;
> return 3;
> }
> g_assert_not_reached();
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] target/sparc: don't set FSR_NVA when comparing unordered floats
2025-04-25 9:35 [PATCH] target/sparc: don't set FSR_NVA when comparing unordered floats Clément Chigot
2025-05-11 11:56 ` Mark Cave-Ayland
2025-05-11 20:43 ` Richard Henderson
@ 2025-05-27 19:22 ` Mark Cave-Ayland
2 siblings, 0 replies; 4+ messages in thread
From: Mark Cave-Ayland @ 2025-05-27 19:22 UTC (permalink / raw)
To: Clément Chigot, qemu-devel; +Cc: atar4qemu
On 25/04/2025 10:35, Clément Chigot wrote:
> FSR_NVA should be set when one of the operands is a signaling NaN or
> when using FCMPEx instructions. But those cases are already handled
> within check_ieee_exception or floatxx_compare functions.
> Otherwise, it should be left untouched.
>
> FTR, this was detected by inf-compare-[5678] tests within gcc
> testsuites.
>
> Signed-off-by: Clément Chigot <chigot@adacore.com>
> ---
> target/sparc/fop_helper.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/target/sparc/fop_helper.c b/target/sparc/fop_helper.c
> index c25097d07f..b57da7c9ea 100644
> --- a/target/sparc/fop_helper.c
> +++ b/target/sparc/fop_helper.c
> @@ -446,7 +446,6 @@ static uint32_t finish_fcmp(CPUSPARCState *env, FloatRelation r, uintptr_t ra)
> case float_relation_greater:
> return 2;
> case float_relation_unordered:
> - env->fsr |= FSR_NVA;
> return 3;
> }
> g_assert_not_reached();
Thanks! I've added Richard's R-B and applied this to my qemu-sparc branch.
ATB,
Mark.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-05-27 19:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25 9:35 [PATCH] target/sparc: don't set FSR_NVA when comparing unordered floats Clément Chigot
2025-05-11 11:56 ` Mark Cave-Ayland
2025-05-11 20:43 ` Richard Henderson
2025-05-27 19:22 ` Mark Cave-Ayland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).