From patchwork Thu May 27 04:13:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 448823 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp160566jac; Wed, 26 May 2021 21:19:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMH8Lr+2sJuzstyoO1Ipq1iSdY7WKQSrVybRN65BPrdSSiqAwIzvPMaOEVhCAUcBOf96Tw X-Received: by 2002:a05:6e02:1c4c:: with SMTP id d12mr1408950ilg.161.1622089164402; Wed, 26 May 2021 21:19:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622089164; cv=none; d=google.com; s=arc-20160816; b=Dvt7jKGq1e1ptERs234mUaDRh+uKS61GlFNYpBrQs/IfuKW1AqddJVeJzsy9F7bQOD TMkvOsRhexx9dS0uQ+Y1a8zySMvaIOsnfz0npBoK0Z/SzxTdYeR6UDC2ssx+n8akmJUX ePF3UyCC7KBC0jY3ZMrvisC51FcJk0tB8G+cVietQ7nXYjdyJHrMQzP+nFQ4QAEKxCJc dkDTxpFYtSSWv4c71jFkQ1wMYmCbSVZ4WW+32XoH+M60G6yXpXTOeX6EJxUB4bOdQZlY gbpwPcKdAGSv6w3+sZTdts5lEQso+W+QbqhKiXeFXpaJS0O9erBzgTbDHGr9VhpnIkgQ QHhA== 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=prrVCPPqFq5mBd19RF3H8SGsVxMT7ZBmHrhUofi0h9k=; b=SbKbggdORLQ0ISaI+QRxihj3sb412fZxMXM/s4Q2nXlWw/XoewGiDZzvbTrw9aQ98f aR3S140Um5uhL5NYhJcWgZBzR4cBO3OTeNwb3fVz0/gmQ1Xtrbct0Gd+/ZctE/Bm/5kP j6g6UB4TqZzTg8p+MwcH2wjOQG6OMxqvGZuMRwoSfkegcmPnMkz/ouzsYQsYoq3F2Wtn ZC+9m3rJ+k711zvNhd4HuXQCR03xNTaKMHs9biHnMc7fZZqhwrsKgBWsvm7yTxNZezeu 7ilHuNOOcBRCWDiEDfi40/YcB4j5PFS8+cAzEvdbbsNEqWhJqrSmV/ZGRg7FLnlVpc3g rS3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nvO+VL5T; 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 k7si1296321jaq.89.2021.05.26.21.19.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 May 2021 21:19:24 -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=nvO+VL5T; 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]:53558 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lm7UR-0004Tu-RT for patch@linaro.org; Thu, 27 May 2021 00:19:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45080) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lm7PQ-0001Yz-TA for qemu-devel@nongnu.org; Thu, 27 May 2021 00:14:14 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:33610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lm7PO-0007Bs-8w for qemu-devel@nongnu.org; Thu, 27 May 2021 00:14:12 -0400 Received: by mail-pg1-x534.google.com with SMTP id i5so2759353pgm.0 for ; Wed, 26 May 2021 21:14:09 -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=prrVCPPqFq5mBd19RF3H8SGsVxMT7ZBmHrhUofi0h9k=; b=nvO+VL5TdeV4l/lVsc5SVfS6lED5u+mQiXi5Cl/f5Zy81rUQ7erxRU0sM5Yvs0wSk4 uuWuhBBNvUWfdL8NDajxnf2HdcxIyz5L1MLgHu1TPOSVKA6XJLmcqrmd4oCG0F5jMoak 4OfiAAkXk9cmrUgYGcLwOtQXeX6DC/7kvpyWxfHx923UPVAvSlp1E7zPmwKHNbs4t903 oFfKKCGFoO/T0uWlsamz1gzkkec19aZm7Mx4jyz8MwiXDAKQvkm2Rj895aj4ON20RsZS /7H+OuLP0Gl/RW2RFFDEQgvNpzZvdRauFyifrNXSn12FXLBXtt94kstH44dqJaA4Il0c DdaQ== 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=prrVCPPqFq5mBd19RF3H8SGsVxMT7ZBmHrhUofi0h9k=; b=MVsBmxPkJlciCYzfIzn2VVdMQfS2wiu5+lDlAGf2gTl3RT5JcMEvdFdxgsLh166eON EuAo+CdzbdwS4k2MKytEYC85UqfVm8flN8lC9SqQhySyoY82c4prjl7C7z6VmpZAWZpB u7GBoQMU45iz34s84NS5XfKP5UWomras/HAk/8e0S/V41ZQAYbxBzuDA0jKlj9eDPVxt RQ+1TRys9ovvTYDiQYLROKK+Xx1RfIYt/fMLn3c5nr+hvwKO5qY3plJCkfZ/snMrxa95 Ol3r9hSEA2/yYWuANzYCgF7O1gei7wY86BfEE2Xv+S4HJ6O1etaYR1TJxcaYx/aFZ89U iCGw== X-Gm-Message-State: AOAM532e8e4vyracev6Z+LXaUMt+/RtCHkR5xfVrnF/jLN+7n70c7GI/ UjQlVgGqQ/iUEyJMzKwjcxY0Y6DGLWugVw== X-Received: by 2002:a63:4b52:: with SMTP id k18mr1885959pgl.190.1622088848899; Wed, 26 May 2021 21:14:08 -0700 (PDT) Received: from localhost.localdomain (174-21-70-228.tukw.qwest.net. [174.21.70.228]) by smtp.gmail.com with ESMTPSA id s1sm605959pfc.6.2021.05.26.21.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 21:14:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 04/11] softfloat: Introduce float_flag_result_denormal Date: Wed, 26 May 2021 21:13:58 -0700 Message-Id: <20210527041405.391567-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210527041405.391567-1-richard.henderson@linaro.org> References: <20210527041405.391567-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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: alex.bennee@linaro.org, mmorrell@tachyum.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Create a new exception flag for reporting output denormals that are not flushed to zero. Signed-off-by: Richard Henderson --- include/fpu/softfloat-types.h | 3 ++- fpu/softfloat-parts.c.inc | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) -- 2.25.1 Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index 174100e50e..83632aa09f 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -151,6 +151,7 @@ enum { float_flag_inorm_denormal = 0x0020, /* denormal input, normalized */ float_flag_iflush_denormal = 0x0040, /* denormal input, flushed to zero */ float_flag_oflush_denormal = 0x0080, /* denormal result, flushed to zero */ + float_flag_result_denormal = 0x0100, /* denormal result, not flushed */ }; /* @@ -170,8 +171,8 @@ typedef enum __attribute__((__packed__)) { */ typedef struct float_status { + uint16_t float_exception_flags; FloatRoundMode float_rounding_mode; - uint8_t float_exception_flags; FloatX80RoundPrec floatx80_rounding_precision; bool tininess_before_rounding; /* should denormalised results go to zero and set the inexact flag? */ diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 16d4425419..a21fcec3e5 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -276,8 +276,12 @@ static void partsN(uncanon_normal)(FloatPartsN *p, float_status *s, if (is_tiny && (flags & float_flag_inexact)) { flags |= float_flag_underflow; } - if (exp == 0 && frac_eqz(p)) { - p->cls = float_class_zero; + if (exp == 0) { + if (frac_eqz(p)) { + p->cls = float_class_zero; + } else { + flags |= float_flag_result_denormal; + } } } p->exp = exp;