From patchwork Tue Aug 27 02:00:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172245 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp5142459ily; Mon, 26 Aug 2019 19:00:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqy7FYXaNPkc3H3jed3qbmNP623qi1dG3Pysq/q62Q4eGYznX26mTE8GZl/d5eRZeaErz4PT X-Received: by 2002:a50:b1a8:: with SMTP id m37mr21991885edd.81.1566871240140; Mon, 26 Aug 2019 19:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566871240; cv=none; d=google.com; s=arc-20160816; b=e4fw3tqCCD3p6cCyFTDTro5PRZGTSgDo+VaKKwbdjC+CHbHoQZSG5JEvY6vJNz1akC c8PBVfPqgv46iSOdXAlSZZSH3IbpblU5Bh+EwKYlBdZmJLrQYY6IXazlseVuRoVkF/Yk ihyslbZTezDkAdV6agODn6R4d0iY+hJK+SHpdnrIYCbvsDqVMrzFylQ0aYacDXu7QzxK UJYDCkeA/81uISsuJs5FBEIqAGYHdOAoWbZvhWk/0k0J7Bs7kGgAKlifsKfmPNjiugpP kCJ4i9rIhTkE0JGbg4+qdkoKejnJoYsxt0OXyNsd91WRwlaTjHslfMPNVdChiZk7/+N/ yQ9w== 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:message-id:date:to:from :dkim-signature; bh=bJA2+ktpjDLGHMwu4tIOVTroGCG/bmh52cf78i4dezA=; b=yHk7xvMnRrlqc0To5btPTYzcZnEB9yyQIXn8/WbCJKsS0sTtNFg0QbdH5DgXB9iJta LLBNsH2lZLrNQOQTmGwUN+pY6bv+bu3bbhqIuFob6VzPE77QLQkcgrDzASc5YYBLgB7n WLLhvEfZtjqyQu+2QgPOpPFqmSU0AVabPv46sVhtZ478At5ums4Dy5+47qbVdz9NODbL f0cxiYuyLeCqiS0Lup+/c6G2I/JF6FVLWKl/QAc7u6+tO0fiKMCHCO1gt+ISV2bSiWtb Dlo4IWe/py7XI/u0wa4vZII13VZNKCANWWDBHd5iiVMmzKIHAdky8trT489AaGPHEUm6 ixZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LEmWMpKa; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id c18si7484405ede.348.2019.08.26.19.00.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Aug 2019 19:00:40 -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=fail header.i=@linaro.org header.s=google header.b=LEmWMpKa; 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"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2Qml-0000w8-4L for patch@linaro.org; Mon, 26 Aug 2019 22:00:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46521) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2QmS-0000vv-6P for qemu-devel@nongnu.org; Mon, 26 Aug 2019 22:00:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2QmQ-0006yW-Ln for qemu-devel@nongnu.org; Mon, 26 Aug 2019 22:00:19 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:33609) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i2QmP-0006wL-Vy for qemu-devel@nongnu.org; Mon, 26 Aug 2019 22:00:18 -0400 Received: by mail-pg1-x543.google.com with SMTP id n190so11713091pgn.0 for ; Mon, 26 Aug 2019 19:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=bJA2+ktpjDLGHMwu4tIOVTroGCG/bmh52cf78i4dezA=; b=LEmWMpKaeOcDn1Ur7h7N84XHvdiogXzC5uTZrI+tE8Am/5l8uW5gNPg49VVj3JGngx h4j5z7JWVTvl7rl/zWUdNx8Vd8qVtwheQ1lV2UTfmSvpm0GcCjmRWBdIMd9Vkbw91JCr fjsrBnprytr9uxhUwHhoOH+ExBMq18i211Z1xLLSNhefIGKt6FqXQgbtHEY3K9eP8m3V mf/j1GlnVXEyG/f4pBftFqIDuHDo2dWA6FjqBy2dOFYfpu3WZIegn6aPsiNZzCGWOSd1 1XPby5Z+C509rGJXan4YvEG+UqGhKBDc79rqJ4VVLv9Lx3SbghhYmVRFpvcRF5sdrQBM H7tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bJA2+ktpjDLGHMwu4tIOVTroGCG/bmh52cf78i4dezA=; b=r5s92ADTjmBwCJar5S8xVX+DJkFu68vXn3mziwTiivLDtOQEQQak4+FALJV5yLmmot vyqdrSWhQiBV7pjONtWEmPF+6L2y1j635ianh4i0MsjWTZ+m//s2il66RuPJPseCf7X/ xmZqRrdm4vtY74g6fap9qGNJ5enDG/ArZZOXK6XkUis6OO4705VgjNS9LfondGU+z0az +X1n1xNGmm8kzXQ7ne0UrecXyemdXb+a17h3UPQgXVFR9UGXHz8eKObrxKFSofnaDoLm QFSC7Xq5J+A7zOgudyZkjvtDmPJSI+Rshsv1VohmBfzEgqUXAf8ev1nR0VztC1+KznXl d9Qg== X-Gm-Message-State: APjAAAVFp8GZ2t4N4eobe6IJ/WXgz3/+Uer4Uio49H/oMpkhfy+66dBc yYJci10HpKtWEb7FmSeuXmt/nTPkOhc= X-Received: by 2002:a63:1d4:: with SMTP id 203mr18925320pgb.441.1566871215850; Mon, 26 Aug 2019 19:00:15 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id s4sm653707pjp.15.2019.08.26.19.00.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 19:00:15 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 26 Aug 2019 19:00:13 -0700 Message-Id: <20190827020013.27154-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::543 Subject: [Qemu-devel] [PATCH] 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: qemu-ppc@nongnu.org, pc@us.ibm.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- target/ppc/translate_init.inc.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.17.1 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];