From patchwork Sun May 16 12:33:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 439856 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp260391jac; Sun, 16 May 2021 05:48:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8h0KIwiQgxOCMdU/wAs7+ZK9QzbjExdCziyldK8g3TCGeyFmyAvLKXuA1ErGi9A90VJNX X-Received: by 2002:a05:6e02:84:: with SMTP id l4mr38971436ilm.278.1621169302623; Sun, 16 May 2021 05:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621169302; cv=none; d=google.com; s=arc-20160816; b=Xrtou1XlEilHw9jjeFwyDW1ByIjAsq4HHM7tkEkzXoaUWfNVY3vfFAE4kkQ8ZOJyFT aVlxCZbnQfuJVbLPO6t1k0RUI87ZjzMD5QsoxRex02NFCJftorw18MO9ZhafXWtZcROy vfv36lZ1vLMe4UZrTv/kwr8LBYUDr3CNH7m4gAyT2wL6ue1zApgOO98zaB7n7Fl7/fi/ jAiiQ+0sfIo88miuIznlQjCN4zq0PO8u9GOdMckp0DsfSUiu72jhde32TmYaxmSH5+qo 1P19FT+P6xIdI3d0+hNOrhA428YS/lborIDlbHp6InJNzFJ4qFd8uiepMaOqIbFzvKmg zi+g== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=fk8y2yS7knqViGJ3bJXKmDCpU5b8/c3S/Dv6Z84fdLg=; b=K8/UI2wQuQkpAYV9gVkcAMrFzU2EAvDmFOXXLWCl0wqYd3Yc4Cd8bPgkFeDtiAvSHO KoHBhIkNPW/ScI5NV9zGzmtoRYnW+GPu/tx6aDMd1ipY4mU+0x+FVVImy4sXD6ICp+Q+ MuwOr2lBBjFzieIken1w7Ibs/VE9+Ynb9rZoTiJanPjqc1nlgtgN0UcKI92QeZUqeNuY il5lR8RWevGOjUA2AY/QH2kkmQ5xr4nxFNhagMA54ZvR9Vg79HwMeTdikX58lZll5a7x US7fN6gg9/7q1mFePwyb8azvqMczHHLUnsW0wfYYiYPkoldC2q/lI52R0pkCNaYNApkA d1ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="KPt/sMI/"; 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=pass (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 y18si13285626jak.36.2021.05.16.05.48.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 16 May 2021 05:48:22 -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=pass header.i=@linaro.org header.s=google header.b="KPt/sMI/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liGBy-0004k0-1B for patch@linaro.org; Sun, 16 May 2021 08:48:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1liFyw-0007PS-K3 for qemu-devel@nongnu.org; Sun, 16 May 2021 08:34:56 -0400 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:37609) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1liFyl-0007lj-V5 for qemu-devel@nongnu.org; Sun, 16 May 2021 08:34:50 -0400 Received: by mail-qk1-x72f.google.com with SMTP id i67so3308705qkc.4 for ; Sun, 16 May 2021 05:34:43 -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 :mime-version:content-transfer-encoding; bh=fk8y2yS7knqViGJ3bJXKmDCpU5b8/c3S/Dv6Z84fdLg=; b=KPt/sMI/b+t6yzUc0Z6fAgmnLdgLSLH2WQP4OLyEu+8yW2KDU7BBFVnO9cSVLqJDhp XlQMvFaf7j9Rx/2YRDsZgOTccIJK7WHsDMOTQ5SAw4ZZmzhbvT9uZNhPHFQQiN0JUtzM u6TNXORYi1Krs/RRQffIZmqKQy738g4dlxt/baz3B7mR/JVHU/y+uP9VkPlTwzD/8MRh At9nN3/Ymh99h3QX9dOtHBmPQdsmQYV6JhfPTytEWkaFF2TT6INL3PH4ZWVigaORAh/0 z4QIR7PfY380uMCujPewl2nGwaGP9aRuottl/TGGD+TfbHufDWWDVTkpem938KzwAuDl lcGg== 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:mime-version:content-transfer-encoding; bh=fk8y2yS7knqViGJ3bJXKmDCpU5b8/c3S/Dv6Z84fdLg=; b=lAJ8ckdZF0pwciO0ZOJC1bhw4Z52ObZtIFIuo4q04Af6OAKF0TbWyW8w6hwpnH+iyu fvYFxnTzUmun61bLObcXDAuQZ70YNRs6dxKFVAXbsNp7hfB6NMNj2Cqtx7mS26vQav/Q 07hS3U6XvdlvY9KDTCvypbWpkviRhCVZHKHZ+H5sL9gNFLFpPG1OTrRIHVoFA+/+a9EL xxgT2E89EiXEvfflX2F9BiPs4nHWGflhWz+Aw4myKwhYrVAL4oVx/X0T8Psq54fcLYmd sWnuaURxvvh7FDib7F6QlDCcEeef+2zMC7OlTUlW4OyBXoTXq6sMsGt7iDM5YE+AqTyr UcnQ== X-Gm-Message-State: AOAM533Ouv8Rky+3ZASTSbIN5uT2XJb/xrM0TOTFTIuNYH60UIxYPICX fih6EqdQkIdvllGnLeHxy/LXlQ5k1f0zYMeb5E8= X-Received: by 2002:a37:a0c9:: with SMTP id j192mr39305170qke.19.1621168483096; Sun, 16 May 2021 05:34:43 -0700 (PDT) Received: from localhost.localdomain (163.189-204-200.bestelclientes.com.mx. [189.204.200.163]) by smtp.gmail.com with ESMTPSA id s5sm8500553qkg.88.2021.05.16.05.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 May 2021 05:34:42 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 12/46] softfloat: fix return_nan vs default_nan_mode Date: Sun, 16 May 2021 07:33:57 -0500 Message-Id: <20210516123431.718318-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210516123431.718318-1-richard.henderson@linaro.org> References: <20210516123431.718318-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::72f; envelope-from=richard.henderson@linaro.org; helo=mail-qk1-x72f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: peter.maydell@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , David Hildenbrand Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Do not call parts_silence_nan when default_nan_mode is in effect. This will avoid an assert in a later patch. Reviewed-by: Alex Bennée Reviewed-by: David Hildenbrand Signed-off-by: Richard Henderson --- fpu/softfloat.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index b694e38522..6589f00b23 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -892,21 +892,16 @@ static float64 float64_round_pack_canonical(FloatParts p, float_status *s) static FloatParts return_nan(FloatParts a, float_status *s) { - switch (a.cls) { - case float_class_snan: + g_assert(is_nan(a.cls)); + if (is_snan(a.cls)) { float_raise(float_flag_invalid, s); - a = parts_silence_nan(a, s); - /* fall through */ - case float_class_qnan: - if (s->default_nan_mode) { - return parts_default_nan(s); + if (!s->default_nan_mode) { + return parts_silence_nan(a, s); } - break; - - default: - g_assert_not_reached(); + } else if (!s->default_nan_mode) { + return a; } - return a; + return parts_default_nan(s); } static FloatParts pick_nan(FloatParts a, FloatParts b, float_status *s)