Skip to content

Commit

Permalink
target/ppc: Set float_tininess_before_rounding at cpu reset
Browse files Browse the repository at this point in the history
As defined in Power 3.0 section 4.4.4 "Underflow Exception",
a tiny result is detected before rounding.

Fixes: https://bugs.launchpad.net/qemu/+bug/1841491
Reported-by: Paul Clarke <pc@us.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20190827020013.27154-1-richard.henderson@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
  • Loading branch information
rth7680 authored and dgibson committed Aug 28, 2019
1 parent ce03a19 commit cbc65a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions target/ppc/translate_init.inc.c
Expand Up @@ -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];

Expand Down

0 comments on commit cbc65a8

Please sign in to comment.