From patchwork Mon Aug 26 16:54:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 172188 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp4609657ily; Mon, 26 Aug 2019 09:56:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTQ92x/tOSiKVEs6uhHLSSF1PWoHcSKAYHoWA53XcC3/RveoYegsxXeSI0q3F045VdbQwG X-Received: by 2002:ac8:281c:: with SMTP id 28mr18349286qtq.102.1566838606251; Mon, 26 Aug 2019 09:56:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566838606; cv=none; d=google.com; s=arc-20160816; b=MKH5J0ovOe70loIWVJ8AByxAwoybX19QYvc7fZ+iomdgNHqfLgU0g26GQrceDOkHkm hyFESjFjMvwFNiN+w0B+HWuVc/Ibw2ACgA3d8ZCYb+AYpgvLZK9aC2huBzICOq4flnNP +MxO77gFVlFMPQIZX2kP0GqZxTC+BdeNLpdGLrAlw03vNJOwV1ntmAyeTx4P+hXf9F9R vLIRVNp/PlcfD2jbdQ7EcjHL8wqxBUITyGtvKQ/YTxCU7V4M+AKCBT//EPkTrms5M3km asT/emT6f1JrQ075P5mC/rWKCKzcnzYSePf1eS19h5JLGhsIh3T1JToQ6KaGdgkjZF9J tcBg== 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:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=QBEV8mWos3eCOzNz0nMHx0iaJDhUfFvNFqhxEXTwuFQ=; b=R4SGmRjw5+js94oWavi5LQJgPrQIubssrLX/NXfiVzR0oTioUgBHt/91RHX4ZXO26g rzgP2iOgxhrZlK+vhsxXKmkQ9x/AJD8dFWdcjRfYgqUpMNCGnurIy0JYH9/ZiUuvJajj X85OLU7tdVtaE0TiK3MOz+vYin1ERLRBxSPK1mw2XOY77t5VzMP9+L3grH5VMmLotFIe UnmUkUzig/tbBs6vXLVqcXy3AEo9KPVOoNuc/kFkUu5MF2pJLYAadM/l/k+FXrhjBNi2 Tg71x5K2ui85HoicTMHOuONHVeBn3mwmxs6EMELShfCD/4G6n+igUt9hjEjHxjlkq/+v MnAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GVF3cbws; 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 a15si243580qkc.175.2019.08.26.09.56.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Aug 2019 09:56:46 -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=GVF3cbws; 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]:55960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2IIP-0004HG-O5 for patch@linaro.org; Mon, 26 Aug 2019 12:56:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43271) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2IGP-00031t-OQ for qemu-devel@nongnu.org; Mon, 26 Aug 2019 12:54:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2IGN-0004XC-T6 for qemu-devel@nongnu.org; Mon, 26 Aug 2019 12:54:41 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:33450) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i2IGN-0004W4-Nb for qemu-devel@nongnu.org; Mon, 26 Aug 2019 12:54:39 -0400 Received: by mail-pl1-x644.google.com with SMTP id go14so10306072plb.0 for ; Mon, 26 Aug 2019 09:54:39 -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:in-reply-to:references; bh=QBEV8mWos3eCOzNz0nMHx0iaJDhUfFvNFqhxEXTwuFQ=; b=GVF3cbwsj1YjsBVHVR/i5Fze9wS8ZiH/ipCMKni9MYkj7XCTF+t79idopSzvcQ5qi9 qgJP4cyxjsiWO+sDJ1akGXB769RUNXA34t2/r+Z9Bs4r1PzQ1WDADuZ+5n7JS6DlUOwj 8MS2eDLnRoGal6ER5bH4p/njEeAVA8YHuWT8ugFtWY07obO9X4MaUUz70ki0SkkaLNFo OMhXb6Tg/wrbVjg20T2x0RKeDC+ppzRB+dsHkJEb50sBD8YwxFrjYNQacNsq3BMqniKd h7RLcNq5gehlJ8hS0rz7KKMkeQ1qt8VKI/XDseh26udpbPK3yJ/pNL6CqhtMSmVvjjR7 ytuQ== 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:in-reply-to :references; bh=QBEV8mWos3eCOzNz0nMHx0iaJDhUfFvNFqhxEXTwuFQ=; b=MNUW0E5E5KBXIuWQLnGxQwlDgz2Ypi6RE8A/qOcmxLLLjpADQTRi00w5PUM8y6Bj7Q YEOVLs9Lqm6RRjCxiTn6jLftXOz3YcfsUl7Oam+nNFud0wR7KR48pAGMnByMfApOfD9u OBM3wimq6bAvlDGh1lc1K5/TpSXlFbhWiwkN3t5i/5HrBSdZektuePYqHu/ibxz9ftj6 bwd65ZTfPbfUTWmiqLdjgbImBb+bSGgatlvndfgRUrIp32C8LAsswjqrFchSnsJOeSgY zWWXxm8JninuMpq19EXkwXl48ya+rzfKLdzRuPysEY8GKNyS2saaotbYNYNp+oi4uiix Pp7w== X-Gm-Message-State: APjAAAX7vlSuPJkE3OwGw8sYjLLlkmxPBCTtJLX4kh1LqFwqNJ6/M7tF 46ugPuzaD1On2XA5DOsMp7TK6UkwYQU= X-Received: by 2002:a17:902:524:: with SMTP id 33mr20236875plf.27.1566838477930; Mon, 26 Aug 2019 09:54:37 -0700 (PDT) Received: from localhost.localdomain (97-113-7-119.tukw.qwest.net. [97.113.7.119]) by smtp.gmail.com with ESMTPSA id q8sm551374pje.2.2019.08.26.09.54.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 09:54:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 26 Aug 2019 09:54:34 -0700 Message-Id: <20190826165434.18403-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190826165434.18403-1-richard.henderson@linaro.org> References: <20190826165434.18403-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 Subject: [Qemu-devel] [PATCH 1/1] target/ppc: Fix do_float_check_status vs inexact 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" The underflow and inexact exceptions are not mutually exclusive. Check for both of them. Tidy the reset of FPSCR[FI]. Fixes: https://bugs.launchpad.net/bugs/1841442 Reported-by: Paul Clarke Signed-off-by: Richard Henderson --- target/ppc/fpu_helper.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) -- 2.17.1 Tested-by: Paul Clarke diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index 07bc9051b0..2e023c5204 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -630,19 +630,15 @@ static void do_float_check_status(CPUPPCState *env, uintptr_t raddr) { CPUState *cs = env_cpu(env); int status = get_float_exception_flags(&env->fp_status); - bool inexact_happened = false; if (status & float_flag_overflow) { float_overflow_excp(env); } else if (status & float_flag_underflow) { float_underflow_excp(env); - } else if (status & float_flag_inexact) { - float_inexact_excp(env); - inexact_happened = true; } - - /* if the inexact flag was not set */ - if (inexact_happened == false) { + if (status & float_flag_inexact) { + float_inexact_excp(env); + } else { env->fpscr &= ~(1 << FPSCR_FI); /* clear the FPSCR[FI] bit */ }