aboutsummaryrefslogtreecommitdiff
path: root/target/ppc/translate_init.inc.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2019-08-26 19:00:13 -0700
committerDavid Gibson <david@gibson.dropbear.id.au>2019-08-29 09:46:07 +1000
commitcbc65a8f22b29680f30a2c86da36be4aedb88b60 (patch)
tree81d7385d098de5db41b659b5dd833fdeb8496502 /target/ppc/translate_init.inc.c
parentce03a193e1172ff7d4b3303ec7472dc29183db8c (diff)
downloadqemu-cbc65a8f22b29680f30a2c86da36be4aedb88b60.zip
qemu-cbc65a8f22b29680f30a2c86da36be4aedb88b60.tar.gz
qemu-cbc65a8f22b29680f30a2c86da36be4aedb88b60.tar.bz2
target/ppc: Set float_tininess_before_rounding at cpu reset
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>
Diffstat (limited to 'target/ppc/translate_init.inc.c')
-rw-r--r--target/ppc/translate_init.inc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/ppc/translate_init.inc.c b/target/ppc/translate_init.inc.c
index 4a21ed7..023138c 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];