From patchwork Thu Aug 29 06:08:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 172540 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1768941ily; Wed, 28 Aug 2019 23:16:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqysyZdjF4VleagBwL/ozsFBPSZrp5KxX/MqSSqt1vqv4KXlEbIQQnpZZgahwu+0VF1u1aXy X-Received: by 2002:aa7:cd17:: with SMTP id b23mr3360165edw.278.1567059369651; Wed, 28 Aug 2019 23:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567059369; cv=none; d=google.com; s=arc-20160816; b=FHa71xO3MM1Rsqly1xkdnZKEbNApAgk817xyZWB77p4ZSM/UYqZtQhYyJwCLWgW47h +GY2mZ3mn1D93bOze/Hcjn6JCwuEPF7tOjTBaQ1au1+vSnYlZ7CDOv/Q8eKikXYi49Bg J48ZSQW61rAeoR/HJmllaQs0XQX3FTCB47QjLoID7TNuWCb0t5gDz3YYHZau3DeMKs9A 7OTnB27Wjf9SE1wsUIk6UEg3cKmcCK7pPuLMQy6TtruVV4BQjRh+Sgx9vV13MDptMZbN ba/Tw9klujQNRmqk7tpcLlX0M6HfrWnzh9Tdxc+OC382wCHkBOwEtgA0wC8q+T58nY8G OcOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=UhEGB+tS2ZXcvwNMfXDIM8moy6ZrfzoPQPwArnxoooo=; b=F31NGngWU9dOm2RSgpWipJJ9EMZNm/pU0ZkuSyIdS4KRMHPkk1xRI97QjK1IzFB90b CuPjNJG/0q6CyM9eiGduncEGFFRizCmETpgrI40eOA4Rdg4PWGFcFvfhEBnjEKjhb3Og friVEdJUfuDacjziA9XP+GMN8UJMX/4JvL1cIK4w0FxaRcYJT8fTM6MeP8cCSzZUE9Kt HE4u80G1dl+BgL9DCnarrRfW5vDrIzXqHaeVymZbZ1/NDvAHLzmV783JOtT5ZY+EjdcS Z9/j2VV3MNZJdmKlsVWia2JP/fJjlpfRmvuDwpVdhwXo9XzD1NPjmHpfU5q13E7UHf0/ Q/Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=B42tK9uX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q37si681304edd.136.2019.08.28.23.16.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Aug 2019 23:16:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gibson.dropbear.id.au header.s=201602 header.b=B42tK9uX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:45706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3Dj6-0002mh-7V for patch@linaro.org; Thu, 29 Aug 2019 02:16:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35250) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i3Dc0-0004Cp-EE for qemu-devel@nongnu.org; Thu, 29 Aug 2019 02:08:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i3Dbx-0003fQ-Tx for qemu-devel@nongnu.org; Thu, 29 Aug 2019 02:08:48 -0400 Received: from ozlabs.org ([203.11.71.1]:43859) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1i3Dbw-0003bM-TG; Thu, 29 Aug 2019 02:08:45 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 46JscN2lN1z9sPT; Thu, 29 Aug 2019 16:08:36 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1567058916; bh=ZmTyhSQNa2ubW03k4r+Uwxw+siIMTkcvjhUgCIzzQfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B42tK9uXGCGQT+9Kk98kjwwfjEJ2IIbeK0kQvE+BbAr09ndT7BPMc/bWPNGoxU5Eb fDfAynJCgSN0cqkYKXkA5twfFp+RNimb8VOgnBYL3hoT01ct4P+KlbLv0TA7sogb94 q9LwSnTkrPkX5Q9HQSl0kd+l4lhB9HQhCU9x/T8c= From: David Gibson To: peter.maydell@linaro.org Date: Thu, 29 Aug 2019 16:08:19 +1000 Message-Id: <20190829060827.25731-12-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190829060827.25731-1-david@gibson.dropbear.id.au> References: <20190829060827.25731-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 11/19] target/ppc: Set float_tininess_before_rounding at cpu reset X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: lvivier@redhat.com, aik@ozlabs.ru, Richard Henderson , groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Paul Clarke , David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson 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 Signed-off-by: Richard Henderson Message-Id: <20190827020013.27154-1-richard.henderson@linaro.org> Signed-off-by: David Gibson --- target/ppc/translate_init.inc.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.21.0 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];