From patchwork Mon Mar 5 08:41:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Richard W.M. Jones" X-Patchwork-Id: 10258377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3A99E60211 for ; Mon, 5 Mar 2018 08:43:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2674828975 for ; Mon, 5 Mar 2018 08:43:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B0892898B; Mon, 5 Mar 2018 08:43:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 85C3428975 for ; Mon, 5 Mar 2018 08:42:59 +0000 (UTC) Received: from localhost ([::1]:47846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eslhy-00011C-R2 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 05 Mar 2018 03:42:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eslgM-0008CY-8E for qemu-devel@nongnu.org; Mon, 05 Mar 2018 03:41:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eslgJ-0007F4-1U for qemu-devel@nongnu.org; Mon, 05 Mar 2018 03:41:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54756) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eslgI-0007EW-Qb for qemu-devel@nongnu.org; Mon, 05 Mar 2018 03:41:14 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6AD513B562; Mon, 5 Mar 2018 08:41:13 +0000 (UTC) Received: from localhost (ovpn-116-44.ams2.redhat.com [10.36.116.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id C86BC5C8AA; Mon, 5 Mar 2018 08:41:12 +0000 (UTC) Date: Mon, 5 Mar 2018 08:41:11 +0000 From: "Richard W.M. Jones" To: Michael Clark Message-ID: <20180305084111.GM2450@redhat.com> References: <1519998711-73430-1-git-send-email-mjc@sifive.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1519998711-73430-1-git-send-email-mjc@sifive.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 05 Mar 2018 08:41:13 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH v8 00/23] RISC-V QEMU Port Submission X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastian Koppelmann , Palmer Dabbelt , qemu-devel@nongnu.org, Sagar Karandikar , RISC-V Patches Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The attached patch is also needed to avoid crashes during various math-heavy test suites. Rich. Reviewed-by: Alex Bennée Signed-off-by: Michael Clark diff --git a/fpu/softfloat.c b/fpu/softfloat.c index e7fb0d357a..1da1db377e 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -1342,6 +1342,8 @@ static int64_t round_to_int_and_pack(FloatParts in, int rmode, switch (p.cls) { case float_class_snan: case float_class_qnan: + case float_class_dnan: + case float_class_msnan: return max; case float_class_inf: return p.sign ? min : max; @@ -1430,6 +1432,8 @@ static uint64_t round_to_uint_and_pack(FloatParts in, int rmode, uint64_t max, switch (p.cls) { case float_class_snan: case float_class_qnan: + case float_class_dnan: + case float_class_msnan: s->float_exception_flags = orig_flags | float_flag_invalid; return max; case float_class_inf: