[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] target/ppc: Set float_tininess_before_rounding
From: |
Paul Clarke |
Subject: |
Re: [Qemu-devel] [PATCH] target/ppc: Set float_tininess_before_rounding at cpu reset |
Date: |
Mon, 26 Aug 2019 23:13:57 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 8/26/19 9:00 PM, Richard Henderson wrote:
> As defined in Power 3.0 section 4.4.4 "Underflow Exception",
> a tiny result is detected before rounding.
Responded in the bug:
https://bugs.launchpad.net/qemu/+bug/1841491/comments/3
In my testing, this works for "double", but not "float".
> Fixes: https://bugs.launchpad.net/qemu/+bug/1841491
> Reported-by: Paul Clarke <address@hidden>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> target/ppc/translate_init.inc.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
> index 4a21ed7289..023138c2f9 100644
> --- a/target/ppc/translate_init.inc.c
> +++ b/target/ppc/translate_init.inc.c
> @@ -10461,6 +10461,10 @@ static void ppc_cpu_reset(CPUState *s)
> s->exception_index = POWERPC_EXCP_NONE;
> env->error_code = 0;
>
> + /* tininess for underflow is detected before rounding */
> + set_float_detect_tininess(float_tininess_before_rounding,
> + &env->fp_status);
> +
> for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) {
> ppc_spr_t *spr = &env->spr_cb[i];
PC