From nobody Mon May 25 20:37:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192294; cv=none; d=zohomail.com; s=zohoarc; b=av9MLhYZcDEnAeYdhuORdSclXiMfi2sfeYsQCyBFOeUPdWDwfUSzfd3Q7zsAif/rlt8gc5dahvqt0WI2FGwjbhDj1sBcFcvvRSeiPWRzGvj34JIVYvTrivHHgWju5rUMC1OHu/v673FwFDJ1AHTu65w/2G383IJjuzHmrwePey4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192294; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=0l0OBvb0V3tTyoz3zrbfooAbsVRfx1OHt7vq70bkBfA=; b=B+F7fZPJo5H2icz8Fy51tV4Mt03Ymw5R2nRvJWz4/EmT/5BBHD6ptimrbh3/J2zo2foX66irVfjlxw/fhj1DciAyRcohbIjHVQJzbb5Rj2z87NiHLTSXYjik5T0OmDim3ko+zdozS1PATo8je9+/gB9nz5+BhG8JrgaaxKmLtjE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192294358537.2815007775663; Thu, 7 May 2026 15:18:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL725-0000nn-Jz; Thu, 07 May 2026 18:17:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL723-0000n4-EL for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:23 -0400 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL721-00039I-Q5 for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:23 -0400 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-4350cd5b97fso752206fac.0 for ; Thu, 07 May 2026 15:17:21 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192240; x=1778797040; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=0l0OBvb0V3tTyoz3zrbfooAbsVRfx1OHt7vq70bkBfA=; b=IQTzg5RjEPQ6hRIrLbd6l3f/kJOdKZU+YrjbdSrF4i8xnURw7KUm4v6zobBgCeWXRA o4YJffydvRVsNNuqc9tt2kDeaOBNi54dN6o18HPuoC8FA1CNHscbK+DWNTvlZ4qnwVp1 WhQiVuYcxdLm1iPkz5BCud+vdFc4+zhDi/mFXfl0qBBLMca87uP1mgZYeBtlhl16e+Ji sF+mjHTCzWPmsOFpIUJi70Md5wnQi8IsfWqFUugSFeadOPpjqt3b1MmiYhNVnxqygO2I u1mGClhPkL6ZtUn6u62aypJZZUfjypouNvE1I46HP6CqgcQFmyLNdQG+sVfU4AlALHKp FPOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192240; x=1778797040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=0l0OBvb0V3tTyoz3zrbfooAbsVRfx1OHt7vq70bkBfA=; b=i34MkfgF5MOTx13i28BzENKL2c7UJk7rrpYYWZ45RJdAonqea+nPq4QuZnwRQZDz4X wiVeGd3VivIXleOeOf9XCkhxWHhenTM0AU3LmNLDq3WQo/wzLvq30T8mCzWym5I2fd22 CGIp3g/MXUL2pQxqk4fAa+rhlgk/poQVONIUUUYGpp8Lpq1HMDzt7djMzRD8FyM+b8Bb r0xHGmcuT5/2eLvRnxP547d8Og/F6khxsqhW1TcHJEyx/uNNph8nvfL2UmyuwA8U77gX 1ud0CzSeGr3eG1wj0eMYxCrUvHleSOJBcB1E9BOM6Jd+L/9+F2IRlujZDWCD+FdqaTD+ Au7A== X-Gm-Message-State: AOJu0Ywx11QWkXHdr+HCyg6O2oflf9/AFfagfxigqoIx8t5hEDB+mrJq IftAoS3re1SxNxeH1JkZWNu522LajJQUQmJ5iZDJSapJci0mg9lFJ7HD/nMnqF/J44wfv2kV10V cWXnJ X-Gm-Gg: AeBDieu3l69cBkCg58zOiBA2C3b5qp3pZwvyCkmsB/err4E5n1rKS3vwqw9TkpNQ+du BQ6fVj7QxGmXl8fOaiWlaFMx93WNDmsmaxUwxhc2BTLqRButJLPUbRPwByjDXgM8EnmtV6axHlZ ry7UnHB+BO5KicwN1x5lj3GGZbZZnzprXrbCbBE2rZvvS+h+jHw2nLmYKWI+6PH9r9c1PjOJPKU TyhjxU7B02aFvsTk/erlyBKstgJKwBTUanY2kBab6BpqcffLODTQrA/fxrpGZ+oLnWC/Xf46vnB S5LejNHYCE0DvuxK4wq5WjDJe4f2kn7ojWQwtcpxqScy18XIGLy/yjNYTI8rfM+0rXr5egfiGfj 5wP5VGQllRssj8R8VE1RRBjEFNBalew7kDQN/z4lDzt3VDGr0U3A7NbN+XdczVMrG3wgLjr2BQ4 8ouDjgmMRdHWatp4qZyd5ZhGb1Vj6nG7PnehTlfvZUY8Zh/g== X-Received: by 2002:a05:6870:d109:b0:41c:25b1:930f with SMTP id 586e51a60fabf-434f65f3d0amr6883048fac.19.1778192240317; Thu, 07 May 2026 15:17:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 01/18] target/alpha: Remove CONFIG_SOFTFLOAT_INLINE Date: Thu, 7 May 2026 17:17:00 -0500 Message-ID: <20260507221717.486023-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2c; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2c.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192295969158500 Content-Type: text/plain; charset="utf-8" Don't peek into float_status internals. Fix the helper calls that were missing an argument. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/alpha/translate.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index d2d1467a81..c66e3f9c14 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -34,7 +34,6 @@ #undef HELPER_H =20 #undef ALPHA_DEBUG_DISAS -#define CONFIG_SOFTFLOAT_INLINE =20 #ifdef ALPHA_DEBUG_DISAS # define LOG_DISAS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__) @@ -578,15 +577,7 @@ static void gen_qual_roundmode(DisasContext *ctx, int = fn11) break; } =20 -#if defined(CONFIG_SOFTFLOAT_INLINE) - /* ??? The "fpu/softfloat.h" interface is to call set_float_rounding_m= ode. - With CONFIG_SOFTFLOAT that expands to an out-of-line call that just - sets the one field. */ - tcg_gen_st8_i32(tmp, tcg_env, - offsetof(CPUAlphaState, fp_status.float_rounding_mode)= ); -#else - gen_helper_setroundmode(tmp); -#endif + gen_helper_setroundmode(tcg_env, tmp); } =20 static void gen_qual_flushzero(DisasContext *ctx, int fn11) @@ -609,12 +600,7 @@ static void gen_qual_flushzero(DisasContext *ctx, int = fn11) tcg_gen_movi_i32(tmp, 1); } =20 -#if defined(CONFIG_SOFTFLOAT_INLINE) - tcg_gen_st8_i32(tmp, tcg_env, - offsetof(CPUAlphaState, fp_status.flush_to_zero)); -#else - gen_helper_setflushzero(tmp); -#endif + gen_helper_setflushzero(tcg_env, tmp); } =20 static TCGv_i64 gen_ieee_input(DisasContext *ctx, int reg, int fn11, int i= s_cmp) --=20 2.43.0 From nobody Mon May 25 20:37:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192327; cv=none; d=zohomail.com; s=zohoarc; b=MtCcu5RvxNzNY3u7Eto6D6LvjDaxPlTtcon3edFb2MNkVS7Nxmc54xM0uDU/qrqHAnrHSRcD9mFef4UJIzCwq4rz+bM3D4CXTUax4UtVhAkKY7+uSe6Dm9KRxFh10u7caq+KBX8UeC3pW46H+o2FepS9GG4mmvi07io5lgHlfR4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192327; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=/+31lNyXueXDBAFm1O2dQftBU8iJ7a4LsUCFtAoHuwI=; b=GD3Av24GlmQtsl1AHfQMm8ecGnj+0t2ImeN9trvxzVTRwf3YhoRfkJyos5lMjYh+VhTsoYpH7kNwtNVw9d0DtkQN2IPGHDIYIaRb/ApO6FO5w+7OlCjXGFWYurwNb2duGs2VKCVbvVit0TSgLb6JQl29rxQs7Flo3p4tVD39QCY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192327901680.8835060136427; Thu, 7 May 2026 15:18:47 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL726-0000o9-5J; Thu, 07 May 2026 18:17:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL725-0000nc-7T for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:25 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL723-00039T-Fp for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:24 -0400 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-479f7e75a6bso558452b6e.2 for ; Thu, 07 May 2026 15:17:22 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192242; x=1778797042; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/+31lNyXueXDBAFm1O2dQftBU8iJ7a4LsUCFtAoHuwI=; b=J5sdyAa6VuV+Y7n/I8rO1vzUd2VOneQeQ8/DH6jN6vKRvR7074FOJ/W7eykGj01UuE 1vmDJK+VGDzKDfUeh5AgniepwCWMG8QOUxhXlD6u61ABl8m1nBGX/21VHY7Yte4RcJ6/ z7pXYrS7X4FFKN+tAWtqCxcAO1wzOK02yGzMk7+4M+LVFGjNjWy8u/wM7B5hITAWy5Ss MxSXyXNlwYwp+fdjnZ6rt7DBs0Apu5NjsIbC3gRSkB1emg4DZapY+Xk3PLyd9Gjmsxrq uCuagRUJ9Ddm/9GtSJKztyZ4cuWECtxPEB4xCIJrweahENHkrB/CfTj4c+9Re4QOsqFS /7eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192242; x=1778797042; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=/+31lNyXueXDBAFm1O2dQftBU8iJ7a4LsUCFtAoHuwI=; b=PyBg+Hgv2A9OMYjE/nEmg/9a1JWj3fSwqf+nxFO7uJNIklTdihF4qxrn9o5TpYnlSZ N49vjSzYWuPrRi/AWB8iUlkMz2qmgQp0ybjKYFVbBB5xQDedSq4Kp+5iZLJj54lWjgn2 WKZ2klp7eXsTz2hh3OldZEkfMN4cfzs7HTSF6vH7F5jEp1MnmSg94jKOw7NMaaSmsl0w ZDMjB87Q8C+9vc9S6a6JWmvUMb45IcOKIxpAcmN0pEwS8Mq/dgho1rcPe2++IjadyzpI fp09+mdnKsrtm8BKNzwH8ch+XPPmjoaZzBfFBk15vn4Bujk3GfqjnRDcLYtx2yDzQK3S BEiw== X-Gm-Message-State: AOJu0YyrR5iZzLmsnTFgeNml62KCK17hKC3zVlzkBDE3QxRirxZaA5B6 lAJofB/O9Oh84VkBJvlkgb4/KnTcrwOsYG7uGO/QoYMROQELY4pPmlBk4sBUksuaSNUizH/QKmZ pXuZ6 X-Gm-Gg: AeBDievt4uv4Cp+u+vKSeE4Fuw93GTlC/kR8aqze4palylajkvuFrOAjlaWqhu2iO1w ihkB8toL5+5IuF52W8kMioWlHPzRY163jPO0kKnZCBV3cXq6Qdrl8wtP48xBo7HUtbi3ERY2xGl V9sDp+qmAUKO1gILoJ5pm9OaFlTTBEIOu4jwysFM2kWhz152Z5FAd9ZLeiyTI6SMx+d3EQeNCWh e4ZHVdEo/MFeYl6J/RbJhH1ouKfKafpIodpkUuY5qpKOay8c3mbr+I6aCo3ND0fGuotTxizu3K+ 9JJ4SG6/9z7lCJxcljYYz7NQPZsAkB7jnJDJkIuacO9f1YVio8zyO7q6v+mWEETZYB+3xTyFPzo XuMyYeh1RSgyQ0TMCfc06CG0HOdg6GqiXIuor5qslt4qDshCF/r37IzfaTYA3ZJfPNaE93siZOZ mw+8L2WiwsAgJ131e59lrIQsD6qp1JwcjWdqVqFT0wzX6AeYTSZd4wFuBi X-Received: by 2002:a05:6808:2382:b0:46a:6d33:65a8 with SMTP id 5614622812f47-480424ca04emr5988873b6e.32.1778192241700; Thu, 07 May 2026 15:17:21 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 02/18] fpu: Introduce FloatExceptionFlags Date: Thu, 7 May 2026 17:17:01 -0500 Message-ID: <20260507221717.486023-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192329744154100 Content-Type: text/plain; charset="utf-8" We have, in the past, used any of uint8_t, uint16_t or int to hold the set of exception flags. Use a typedef instead. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat-helpers.h | 6 ++++-- include/fpu/softfloat-types.h | 4 +++- include/fpu/softfloat.h | 2 +- fpu/softfloat.c | 2 +- fpu/softfloat-parts.c.inc | 7 ++++--- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helper= s.h index 90862f5cd2..745a49f07a 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -64,7 +64,8 @@ static inline void set_float_rounding_mode(FloatRoundMode= val, status->float_rounding_mode =3D val; } =20 -static inline void set_float_exception_flags(int val, float_status *status) +static inline void +set_float_exception_flags(FloatExceptionFlags val, float_status *status) { status->float_exception_flags =3D val; } @@ -146,7 +147,8 @@ static inline FloatRoundMode get_float_rounding_mode(co= nst float_status *status) return status->float_rounding_mode; } =20 -static inline int get_float_exception_flags(const float_status *status) +static inline FloatExceptionFlags +get_float_exception_flags(const float_status *status) { return status->float_exception_flags; } diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index ead146c22d..5048faa76f 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -181,6 +181,8 @@ enum { float_flag_input_denormal_used =3D 0x4000, }; =20 +typedef uint16_t FloatExceptionFlags; + /* * Rounding precision for floatx80. */ @@ -385,7 +387,7 @@ typedef enum __attribute__((__packed__)) { */ =20 typedef struct float_status { - uint16_t float_exception_flags; + FloatExceptionFlags float_exception_flags; FloatRoundMode float_rounding_mode; FloatX80RoundPrec floatx80_rounding_precision; FloatX80Behaviour floatx80_behaviour; diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 1580d956d5..4ae4ddc799 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -101,7 +101,7 @@ typedef enum { | Routine to raise any or all of the software IEC/IEEE floating-point | exception flags. *-------------------------------------------------------------------------= ---*/ -static inline void float_raise(uint16_t flags, float_status *status) +static inline void float_raise(FloatExceptionFlags flags, float_status *st= atus) { status->float_exception_flags |=3D flags; } diff --git a/fpu/softfloat.c b/fpu/softfloat.c index a6ab3ee0f8..9fc0b83cd1 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -2964,7 +2964,7 @@ static int64_t float128_to_int64_scalbn(float128 a, F= loatRoundMode rmode, static Int128 float128_to_int128_scalbn(float128 a, FloatRoundMode rmode, int scale, float_status *s) { - int flags =3D 0; + FloatExceptionFlags flags =3D 0; Int128 r; FloatParts128 p =3D float128_unpack_canonical(a, s); =20 diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 789a41d24e..8253d480f5 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -297,7 +297,8 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, const uint64_t roundeven_mask =3D round_mask | frac_lsb; uint64_t inc; bool overflow_norm =3D saturate; - int exp, flags =3D 0; + int exp; + FloatExceptionFlags flags =3D 0; =20 switch (s->float_rounding_mode) { case float_round_nearest_even_max: @@ -1265,7 +1266,7 @@ static int64_t partsN(float_to_sint)(FloatPartsN *p, = FloatRoundMode rmode, int scale, int64_t min, int64_t max, float_status *s) { - int flags =3D 0; + FloatExceptionFlags flags =3D 0; uint64_t r; =20 switch (p->cls) { @@ -1333,7 +1334,7 @@ static int64_t partsN(float_to_sint)(FloatPartsN *p, = FloatRoundMode rmode, static uint64_t partsN(float_to_uint)(FloatPartsN *p, FloatRoundMode rmode, int scale, uint64_t max, float_statu= s *s) { - int flags =3D 0; + FloatExceptionFlags flags =3D 0; uint64_t r; =20 switch (p->cls) { --=20 2.43.0 From nobody Mon May 25 20:37:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192322; cv=none; d=zohomail.com; s=zohoarc; b=KRylPPZKdv6OsqlDZ8MCFpClWaodGn8Isg4OhrhOytFQI3EvGBKHWfZqFmbg5A7SY+ed6CM5/RtUI02/JS+JSFL126f0YW3+vPvNQt+i4wyOBZhFjElWlBcZl/KbSEiSKdWyjUVzAPXatGHV2oWI/zKMHeQnyHwlX91LfKzEXps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192322; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=h5saXKeJ4sC7voQ1+q7rH48NkObrAzcO/bR1XGYyQi0=; b=LsTPbeacAGOuDs7TdQFBlkdKvr+lGQIuNlWZ/GY1w2q6pWQWc2rhxYHENOWzI8UpmvwKtZvk52bOIe4OqNH80q5UVwbBfOIfDCZfpHFSxq/5Q/y6qcTn07rgeY7wzFygTr5gcX6PRKSafl5J3hb2XiRfLlNrts7eIWV2+t6lY+A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192322887567.1822806227939; Thu, 7 May 2026 15:18:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL727-0000oR-IS; Thu, 07 May 2026 18:17:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL725-0000ne-BA for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:25 -0400 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL723-00039c-Os for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:25 -0400 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-47cacb4ed99so840419b6e.1 for ; Thu, 07 May 2026 15:17:23 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192242; x=1778797042; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=h5saXKeJ4sC7voQ1+q7rH48NkObrAzcO/bR1XGYyQi0=; b=pbV0yZ2CHymXKAA5TPWtzfzlw8peTbox4tdqS1SVdjxZZkb5csKdDgr0b6y841LzkK S3y2DR+RHkx0l054sZ/CNiYgQraRV32OJIs1WnRYdjpDzgYU8WDo9Y2IGjJIolSLLA41 Gl0L4ZWnWcIqbI9CgVL5Tp9RpqdHAzNFfG+qcBKKeYsnjwVL5QK9LCKlgcUl4laYWaBw kpvkm9x1wyCe1rCDPz/BzjswDQ7USGFRCzSDe8Lwp5ZhAVSlKgmGavJEewFH0ymGttMd FcJrpK9INKDS1B7CfqXxqg3RLumbC+0AxI0FO08ThIMD6zMihPj6IX2nl0EPpzFRujy+ gnZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192242; x=1778797042; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=h5saXKeJ4sC7voQ1+q7rH48NkObrAzcO/bR1XGYyQi0=; b=MiPAwLcy1gk5kY7Bv4w+GIZI0O1dZqEdDVWm/60gj63aWKPXIGhQ/cb0rnMT1jPB4P T4ch1ccYUOGjtbRgwhZUWUbGvuuWCuXnu9Y3QerHG66tPT04l1AS2AqmBN7dnVNGoCCy kd4pnZwnDDCsWXR96hjZZDdJZ1h/ocdxtfPs/bsSTPKalYJ/tl23LHBOgwgbZvVl2Yy6 edJpjrPf0hy/9fIFcQYsVjyR2a0glFCXEqNPMibQCpYJ/LBqzvvTD5bmsNQ+0u4EXgQR Rz91sfsSMeFuUO3ONDFIPVyx2jNpFiAyCyK9VBPkUvPbgJrVZsMMzX9g8jVI/+U8913Y NOFQ== X-Gm-Message-State: AOJu0YxaNBVdoyTPUq3PKqIu09Nr14MrDoSaEiSVsRZXbuomFP4QivPT 0QP51s2lMHh85azGRBNtGP6iadZW5//8Ku+jK15zt80vr+zhm0T6P30y0BOh0CGxeTEyoFZmwfc KOzDM X-Gm-Gg: AeBDiesF43DPMjjLX021zca/GnI4dWbv/aHpkJ/EI+GytSYLKsub+sjjb1Nu5fWGher NzZqtE29GIKzDmwwluTaHZjZ5mVnshryjNA9WbKsQS6C3jhZr53EcIpsqbEj6Vt9nv2s0u5l9M7 LK9u/MTfcZJMjsucA3uWCrhEk9wq1k1IX5yCGymZSuMUtIpr+lTIPV8F7Y++vyJ/+1Ml/e0uOMC qUb4fWX1yemBT/GUs8NJWE0WVNmXGxwfgfCbDvXlrqbXoXf6zYIjGMBg+J9Z58r01VJkVwNxo2K QyzFI3OpEhRiWi1iz/FUSXZRdClrO75DdDP0b2oEvGlSf9ekrGyn5DmzFMmp1KHWu2m4mgQJmf6 JmGWxXiYWnDY/QNAWOi5RyiAs9UpX/+PWEod7VunU3RwdVDReSs07PVCcT1IxV7G498tTtI+6Wp JKjsiUJI3EzJo4HPPTzknu7D9YYy3N987ysHnIjQ+2WlbgEQ== X-Received: by 2002:a05:6808:1211:b0:467:eccb:b788 with SMTP id 5614622812f47-480420bb57emr5278760b6e.9.1778192242470; Thu, 07 May 2026 15:17:22 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 03/18] target/alpha: Use FloatExceptionFlags Date: Thu, 7 May 2026 17:17:02 -0500 Message-ID: <20260507221717.486023-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192323991158500 Content-Type: text/plain; charset="utf-8" Fixes a bug in which we were still using uint8_t. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/alpha/fpu_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/alpha/fpu_helper.c b/target/alpha/fpu_helper.c index 30f3c7fd18..9af77777da 100644 --- a/target/alpha/fpu_helper.c +++ b/target/alpha/fpu_helper.c @@ -40,7 +40,7 @@ void helper_setflushzero(CPUAlphaState *env, uint32_t val) =20 static uint32_t soft_to_fpcr_exc(CPUAlphaState *env) { - uint8_t exc =3D get_float_exception_flags(&FP_STATUS); + FloatExceptionFlags exc =3D get_float_exception_flags(&FP_STATUS); uint32_t ret =3D 0; =20 if (unlikely(exc)) { @@ -455,7 +455,7 @@ static uint64_t do_cvttq(CPUAlphaState *env, uint64_t a= , int roundmode) float64 fa; int64_t ret; uint32_t exc =3D 0; - int flags; + FloatExceptionFlags flags; =20 fa =3D t_to_float64(a); ret =3D float64_to_int64_modulo(fa, roundmode, &FP_STATUS); --=20 2.43.0 From nobody Mon May 25 20:37:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192341; cv=none; d=zohomail.com; s=zohoarc; b=MOQ0R4ANlsCoEa41tk74a20MlqJk0SrGzhxys0S6kz9twj0ipXVXrx8dhGUboJqiiGplsGr+CLkAqrjmG7Tc8J0cVBAJVML/9e8tGCDKyMBUwauTo8iF6BlLevjDdQTZtMrUZoe0aVpjKWLjBU6/6AUOlWDMux0X7F8qN9PrIfw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192341; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=1HnxtWH4yGYngMg/1E/CURv4bewMQRvEBgxk9Rn0Sro=; b=QWSnlr1UhHNwpKaIBfj3oUwB/vf2M+v/3YUbGhq0ffamfjg9O2TPASUpZEFW9v3HBXfsO0J7J4rLjMzqv/IzEHEsZz6FBCFGz1OZgf899Z8DXKDRePNUNNN+gbSvbpn4l69PmCOZhlAKioJFkqP4SyGKLfKKVcbT6NR3dk3POTs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192341366670.6482146235577; Thu, 7 May 2026 15:19:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72A-0000p4-E5; Thu, 07 May 2026 18:17:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL728-0000oh-9l for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:28 -0400 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL725-00039r-QF for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:27 -0400 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-42321c8b8f5so1093365fac.1 for ; Thu, 07 May 2026 15:17:25 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192244; x=1778797044; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=1HnxtWH4yGYngMg/1E/CURv4bewMQRvEBgxk9Rn0Sro=; b=RbDqyvQzZFj8uNJVMTUpcPFAwExzEI6ce8wIPAXHg6dcLJFzqjRhG79vdruyvBhMh2 TjbtkhIg5N1GozVdbLRZZSUgCAWZlvDmsYx9xrC1lNZV9hbbgAA9vk0J2BkWrdpyi/PC Z/hMj55PiSma7YKEw0YvSfYjwBHYh49RQbtQJQFW53PLd5UrKVWROzMFws+mUuif0Qoq bmtSfxUMoAb7giZdyF4qoyCwcKA1+F2bRi0CndKvW//kLKY0i8BEhHMdymv1qd1tRFDR TTSaXeHXUDFh0RCPXu0Q7pSLy9m8VlwgJr5sHGHh0xHSHwzBHqSJLTYCKledaEk5wdja KM+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192244; x=1778797044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=1HnxtWH4yGYngMg/1E/CURv4bewMQRvEBgxk9Rn0Sro=; b=YbXKhxHLBLRAU/cK7WF/CQo42U6VSeYIVhi9N7VteNrWs0QhjDunEl8kLHIZ0YAJPR /XvoGKpQBuySmrcnaWnyPDTnIt1hVvV8SI5xAg+aZyxsnmi1NFsCuIadMnyZ5TzJgGii eaA0fhlc2TZi1PaafQtcFcqhfXhPzSkHT+K5pa2Se3SdveGjIH08QiXXUVNf718jMei3 eSMAc3OqncAceieS6EPvaDmdy+FqE0o19zim98VaGiKfXTY26LUdDfV0dT3eliaTXA1Q myQFxXk4si5vYnR68CBHgg1htfoEZIu/9n71T9Rj222Dpe67rGCaTg7Nd6FxwYloUv56 MJoQ== X-Gm-Message-State: AOJu0YyHFfCGCMr4k4Q2ZHOE95pA6b75s/Ma/hsuS26hFInfRRjrPRli TEv9+zNWJ4dI48ThhM3KqedW/LBgDFY54Z2Nc7/QOUhMz6GfqTd1JOCp28d94nTAG4lRPKC9KuW FnAPQ X-Gm-Gg: Acq92OEc7tn1XuJjOfTPksKFrD/rn/1ciRexFvye/mDHpgwnOG4Qqxifn3xAziDmbo7 /+jHc7ghIC7EF/5KIMukKTGEuChW/fTxbMZvXsmedreQpbBSWKg0ptJMCbEU93n/hcaE0qhT4zL uME/Mr/OeshlwnqFiQC6JHbgNuL/qRCsp/P4ftfXnIOTe+9HgqNy2R4nZg68+lAlitF/bGIffh7 t4FYcx0862JvFAOHMsasXgN6+Q3yIzVvCidFsXNhiHuowgowFXsH61J6KbjujxI2XWnyEJD4dYn eOAFb2jEebM8JdJm0ELAtk2VpLVykq8fpdUHY8RNb7fRDcb6qbQIXLU8QzIJPEFar2A0VaWE1Sk G+8o8g7MDgJ8DabgU5tludQgOHzPTueuJD9ej4l3l60XJkP0a3rnNOKqiO9TO+Gdi+Aegx9EHBN ezlj9e3I1sqqIKCG7Hz+3ca4WIdE7e9UrA/7vxaS38vjWhLw== X-Received: by 2002:a05:6870:d215:b0:42f:f390:d9 with SMTP id 586e51a60fabf-435269c4445mr2740642fac.15.1778192243851; Thu, 07 May 2026 15:17:23 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 04/18] fpu: Introduce FloatSNaNRule Date: Thu, 7 May 2026 17:17:03 -0500 Message-ID: <20260507221717.486023-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::34; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x34.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192344048154100 Content-Type: text/plain; charset="utf-8" Merge snan_bit_is_one and no_signaling_nans into one control. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat-helpers.h | 14 ++--- include/fpu/softfloat-types.h | 25 ++++++--- target/mips/fpu_helper.h | 3 +- target/hppa/fpu_helper.c | 2 +- target/mips/msa.c | 4 +- target/sh4/cpu.c | 2 +- target/xtensa/cpu.c | 3 +- fpu/softfloat-specialize.c.inc | 95 ++++++++++++--------------------- 8 files changed, 66 insertions(+), 82 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helper= s.h index 745a49f07a..95edd22842 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -127,14 +127,9 @@ static inline void set_default_nan_mode(bool val, floa= t_status *status) status->default_nan_mode =3D val; } =20 -static inline void set_snan_bit_is_one(bool val, float_status *status) +static inline void set_snan_rule(FloatSNaNRule val, float_status *status) { - status->snan_bit_is_one =3D val; -} - -static inline void set_no_signaling_nans(bool val, float_status *status) -{ - status->no_signaling_nans =3D val; + status->float_snan_rule =3D val; } =20 static inline bool get_float_detect_tininess(const float_status *status) @@ -203,6 +198,11 @@ static inline bool get_default_nan_mode(const float_st= atus *status) return status->default_nan_mode; } =20 +static inline FloatSNaNRule get_snan_rule(float_status *status) +{ + return status->float_snan_rule; +} + static inline FloatFTZDetection get_float_ftz_detection(const float_status= *status) { return status->ftz_detection; diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index 5048faa76f..b8ce8ff78e 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -192,6 +192,23 @@ typedef enum __attribute__((__packed__)) { floatx80_precision_s, } FloatX80RoundPrec; =20 +/* + * Define how the architecture discriminates signaling NaNs. + * This done with the most significant bit of the fraction. + * + * In IEEE 754-1985 this was implementation defined, but in IEEE 754-2008 + * the msb must be 0. But setting the msb to 1 got baked into HPPA, SH4, + * and pre-2008 MIPS. + * + * Further, some architectures (or modes of architectures) do not detect + * signaling NaNs at all. + */ +typedef enum __attribute__((__packed__)) { + float_snan_bit_is_zero =3D 0, + float_snan_bit_is_one =3D 1, + float_snan_never, +} FloatSNaNRule; + /* * 2-input NaN propagation rule. Individual architectures have * different rules for which input NaN is propagated to the output @@ -394,6 +411,7 @@ typedef struct float_status { Float2NaNPropRule float_2nan_prop_rule; Float3NaNPropRule float_3nan_prop_rule; FloatInfZeroNaNRule float_infzeronan_rule; + FloatSNaNRule float_snan_rule; bool tininess_before_rounding; /* should denormalised results go to zero and set output_denormal_flus= hed? */ bool flush_to_zero; @@ -412,13 +430,6 @@ typedef struct float_status { * create a default NaN. */ uint8_t default_nan_pattern; - /* - * The flags below are not used on all specializations and may - * constant fold away (see snan_bit_is_one()/no_signalling_nans() in - * softfloat-specialize.inc.c) - */ - bool snan_bit_is_one; - bool no_signaling_nans; /* should overflowed results subtract re_bias to its exponent? */ bool rebias_overflow; /* should underflowed results add re_bias to its exponent? */ diff --git a/target/mips/fpu_helper.h b/target/mips/fpu_helper.h index 08fb409390..cf667c6637 100644 --- a/target/mips/fpu_helper.h +++ b/target/mips/fpu_helper.h @@ -35,7 +35,8 @@ static inline void restore_snan_bit_mode(CPUMIPSState *en= v) * With nan2008, SNaNs are silenced in the usual way. * Before that, SNaNs are not silenced; default nans are produced. */ - set_snan_bit_is_one(!nan2008, &env->active_fpu.fp_status); + set_snan_rule(nan2008 ? float_snan_bit_is_zero : float_snan_bit_is_one, + &env->active_fpu.fp_status); set_default_nan_mode(!nan2008, &env->active_fpu.fp_status); /* * For MIPS systems that conform to IEEE754-1985, the (inf,zero,nan) diff --git a/target/hppa/fpu_helper.c b/target/hppa/fpu_helper.c index 2d272730f6..cdbebcfeb3 100644 --- a/target/hppa/fpu_helper.c +++ b/target/hppa/fpu_helper.c @@ -66,7 +66,7 @@ void HELPER(loaded_fr0)(CPUHPPAState *env) set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status= ); /* Default NaN: sign bit clear, msb-1 frac bit set */ set_float_default_nan_pattern(0b00100000, &env->fp_status); - set_snan_bit_is_one(true, &env->fp_status); + set_snan_rule(float_snan_bit_is_one, &env->fp_status); /* * "PA-RISC 2.0 Architecture" says it is IMPDEF whether the flushing * enabled by FPSR.D happens before or after rounding. We pick "before" diff --git a/target/mips/msa.c b/target/mips/msa.c index 32c6acbcc5..53fbce10d3 100644 --- a/target/mips/msa.c +++ b/target/mips/msa.c @@ -84,8 +84,8 @@ void msa_reset(CPUMIPSState *env) /* clear float_status nan mode */ set_default_nan_mode(0, &env->active_tc.msa_fp_status); =20 - /* set proper signanling bit meaning ("1" means "quiet") */ - set_snan_bit_is_one(0, &env->active_tc.msa_fp_status); + /* set proper signanling bit meaning */ + set_snan_rule(float_snan_bit_is_zero, &env->active_tc.msa_fp_status); =20 /* Inf * 0 + NaN returns the input NaN */ set_float_infzeronan_rule(float_infzeronan_dnan_never, diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index e2bde45761..0f40acea00 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -151,7 +151,7 @@ static void superh_cpu_reset_hold(Object *obj, ResetTyp= e type) set_flush_to_zero(1, &env->fp_status); #endif set_default_nan_mode(1, &env->fp_status); - set_snan_bit_is_one(true, &env->fp_status); + set_snan_rule(float_snan_bit_is_one, &env->fp_status); /* sign bit clear, set all frac bits other than msb */ set_float_default_nan_pattern(0b00111111, &env->fp_status); /* diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 31429ec2f8..e6cd0e160d 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -209,7 +209,8 @@ static void xtensa_cpu_reset_hold(Object *obj, ResetTyp= e type) #endif /* For inf * 0 + NaN, return the input NaN */ set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status= ); - set_no_signaling_nans(!dfpu, &env->fp_status); + set_snan_rule(dfpu ? float_snan_bit_is_zero : float_snan_never, + &env->fp_status); /* Default NaN value: sign bit clear, set frac msb */ set_float_default_nan_pattern(0b01000000, &env->fp_status); xtensa_use_first_nan(env, !dfpu); diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 485f082cf8..29a2fdeb9b 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -79,39 +79,29 @@ this code that are retained. * version 2 or later. See the COPYING file in the top-level directory. */ =20 -/* - * Define whether architecture deviates from IEEE in not supporting - * signaling NaNs (so all NaNs are treated as quiet). - */ -static inline bool no_signaling_nans(float_status *status) -{ - return status->no_signaling_nans; -} - -/* Define how the architecture discriminates signaling NaNs. - * This done with the most significant bit of the fraction. - * In IEEE 754-1985 this was implementation defined, but in IEEE 754-2008 - * the msb must be zero. MIPS is (so far) unique in supporting both the - * 2008 revision and backward compatibility with their original choice. - */ -static inline bool snan_bit_is_one(float_status *status) -{ - return status->snan_bit_is_one; -} - /*------------------------------------------------------------------------= ---- | For the deconstructed floating-point with fraction FRAC, return true | if the fraction represents a signalling NaN; otherwise false. *-------------------------------------------------------------------------= ---*/ =20 +static bool frac_msb_is_snan(bool msb, float_status *status) +{ + FloatSNaNRule rule =3D get_snan_rule(status); + + switch (rule) { + case float_snan_never: + return false; + case float_snan_bit_is_one: + case float_snan_bit_is_zero: + return msb =3D=3D rule; + } + g_assert_not_reached(); +} + static bool parts_is_snan_frac(uint64_t frac, float_status *status) { - if (no_signaling_nans(status)) { - return false; - } else { - bool msb =3D extract64(frac, DECOMPOSED_BINARY_POINT - 1, 1); - return msb =3D=3D snan_bit_is_one(status); - } + bool msb =3D extract64(frac, DECOMPOSED_BINARY_POINT - 1, 1); + return frac_msb_is_snan(msb, status); } =20 /*------------------------------------------------------------------------= ---- @@ -167,14 +157,19 @@ FloatParts128 parts128_default_nan(float_status *stat= us) =20 static uint64_t parts_silence_nan_frac(uint64_t frac, float_status *status) { - g_assert(!no_signaling_nans(status)); + FloatSNaNRule rule =3D get_snan_rule(status); =20 - /* The only snan_bit_is_one target without default_nan_mode is HPPA. */ - if (snan_bit_is_one(status)) { + switch (rule) { + case float_snan_bit_is_zero: + frac |=3D 1ULL << (DECOMPOSED_BINARY_POINT - 1); + break; + case float_snan_bit_is_one: + /* The only snan_bit_is_one target without default_nan_mode is HPP= A. */ frac &=3D ~(1ULL << (DECOMPOSED_BINARY_POINT - 1)); frac |=3D 1ULL << (DECOMPOSED_BINARY_POINT - 2); - } else { - frac |=3D 1ULL << (DECOMPOSED_BINARY_POINT - 1); + break; + default: + g_assert_not_reached(); } return frac; } @@ -238,11 +233,7 @@ floatx80 floatx80_default_inf(bool zSign, float_status= *status) =20 static bool float16_nan_is_snan(float16 a, float_status *status) { - if (no_signaling_nans(status)) { - return false; - } - bool frac_msb_is_one =3D (a >> 9) & 1; - return frac_msb_is_one =3D=3D snan_bit_is_one(status); + return frac_msb_is_snan((a >> 9) & 1, status); } =20 /*------------------------------------------------------------------------= ---- @@ -271,11 +262,7 @@ bool float16_is_signaling_nan(float16 a_, float_status= *status) =20 static bool bfloat16_nan_is_snan(bfloat16 a, float_status *status) { - if (no_signaling_nans(status)) { - return false; - } - bool frac_msb_is_one =3D (a >> 6) & 1; - return frac_msb_is_one =3D=3D snan_bit_is_one(status); + return frac_msb_is_snan((a >> 6) & 1, status); } =20 /*------------------------------------------------------------------------= ---- @@ -302,11 +289,7 @@ bool bfloat16_is_signaling_nan(bfloat16 a_, float_stat= us *status) =20 static bool float32_nan_is_snan(float32 a, float_status *status) { - if (no_signaling_nans(status)) { - return false; - } - bool frac_msb_is_one =3D (a >> 22) & 1; - return frac_msb_is_one =3D=3D snan_bit_is_one(status); + return frac_msb_is_snan((a >> 22) & 1, status); } =20 /*------------------------------------------------------------------------= ---- @@ -335,11 +318,7 @@ bool float32_is_signaling_nan(float32 a_, float_status= *status) =20 static bool float64_nan_is_snan(float64 a, float_status *status) { - if (no_signaling_nans(status)) { - return false; - } - bool frac_msb_is_one =3D (a >> 51) & 1; - return frac_msb_is_one =3D=3D snan_bit_is_one(status); + return frac_msb_is_snan((a >> 51) & 1, status); } =20 /*------------------------------------------------------------------------= ---- @@ -370,11 +349,7 @@ bool float64_is_signaling_nan(float64 a_, float_status= *status) =20 static bool floatx80_nan_is_snan(floatx80 a, float_status *status) { - if (no_signaling_nans(status)) { - return false; - } - bool frac_msb_is_one =3D (a.low >> 62) & 1; - return frac_msb_is_one =3D=3D snan_bit_is_one(status); + return frac_msb_is_snan((a.low >> 62) & 1, status); } =20 /*------------------------------------------------------------------------= ---- @@ -405,7 +380,7 @@ bool floatx80_is_signaling_nan(floatx80 a, float_status= *status) floatx80 floatx80_silence_nan(floatx80 a, float_status *status) { /* None of the targets that have snan_bit_is_one use floatx80. */ - assert(!snan_bit_is_one(status)); + assert(get_snan_rule(status) =3D=3D float_snan_bit_is_zero); a.low |=3D UINT64_C(0xC000000000000000); return a; } @@ -416,11 +391,7 @@ floatx80 floatx80_silence_nan(floatx80 a, float_status= *status) =20 static bool float128_nan_is_snan(float128 a, float_status *status) { - if (no_signaling_nans(status)) { - return false; - } - bool frac_msb_is_one =3D (a.high >> 47) & 1; - return frac_msb_is_one =3D=3D snan_bit_is_one(status); + return frac_msb_is_snan((a.high >> 47) & 1, status); } =20 /*------------------------------------------------------------------------= ---- --=20 2.43.0 From nobody Mon May 25 20:37:28 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192306; cv=none; d=zohomail.com; s=zohoarc; b=RiPay3a9HOKDTnLta8l3z2F41574hu0m+lBGYETifsi1+tg36xqOEBoR/FdCn4BaWCF8hLk7VZiFqA2iYHB6bfZ/mNBLBwK5zKB++tT4mC+sSdhvNszYN4A3cErvPdsO2BnD58AmOJ1Bc6quqCdUZ8m2uPYcfp73JETcF5Gl1CE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192306; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=OwpeqApJglP8xIDD4j7dnh1qLWRBcld5JpmqbfZRzf0=; b=gvtK3jhXMvvtIHXzNZ6SjrbaSzft7+VdnI0hPsP0ATTBivqs6IrxqnmiVXelx26eVN2s+vFoAEfkU+NR4dKzS/PbKjS9psLQrC/6/tsUawkRuPOitbtKpiTBbhxYyBcC+oY+z4u9ByaL9eusl5AZbl5ehoACHwriKlf/V4Lry8Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192306204540.4415755271369; Thu, 7 May 2026 15:18:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72D-0000pc-Uh; Thu, 07 May 2026 18:17:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72C-0000pK-NK for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:32 -0400 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL728-0003CG-6r for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:32 -0400 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-4350cd5b97fso752258fac.0 for ; Thu, 07 May 2026 15:17:27 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192247; x=1778797047; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=OwpeqApJglP8xIDD4j7dnh1qLWRBcld5JpmqbfZRzf0=; b=rchNHnisYnD8EMzPhNWdERcududku1vcTn0i0EJRdn2BJplUgbPQQcaD38xivT/jHc 2/e4ueObaM49Ro3IMwv+r7A7A7zH3NQZ9NiHr0ubo2wOX1DZDP3Y4C1mgZXN0140QzkM MhwEVh33G9bIvs7oH9NBkyrz1TtBICIJxX/pFGkJN4HryF9GXY2oRWC6HUXW3Hy6aApk wPbvFFGZsNgc4dHNHSZ4VmsgTHk6eObSW1pJk++Z6Pcj5HgC1fSTS3vCv97x+oX/hNOU wqWDRbaOnyWcIeqrSdLTPoPXhi5yepuxNeLUy2QdsXYVxFsQDBw3hkS+2nt2K9Zwfs4j U29Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192247; x=1778797047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=OwpeqApJglP8xIDD4j7dnh1qLWRBcld5JpmqbfZRzf0=; b=gl2nDItl2VGtpAYEAAmSocuhL+/yzdMK+pI9clGCRWpl3XBEH3GzpUareRg3VlbUrZ N5g9SbCh41vLKDCVOtMF+hKQ8e/zXvzsvNROTch0pggYEOOEJ1DW9Ou77CtP4HNFWj3H R4e7ojdRXi6U/h+4H3AaavSe5WarPqAk+aiJAJ0ph4RTp8QqoRvg1CYy020Z6zfM79UA MHi4/fnF5A1Pw2JrZ3blGTIS5DldnzSiFGYq8gidE3Dd0qJQJv/ooq+vXDJMI3PbyBbP TAi0gL9edY3LeDXJ/NcvwI5Zo+HP4nvxVT1/w5obBgIz2AoW2f05Lf+gay1s6P0cTjY0 wPPg== X-Gm-Message-State: AOJu0Yzcb5FSllnQ2X9stpJVRK9ORFaCPun4lWqz8M5B3NAlt8iP5CWI YBnJWIVYW5y3kR7+EFoU3D3djyGUW7is6qrhX0FdRJaEhBO3JfkbgrpHKaPbEx+QLFs/olKDN5j WsYlz X-Gm-Gg: AeBDievvbLNwC3qe2UU+gZGSTVvUu6mdaegjtHPy53RsNnO9rZYoj1ov60YBCapQZE2 sB83lnGf/d9sR8W2VTVGddr5zO/zOtE4/iF/3SnBlBkJZi+CS3Ujjj02mt2nRKgrU0t2pyMJjAO xAKhe+IlECro1huD1sLTsHiUM72Yqb9eu+zsitM0KzlX8ZGABRH49EjlzrHdaLc0SSKmWA1jUWn VqIISRMR6ZUtBxI8/ziVzL/8EIh3VNUTqn032364R4Rnzq+B0OQ/LV3xwVYVayL0naenBYZlf1S t7INYGCAnlTztg/4tzj8e1FJ05uToYJQiJ2XaJrwx6aH7WPLJc6hm71Q0YmVS/UC1hpf+pQET/9 xpZcFPkjpbTKF3n6OL0Sf6CnLEqP7cWKaT2PoWs2AQG+6EJfxgsL/qo729su/AHXCwIP91k0xYs ipntxd5u2CD5IKQ2lQutvk4pph+6l4whoE3nOUKX7gXCexCg== X-Received: by 2002:a05:6871:891:b0:42f:d9dc:2cc with SMTP id 586e51a60fabf-434f5cd3d04mr6808846fac.1.1778192246346; Thu, 07 May 2026 15:17:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 05/18] fpu: Use {get,set}_float_rounding_mode everywhere Date: Thu, 7 May 2026 17:17:04 -0500 Message-ID: <20260507221717.486023-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2e; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2e.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192308090154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/i386/ops_sse.h | 24 ++--- fpu/softfloat.c | 88 +++++++++--------- target/alpha/fpu_helper.c | 2 +- target/arm/tcg/vfp_helper.c | 8 +- target/hexagon/fma_emu.c | 6 +- target/i386/tcg/fpu_helper.c | 28 +++--- target/m68k/softfloat.c | 170 +++++++++++++++++----------------- target/ppc/fpu_helper.c | 14 +-- target/riscv/vector_helper.c | 6 +- target/s390x/tcg/fpu_helper.c | 4 +- tests/fp/fp-bench.c | 2 +- tests/fp/fp-test.c | 2 +- fpu/softfloat-parts.c.inc | 8 +- tests/fp/wrap.c.inc | 12 +-- 14 files changed, 185 insertions(+), 189 deletions(-) diff --git a/target/i386/ops_sse.h b/target/i386/ops_sse.h index 99c4728ec8..5176a9f9e3 100644 --- a/target/i386/ops_sse.h +++ b/target/i386/ops_sse.h @@ -601,7 +601,7 @@ void glue(helper_cvtph2ps, SUFFIX)(CPUX86State *env, Re= g *d, Reg *s) void glue(helper_cvtps2ph, SUFFIX)(CPUX86State *env, Reg *d, Reg *s, int m= ode) { int i; - FloatRoundMode prev_rounding_mode =3D env->sse_status.float_rounding_m= ode; + FloatRoundMode prev_rounding_mode =3D get_float_rounding_mode(&env->ss= e_status); if (!(mode & (1 << 2))) { set_x86_rounding_mode(mode & 3, &env->sse_status); } @@ -613,7 +613,7 @@ void glue(helper_cvtps2ph, SUFFIX)(CPUX86State *env, Re= g *d, Reg *s, int mode) d->Q(i) =3D 0; } =20 - env->sse_status.float_rounding_mode =3D prev_rounding_mode; + set_float_rounding_mode(prev_rounding_mode, &env->sse_status); } #endif =20 @@ -1715,10 +1715,9 @@ void glue(helper_roundps, SUFFIX)(CPUX86State *env, = Reg *d, Reg *s, uint32_t mode) { int old_flags =3D get_float_exception_flags(&env->sse_status); - signed char prev_rounding_mode; + FloatRoundMode prev_rounding_mode =3D get_float_rounding_mode(&env->ss= e_status); int i; =20 - prev_rounding_mode =3D env->sse_status.float_rounding_mode; if (!(mode & (1 << 2))) { set_x86_rounding_mode(mode & 3, &env->sse_status); } @@ -1732,17 +1731,16 @@ void glue(helper_roundps, SUFFIX)(CPUX86State *env,= Reg *d, Reg *s, ~float_flag_inexact, &env->sse_status); } - env->sse_status.float_rounding_mode =3D prev_rounding_mode; + set_float_rounding_mode(prev_rounding_mode, &env->sse_status); } =20 void glue(helper_roundpd, SUFFIX)(CPUX86State *env, Reg *d, Reg *s, uint32_t mode) { int old_flags =3D get_float_exception_flags(&env->sse_status); - signed char prev_rounding_mode; + FloatRoundMode prev_rounding_mode =3D get_float_rounding_mode(&env->ss= e_status); int i; =20 - prev_rounding_mode =3D env->sse_status.float_rounding_mode; if (!(mode & (1 << 2))) { set_x86_rounding_mode(mode & 3, &env->sse_status); } @@ -1756,7 +1754,7 @@ void glue(helper_roundpd, SUFFIX)(CPUX86State *env, R= eg *d, Reg *s, ~float_flag_inexact, &env->sse_status); } - env->sse_status.float_rounding_mode =3D prev_rounding_mode; + set_float_rounding_mode(prev_rounding_mode, &env->sse_status); } =20 #if SHIFT =3D=3D 1 @@ -1764,10 +1762,9 @@ void glue(helper_roundss, SUFFIX)(CPUX86State *env, = Reg *d, Reg *v, Reg *s, uint32_t mode) { int old_flags =3D get_float_exception_flags(&env->sse_status); - signed char prev_rounding_mode; + FloatRoundMode prev_rounding_mode =3D get_float_rounding_mode(&env->ss= e_status); int i; =20 - prev_rounding_mode =3D env->sse_status.float_rounding_mode; if (!(mode & (1 << 2))) { set_x86_rounding_mode(mode & 3, &env->sse_status); } @@ -1782,17 +1779,16 @@ void glue(helper_roundss, SUFFIX)(CPUX86State *env,= Reg *d, Reg *v, Reg *s, ~float_flag_inexact, &env->sse_status); } - env->sse_status.float_rounding_mode =3D prev_rounding_mode; + set_float_rounding_mode(prev_rounding_mode, &env->sse_status); } =20 void glue(helper_roundsd, SUFFIX)(CPUX86State *env, Reg *d, Reg *v, Reg *s, uint32_t mode) { int old_flags =3D get_float_exception_flags(&env->sse_status); - signed char prev_rounding_mode; + FloatRoundMode prev_rounding_mode =3D get_float_rounding_mode(&env->ss= e_status); int i; =20 - prev_rounding_mode =3D env->sse_status.float_rounding_mode; if (!(mode & (1 << 2))) { set_x86_rounding_mode(mode & 3, &env->sse_status); } @@ -1807,7 +1803,7 @@ void glue(helper_roundsd, SUFFIX)(CPUX86State *env, R= eg *d, Reg *v, Reg *s, ~float_flag_inexact, &env->sse_status); } - env->sse_status.float_rounding_mode =3D prev_rounding_mode; + set_float_rounding_mode(prev_rounding_mode, &env->sse_status); } #endif =20 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 9fc0b83cd1..231b308b50 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -234,7 +234,7 @@ static inline bool can_use_fpu(const float_status *s) return false; } return likely(s->float_exception_flags & float_flag_inexact && - s->float_rounding_mode =3D=3D float_round_nearest_even); + get_float_rounding_mode(s) =3D=3D float_round_nearest_ev= en); } =20 /* @@ -2791,7 +2791,7 @@ float16 float16_round_to_int(float16 a, float_status = *s) { FloatParts64 p =3D float16_unpack_canonical(a, s); =20 - p =3D parts64_round_to_int(&p, s->float_rounding_mode, 0, s, + p =3D parts64_round_to_int(&p, get_float_rounding_mode(s), 0, s, &float16_params); return float16_round_pack_canonical(&p, s); } @@ -2800,7 +2800,7 @@ float32 float32_round_to_int(float32 a, float_status = *s) { FloatParts64 p =3D float32_unpack_canonical(a, s); =20 - p =3D parts64_round_to_int(&p, s->float_rounding_mode, 0, s, + p =3D parts64_round_to_int(&p, get_float_rounding_mode(s), 0, s, &float32_params); return float32_round_pack_canonical(&p, s); } @@ -2809,7 +2809,7 @@ float64 float64_round_to_int(float64 a, float_status = *s) { FloatParts64 p =3D float64_unpack_canonical(a, s); =20 - p =3D parts64_round_to_int(&p, s->float_rounding_mode, 0, s, + p =3D parts64_round_to_int(&p, get_float_rounding_mode(s), 0, s, &float64_params); return float64_round_pack_canonical(&p, s); } @@ -2818,7 +2818,7 @@ bfloat16 bfloat16_round_to_int(bfloat16 a, float_stat= us *s) { FloatParts64 p =3D bfloat16_unpack_canonical(a, s); =20 - p =3D parts64_round_to_int(&p, s->float_rounding_mode, 0, s, + p =3D parts64_round_to_int(&p, get_float_rounding_mode(s), 0, s, &bfloat16_params); return bfloat16_round_pack_canonical(&p, s); } @@ -2827,7 +2827,7 @@ float128 float128_round_to_int(float128 a, float_stat= us *s) { FloatParts128 p =3D float128_unpack_canonical(a, s); =20 - p =3D parts128_round_to_int(&p, s->float_rounding_mode, 0, s, + p =3D parts128_round_to_int(&p, get_float_rounding_mode(s), 0, s, &float128_params); return float128_round_pack_canonical(&p, s); } @@ -2840,7 +2840,7 @@ floatx80 floatx80_round_to_int(floatx80 a, float_stat= us *status) return floatx80_default_nan(status); } =20 - p =3D parts128_round_to_int(&p, status->float_rounding_mode, 0, status, + p =3D parts128_round_to_int(&p, get_float_rounding_mode(status), 0, st= atus, &floatx80_params[status->floatx80_rounding_p= recision]); return floatx80_round_pack_canonical(&p, status); } @@ -3038,77 +3038,77 @@ static int64_t floatx80_to_int64_scalbn(floatx80 a,= FloatRoundMode rmode, =20 int8_t float16_to_int8(float16 a, float_status *s) { - return float16_to_int8_scalbn(a, s->float_rounding_mode, 0, s); + return float16_to_int8_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int16_t float16_to_int16(float16 a, float_status *s) { - return float16_to_int16_scalbn(a, s->float_rounding_mode, 0, s); + return float16_to_int16_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int32_t float16_to_int32(float16 a, float_status *s) { - return float16_to_int32_scalbn(a, s->float_rounding_mode, 0, s); + return float16_to_int32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int64_t float16_to_int64(float16 a, float_status *s) { - return float16_to_int64_scalbn(a, s->float_rounding_mode, 0, s); + return float16_to_int64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int16_t float32_to_int16(float32 a, float_status *s) { - return float32_to_int16_scalbn(a, s->float_rounding_mode, 0, s); + return float32_to_int16_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int32_t float32_to_int32(float32 a, float_status *s) { - return float32_to_int32_scalbn(a, s->float_rounding_mode, 0, s); + return float32_to_int32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int64_t float32_to_int64(float32 a, float_status *s) { - return float32_to_int64_scalbn(a, s->float_rounding_mode, 0, s); + return float32_to_int64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int16_t float64_to_int16(float64 a, float_status *s) { - return float64_to_int16_scalbn(a, s->float_rounding_mode, 0, s); + return float64_to_int16_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int32_t float64_to_int32(float64 a, float_status *s) { - return float64_to_int32_scalbn(a, s->float_rounding_mode, 0, s); + return float64_to_int32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int64_t float64_to_int64(float64 a, float_status *s) { - return float64_to_int64_scalbn(a, s->float_rounding_mode, 0, s); + return float64_to_int64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int32_t float128_to_int32(float128 a, float_status *s) { - return float128_to_int32_scalbn(a, s->float_rounding_mode, 0, s); + return float128_to_int32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int64_t float128_to_int64(float128 a, float_status *s) { - return float128_to_int64_scalbn(a, s->float_rounding_mode, 0, s); + return float128_to_int64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 Int128 float128_to_int128(float128 a, float_status *s) { - return float128_to_int128_scalbn(a, s->float_rounding_mode, 0, s); + return float128_to_int128_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int32_t floatx80_to_int32(floatx80 a, float_status *s) { - return floatx80_to_int32_scalbn(a, s->float_rounding_mode, 0, s); + return floatx80_to_int32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int64_t floatx80_to_int64(floatx80 a, float_status *s) { - return floatx80_to_int64_scalbn(a, s->float_rounding_mode, 0, s); + return floatx80_to_int64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int16_t float16_to_int16_round_to_zero(float16 a, float_status *s) @@ -3183,22 +3183,22 @@ int64_t floatx80_to_int64_round_to_zero(floatx80 a,= float_status *s) =20 int8_t bfloat16_to_int8(bfloat16 a, float_status *s) { - return bfloat16_to_int8_scalbn(a, s->float_rounding_mode, 0, s); + return bfloat16_to_int8_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int16_t bfloat16_to_int16(bfloat16 a, float_status *s) { - return bfloat16_to_int16_scalbn(a, s->float_rounding_mode, 0, s); + return bfloat16_to_int16_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int32_t bfloat16_to_int32(bfloat16 a, float_status *s) { - return bfloat16_to_int32_scalbn(a, s->float_rounding_mode, 0, s); + return bfloat16_to_int32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int64_t bfloat16_to_int64(bfloat16 a, float_status *s) { - return bfloat16_to_int64_scalbn(a, s->float_rounding_mode, 0, s); + return bfloat16_to_int64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 int8_t bfloat16_to_int8_round_to_zero(bfloat16 a, float_status *s) @@ -3477,67 +3477,67 @@ static Int128 float128_to_uint128_scalbn(float128 a= , FloatRoundMode rmode, =20 uint8_t float16_to_uint8(float16 a, float_status *s) { - return float16_to_uint8_scalbn(a, s->float_rounding_mode, 0, s); + return float16_to_uint8_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint16_t float16_to_uint16(float16 a, float_status *s) { - return float16_to_uint16_scalbn(a, s->float_rounding_mode, 0, s); + return float16_to_uint16_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint32_t float16_to_uint32(float16 a, float_status *s) { - return float16_to_uint32_scalbn(a, s->float_rounding_mode, 0, s); + return float16_to_uint32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint64_t float16_to_uint64(float16 a, float_status *s) { - return float16_to_uint64_scalbn(a, s->float_rounding_mode, 0, s); + return float16_to_uint64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint16_t float32_to_uint16(float32 a, float_status *s) { - return float32_to_uint16_scalbn(a, s->float_rounding_mode, 0, s); + return float32_to_uint16_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint32_t float32_to_uint32(float32 a, float_status *s) { - return float32_to_uint32_scalbn(a, s->float_rounding_mode, 0, s); + return float32_to_uint32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint64_t float32_to_uint64(float32 a, float_status *s) { - return float32_to_uint64_scalbn(a, s->float_rounding_mode, 0, s); + return float32_to_uint64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint16_t float64_to_uint16(float64 a, float_status *s) { - return float64_to_uint16_scalbn(a, s->float_rounding_mode, 0, s); + return float64_to_uint16_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint32_t float64_to_uint32(float64 a, float_status *s) { - return float64_to_uint32_scalbn(a, s->float_rounding_mode, 0, s); + return float64_to_uint32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint64_t float64_to_uint64(float64 a, float_status *s) { - return float64_to_uint64_scalbn(a, s->float_rounding_mode, 0, s); + return float64_to_uint64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint32_t float128_to_uint32(float128 a, float_status *s) { - return float128_to_uint32_scalbn(a, s->float_rounding_mode, 0, s); + return float128_to_uint32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint64_t float128_to_uint64(float128 a, float_status *s) { - return float128_to_uint64_scalbn(a, s->float_rounding_mode, 0, s); + return float128_to_uint64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 Int128 float128_to_uint128(float128 a, float_status *s) { - return float128_to_uint128_scalbn(a, s->float_rounding_mode, 0, s); + return float128_to_uint128_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint16_t float16_to_uint16_round_to_zero(float16 a, float_status *s) @@ -3602,22 +3602,22 @@ Int128 float128_to_uint128_round_to_zero(float128 a= , float_status *s) =20 uint8_t bfloat16_to_uint8(bfloat16 a, float_status *s) { - return bfloat16_to_uint8_scalbn(a, s->float_rounding_mode, 0, s); + return bfloat16_to_uint8_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint16_t bfloat16_to_uint16(bfloat16 a, float_status *s) { - return bfloat16_to_uint16_scalbn(a, s->float_rounding_mode, 0, s); + return bfloat16_to_uint16_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint32_t bfloat16_to_uint32(bfloat16 a, float_status *s) { - return bfloat16_to_uint32_scalbn(a, s->float_rounding_mode, 0, s); + return bfloat16_to_uint32_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint64_t bfloat16_to_uint64(bfloat16 a, float_status *s) { - return bfloat16_to_uint64_scalbn(a, s->float_rounding_mode, 0, s); + return bfloat16_to_uint64_scalbn(a, get_float_rounding_mode(s), 0, s); } =20 uint8_t bfloat16_to_uint8_round_to_zero(bfloat16 a, float_status *s) @@ -4866,7 +4866,7 @@ floatx80 roundAndPackFloatx80(FloatX80RoundPrec round= ingPrecision, bool zSign, bool roundNearestEven, increment, isTiny; int64_t roundIncrement, roundMask, roundBits; =20 - roundingMode =3D status->float_rounding_mode; + roundingMode =3D get_float_rounding_mode(status); roundNearestEven =3D ( roundingMode =3D=3D float_round_nearest_even ); switch (roundingPrecision) { case floatx80_precision_x: diff --git a/target/alpha/fpu_helper.c b/target/alpha/fpu_helper.c index 9af77777da..0ced53c54e 100644 --- a/target/alpha/fpu_helper.c +++ b/target/alpha/fpu_helper.c @@ -485,7 +485,7 @@ static uint64_t do_cvttq(CPUAlphaState *env, uint64_t a= , int roundmode) =20 uint64_t helper_cvttq(CPUAlphaState *env, uint64_t a) { - return do_cvttq(env, a, FP_STATUS.float_rounding_mode); + return do_cvttq(env, a, get_float_rounding_mode(&FP_STATUS)); } =20 uint64_t helper_cvttq_c(CPUAlphaState *env, uint64_t a) diff --git a/target/arm/tcg/vfp_helper.c b/target/arm/tcg/vfp_helper.c index e692bc568b..5839e82449 100644 --- a/target/arm/tcg/vfp_helper.c +++ b/target/arm/tcg/vfp_helper.c @@ -423,10 +423,10 @@ ftype HELPER(vfp_##name##to##p)(uint##isz##_t x, uin= t32_t shift, \ float_status *fpst) \ { \ ftype ret; \ - FloatRoundMode oldmode =3D fpst->float_rounding_mode; \ - fpst->float_rounding_mode =3D float_round_nearest_even; \ + FloatRoundMode oldmode =3D get_float_rounding_mode(fpst); \ + set_float_rounding_mode(float_round_nearest_even, fpst); \ ret =3D itype##_to_##float##fsz##_scalbn(x, -shift, fpst); \ - fpst->float_rounding_mode =3D oldmode; \ + set_float_rounding_mode(oldmode, fpst); \ return ret; \ } =20 @@ -663,7 +663,7 @@ static uint64_t call_recip_estimate(int *exp, int exp_o= ff, uint64_t frac, =20 static bool round_to_inf(float_status *fpst, bool sign_bit) { - switch (fpst->float_rounding_mode) { + switch (get_float_rounding_mode(fpst)) { case float_round_nearest_even: /* Round to Nearest */ return true; case float_round_up: /* Round to +Inf */ diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c index c557141f11..a90f5c87b6 100644 --- a/target/hexagon/fma_emu.c +++ b/target/hexagon/fma_emu.c @@ -315,7 +315,7 @@ static float64 accum_round_float64(Accum a, float_statu= s *fp_status) if ((int128_gethi(a.mant) =3D=3D 0) && (int128_getlo(a.mant) =3D=3D 0) && ((a.guard | a.round | a.sticky) =3D=3D 0)) { /* result zero */ - switch (fp_status->float_rounding_mode) { + switch (get_float_rounding_mode(fp_status)) { case float_round_down: return zero_float64(1); default: @@ -362,7 +362,7 @@ static float64 accum_round_float64(Accum a, float_statu= s *fp_status) /* OK, we're relatively canonical... now we need to round */ if (a.guard || a.round || a.sticky) { float_raise(float_flag_inexact, fp_status); - switch (fp_status->float_rounding_mode) { + switch (get_float_rounding_mode(fp_status)) { case float_round_to_zero: /* Chop and we're done */ break; @@ -401,7 +401,7 @@ static float64 accum_round_float64(Accum a, float_statu= s *fp_status) /* Yep, inf result */ float_raise(float_flag_overflow, fp_status); float_raise(float_flag_inexact, fp_status); - switch (fp_status->float_rounding_mode) { + switch (get_float_rounding_mode(fp_status)) { case float_round_to_zero: return maxfinite_float64(a.sign); case float_round_up: diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 37c83ded38..7b0b0dd520 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -1183,10 +1183,10 @@ void helper_f2xm1(CPUX86State *env) bool asign, bsign; int32_t n, aexp, bexp; uint64_t asig0, asig1, asig2, bsig0, bsig1; - FloatRoundMode save_mode =3D env->fp_status.float_rounding_mode; + FloatRoundMode save_mode =3D get_float_rounding_mode(&env->fp_stat= us); FloatX80RoundPrec save_prec =3D env->fp_status.floatx80_rounding_precision; - env->fp_status.float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, &env->fp_status); env->fp_status.floatx80_rounding_precision =3D floatx80_precision_= x; =20 /* Find the nearest multiple of 1/32 to the argument. */ @@ -1202,7 +1202,7 @@ void helper_f2xm1(CPUX86State *env) */ ST0 =3D f2xm1_table[n].t; set_float_exception_flags(float_flag_inexact, &env->fp_status); - env->fp_status.float_rounding_mode =3D save_mode; + set_float_rounding_mode(save_mode, &env->fp_status); } else { /* * Compute the lower parts of a polynomial expansion for @@ -1282,7 +1282,7 @@ void helper_f2xm1(CPUX86State *env) asign =3D bsign; } } - env->fp_status.float_rounding_mode =3D save_mode; + set_float_rounding_mode(save_mode, &env->fp_status); /* This result is inexact. */ asig1 |=3D 1; ST0 =3D normalizeRoundAndPackFloatx80(floatx80_precision_x, @@ -1483,10 +1483,10 @@ void helper_fpatan(CPUX86State *env) uint64_t azsig0, azsig1; uint64_t azsig2, azsig3, axsig0, axsig1; floatx80 x8; - FloatRoundMode save_mode =3D env->fp_status.float_rounding_mod= e; + FloatRoundMode save_mode =3D get_float_rounding_mode(&env->fp_= status); FloatX80RoundPrec save_prec =3D env->fp_status.floatx80_rounding_precision; - env->fp_status.float_rounding_mode =3D float_round_nearest_eve= n; + set_float_rounding_mode(float_round_nearest_even, &env->fp_sta= tus); env->fp_status.floatx80_rounding_precision =3D floatx80_precis= ion_x; =20 if (arg0_exp =3D=3D 0) { @@ -1793,7 +1793,7 @@ void helper_fpatan(CPUX86State *env) } } =20 - env->fp_status.float_rounding_mode =3D save_mode; + set_float_rounding_mode(save_mode, &env->fp_status); env->fp_status.floatx80_rounding_precision =3D save_prec; } /* This result is inexact. */ @@ -2121,10 +2121,10 @@ void helper_fyl2xp1(CPUX86State *env) } else { int32_t aexp; uint64_t asig0, asig1, asig2; - FloatRoundMode save_mode =3D env->fp_status.float_rounding_mode; + FloatRoundMode save_mode =3D get_float_rounding_mode(&env->fp_stat= us); FloatX80RoundPrec save_prec =3D env->fp_status.floatx80_rounding_precision; - env->fp_status.float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, &env->fp_status); env->fp_status.floatx80_rounding_precision =3D floatx80_precision_= x; =20 helper_fyl2x_common(env, ST0, &aexp, &asig0, &asig1); @@ -2139,7 +2139,7 @@ void helper_fyl2xp1(CPUX86State *env) aexp +=3D arg1_exp - 0x3ffe; /* This result is inexact. */ asig1 |=3D 1; - env->fp_status.float_rounding_mode =3D save_mode; + set_float_rounding_mode(save_mode, &env->fp_status); ST1 =3D normalizeRoundAndPackFloatx80(floatx80_precision_x, arg0_sign ^ arg1_sign, aexp, asig0, asig1, &env->fp_status); @@ -2224,10 +2224,10 @@ void helper_fyl2x(CPUX86State *env) } else { int32_t int_exp; floatx80 arg0_m1; - FloatRoundMode save_mode =3D env->fp_status.float_rounding_mode; + FloatRoundMode save_mode =3D get_float_rounding_mode(&env->fp_stat= us); FloatX80RoundPrec save_prec =3D env->fp_status.floatx80_rounding_precision; - env->fp_status.float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, &env->fp_status); env->fp_status.floatx80_rounding_precision =3D floatx80_precision_= x; =20 if (arg0_exp =3D=3D 0) { @@ -2245,7 +2245,7 @@ void helper_fyl2x(CPUX86State *env) floatx80_one, &env->fp_status); if (floatx80_is_zero(arg0_m1)) { /* Exact power of 2; multiply by ST1. */ - env->fp_status.float_rounding_mode =3D save_mode; + set_float_rounding_mode(save_mode, &env->fp_status); ST1 =3D floatx80_mul(int32_to_floatx80(int_exp, &env->fp_statu= s), ST1, &env->fp_status); } else { @@ -2284,7 +2284,7 @@ void helper_fyl2x(CPUX86State *env) aexp +=3D arg1_exp - 0x3ffe; /* This result is inexact. */ asig1 |=3D 1; - env->fp_status.float_rounding_mode =3D save_mode; + set_float_rounding_mode(save_mode, &env->fp_status); ST1 =3D normalizeRoundAndPackFloatx80(floatx80_precision_x, asign ^ arg1_sign, aexp, asig0, asig1, &env->fp_sta= tus); diff --git a/target/m68k/softfloat.c b/target/m68k/softfloat.c index d1f150e641..51706f6db8 100644 --- a/target/m68k/softfloat.c +++ b/target/m68k/softfloat.c @@ -266,9 +266,9 @@ floatx80 floatx80_lognp1(floatx80 a, float_status *stat= us) return floatx80_move(a, status); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 compact =3D floatx80_make_compact(aExp, aSig); @@ -336,7 +336,7 @@ floatx80 floatx80_lognp1(floatx80 a, float_status *stat= us) status); /* LOG(F)+U*V*(A2+V*(A4+V*A6)) */ fp0 =3D floatx80_add(fp0, fp1, status); /* FP0 IS LOG(F) + LOG(1+U= ) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, klog2, status); @@ -402,7 +402,7 @@ floatx80 floatx80_lognp1(floatx80 a, float_status *stat= us) fp0 =3D floatx80_mul(fp0, fp1, status); /* U*V*([B1+W*(B3+W*B5)] + [V*(B2+W*B4= )]) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, saveu, status); @@ -464,9 +464,9 @@ floatx80 floatx80_logn(floatx80 a, float_status *status) return floatx80_default_nan(status); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 compact =3D floatx80_make_compact(aExp, aSig); @@ -523,7 +523,7 @@ floatx80 floatx80_logn(floatx80 a, float_status *status) status); /* LOG(F)+U*V*(A2+V*(A4+V*A6)) */ fp0 =3D floatx80_add(fp0, fp1, status); /* FP0 IS LOG(F) + LOG(1+U= ) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, klog2, status); @@ -569,7 +569,7 @@ floatx80 floatx80_logn(floatx80 a, float_status *status) fp0 =3D floatx80_mul(fp0, fp1, status); /* U*V*([B1+W*(B3+W*B5)] + [V*(B2+W*B4= )]) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, saveu, status); @@ -620,15 +620,15 @@ floatx80 floatx80_log10(floatx80 a, float_status *sta= tus) return floatx80_default_nan(status); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 fp0 =3D floatx80_logn(a, status); fp1 =3D packFloatx80(0, 0x3FFD, UINT64_C(0xDE5BD8A937287195)); /* INV_= L10 */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, fp1, status); /* LOGN(X)*INV_L10 */ @@ -679,13 +679,13 @@ floatx80 floatx80_log2(floatx80 a, float_status *stat= us) return floatx80_default_nan(status); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 if (aSig =3D=3D one_sig) { /* X is 2^k */ - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D int32_to_floatx80(aExp - 0x3FFF, status); @@ -693,7 +693,7 @@ floatx80 floatx80_log2(floatx80 a, float_status *status) fp0 =3D floatx80_logn(a, status); fp1 =3D packFloatx80(0, 0x3FFF, UINT64_C(0xB8AA3B295C17F0BC)); /* = INV_L2 */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, fp1, status); /* LOGN(X)*INV_L2 */ @@ -739,9 +739,9 @@ floatx80 floatx80_etox(floatx80 a, float_status *status) return packFloatx80(0, one_exp, one_sig); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 adjflag =3D 0; @@ -817,7 +817,7 @@ floatx80 floatx80_etox(floatx80 a, float_status *status) fp0 =3D floatx80_mul(fp0, adjscale, status); } =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, scale, status); @@ -827,7 +827,7 @@ floatx80 floatx80_etox(floatx80 a, float_status *status) return a; } else { /* |X| >=3D 16380 log2 */ if (compact > 0x400CB27C) { /* |X| >=3D 16480 log2 */ - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; if (aSign) { a =3D roundAndPackFloatx80( @@ -876,7 +876,7 @@ floatx80 floatx80_etox(floatx80 a, float_status *status) } } } else { /* |X| < 2^(-65) */ - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(a, float32_to_floatx80(make_float32(0x3F800000), @@ -922,9 +922,9 @@ floatx80 floatx80_twotox(floatx80 a, float_status *stat= us) return packFloatx80(0, one_exp, one_sig); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 fp0 =3D a; @@ -934,7 +934,7 @@ floatx80 floatx80_twotox(floatx80 a, float_status *stat= us) if (compact < 0x3FB98000 || compact > 0x400D80C0) { /* |X| > 16480 or |X| < 2^(-70) */ if (compact > 0x3FFF8000) { /* |X| > 16480 */ - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 if (aSign) { @@ -945,7 +945,7 @@ floatx80 floatx80_twotox(floatx80 a, float_status *stat= us) 0, 0x8000, aSig, 0, status); } } else { /* |X| < 2^(-70) */ - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, float32_to_floatx80( @@ -1027,7 +1027,7 @@ floatx80 floatx80_twotox(floatx80 a, float_status *st= atus) fp0 =3D floatx80_add(fp0, fact2, status); fp0 =3D floatx80_add(fp0, fact1, status); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, adjfact, status); @@ -1072,9 +1072,9 @@ floatx80 floatx80_tentox(floatx80 a, float_status *st= atus) return packFloatx80(0, one_exp, one_sig); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 fp0 =3D a; @@ -1084,7 +1084,7 @@ floatx80 floatx80_tentox(floatx80 a, float_status *st= atus) if (compact < 0x3FB98000 || compact > 0x400B9B07) { /* |X| > 16480 LOG2/LOG10 or |X| < 2^(-70) */ if (compact > 0x3FFF8000) { /* |X| > 16480 */ - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 if (aSign) { @@ -1095,7 +1095,7 @@ floatx80 floatx80_tentox(floatx80 a, float_status *st= atus) 0, 0x8000, aSig, 0, status); } } else { /* |X| < 2^(-70) */ - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, float32_to_floatx80( @@ -1182,7 +1182,7 @@ floatx80 floatx80_tentox(floatx80 a, float_status *st= atus) fp0 =3D floatx80_add(fp0, fact2, status); fp0 =3D floatx80_add(fp0, fact1, status); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, adjfact, status); @@ -1227,9 +1227,9 @@ floatx80 floatx80_tan(floatx80 a, float_status *statu= s) return packFloatx80(aSign, 0, 0); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 compact =3D floatx80_make_compact(aExp, aSig); @@ -1294,7 +1294,7 @@ floatx80 floatx80_tan(floatx80 a, float_status *statu= s) fp1 =3D floatx80_add(fp1, fp3, status); /* FP1 is r :=3D (A-R)= +a */ goto loop; } else { - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_move(a, status); @@ -1354,7 +1354,7 @@ floatx80 floatx80_tan(floatx80 a, float_status *statu= s) xSign ^=3D 1; fp1 =3D packFloatx80(xSign, xExp, xSig); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_div(fp0, fp1, status); @@ -1392,7 +1392,7 @@ floatx80 floatx80_tan(floatx80 a, float_status *statu= s) make_float32(0x3F800000), status), status); /* 1+S(Q1+S(Q2+S(Q3+SQ4))) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_div(fp0, fp1, status); @@ -1438,9 +1438,9 @@ floatx80 floatx80_sin(floatx80 a, float_status *statu= s) return packFloatx80(aSign, 0, 0); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 compact =3D floatx80_make_compact(aExp, aSig); @@ -1509,7 +1509,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *statu= s) fp0 =3D float32_to_floatx80(make_float32(0x3F800000), status); /* 1 */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 /* SINTINY */ @@ -1582,7 +1582,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *statu= s) x =3D packFloatx80(xSign, xExp, xSig); fp0 =3D floatx80_mul(fp0, x, status); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, float32_to_floatx80(posneg1, status), = status); @@ -1632,7 +1632,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *statu= s) fp0 =3D floatx80_mul(fp0, x, status); /* R'*S */ fp0 =3D floatx80_mul(fp0, fp1, status); /* SIN(R')-R' */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, x, status); @@ -1678,9 +1678,9 @@ floatx80 floatx80_cos(floatx80 a, float_status *statu= s) return packFloatx80(0, one_exp, one_sig); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 compact =3D floatx80_make_compact(aExp, aSig); @@ -1748,7 +1748,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *statu= s) /* SINSM */ fp0 =3D float32_to_floatx80(make_float32(0x3F800000), status);= /* 1 */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 /* COSTINY */ @@ -1822,7 +1822,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *statu= s) x =3D packFloatx80(xSign, xExp, xSig); fp0 =3D floatx80_mul(fp0, x, status); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, float32_to_floatx80(posneg1, status), = status); @@ -1870,7 +1870,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *statu= s) fp0 =3D floatx80_mul(fp0, x, status); /* R'*S */ fp0 =3D floatx80_mul(fp0, fp1, status); /* SIN(R')-R' */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, x, status); @@ -1917,9 +1917,9 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) =20 compact =3D floatx80_make_compact(aExp, aSig); =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 if (compact < 0x3FFB8000 || compact > 0x4002FFFF) { @@ -1929,7 +1929,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) fp0 =3D packFloatx80(aSign, piby2_exp, pi_sig); fp1 =3D packFloatx80(aSign, 0x0001, one_sig); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_sub(fp0, fp1, status); @@ -1969,7 +1969,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) fp0 =3D floatx80_add(fp0, xsave, status); fp1 =3D packFloatx80(aSign, piby2_exp, pi_sig); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, fp1, status); @@ -1980,7 +1980,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) } } else { /* |X| < 1/16 */ if (compact < 0x3FD78000) { /* |X| < 2^(-40) */ - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_move(a, status); @@ -2020,7 +2020,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) /* X*Y*([B1+Z*(B3+Z*B5)]+[Y*(B2+Z*(B4+Z*B6))]) */ fp0 =3D floatx80_mul(fp0, fp1, status); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, xsave, status); @@ -2069,7 +2069,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) fp1 =3D floatx80_mul(fp1, fp2, status); /* A1*U*V*(A2+V*(A3+V)) */ fp0 =3D floatx80_add(fp0, fp1, status); /* ATAN(U) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, fp3, status); /* ATAN(X) */ @@ -2122,9 +2122,9 @@ floatx80 floatx80_asin(floatx80 a, float_status *stat= us) =20 } /* |X| < 1 */ =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 one =3D packFloatx80(0, one_exp, one_sig); @@ -2136,7 +2136,7 @@ floatx80 floatx80_asin(floatx80 a, float_status *stat= us) fp1 =3D floatx80_sqrt(fp1, status); /* SQRT((1+X)*(1-X)) */ fp0 =3D floatx80_div(fp0, fp1, status); /* X/SQRT((1+X)*(1-X)) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_atan(fp0, status); /* ATAN(X/SQRT((1+X)*(1-X)))= */ @@ -2192,9 +2192,9 @@ floatx80 floatx80_acos(floatx80 a, float_status *stat= us) } } /* |X| < 1 */ =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 one =3D packFloatx80(0, one_exp, one_sig); @@ -2206,7 +2206,7 @@ floatx80 floatx80_acos(floatx80 a, float_status *stat= us) fp0 =3D floatx80_sqrt(fp0, status); /* SQRT((1-X)/(1+X)) */ fp0 =3D floatx80_atan(fp0, status); /* ATAN(SQRT((1-X)/(1+X))) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, fp0, status); /* 2 * ATAN(SQRT((1-X)/(1+X)= )) */ @@ -2256,9 +2256,9 @@ floatx80 floatx80_atanh(floatx80 a, float_status *sta= tus) } } /* |X| < 1 */ =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 one =3D packFloatx80(0, one_exp, one_sig); @@ -2270,7 +2270,7 @@ floatx80 floatx80_atanh(floatx80 a, float_status *sta= tus) fp0 =3D floatx80_div(fp0, fp1, status); /* Z =3D 2Y/(1-Y) */ fp0 =3D floatx80_lognp1(fp0, status); /* LOG1P(Z) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, fp2, @@ -2315,9 +2315,9 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) return packFloatx80(aSign, 0, 0); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 if (aExp >=3D 0x3FFD) { /* |X| >=3D 1/4 */ @@ -2410,7 +2410,7 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) =20 sc =3D packFloatx80(0, m + 0x3FFF, one_sig); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, sc, status); @@ -2423,7 +2423,7 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) fp0 =3D float32_to_floatx80(make_float32(0xBF800000), status); /* -1 */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, float32_to_floatx80( @@ -2434,7 +2434,7 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) =20 return a; } else { - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 return floatx80_etox(a, status); @@ -2495,7 +2495,7 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) fp1 =3D floatx80_add(fp1, fp2, status); /* Q */ fp0 =3D floatx80_add(fp0, fp1, status); /* S*B1+Q */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, a, status); @@ -2513,14 +2513,14 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *= status) status); fp0 =3D floatx80_add(fp0, sc, status); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, float64_to_floatx80( make_float64(0x3730000000000000), status), status); } else { - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, sc, status); @@ -2565,9 +2565,9 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) return packFloatx80(aSign, 0, 0); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 compact =3D floatx80_make_compact(aExp, aSig); @@ -2576,7 +2576,7 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) /* TANHBORS */ if (compact < 0x3FFF8000) { /* TANHSM */ - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_move(a, status); @@ -2593,7 +2593,7 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) sign &=3D 0x80000000; sign ^=3D 0x80800000; /* -SIGN(X)*EPS */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, float32_to_floatx80(make_float32(s= ign), @@ -2615,7 +2615,7 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) fp0 =3D float32_to_floatx80(make_float32(sign | 0x3F800000= ), status); /* SIGN */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp1, fp0, status); @@ -2638,7 +2638,7 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) =20 fp1 =3D packFloatx80(vSign ^ aSign, vExp, vSig); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_div(fp0, fp1, status); @@ -2681,9 +2681,9 @@ floatx80 floatx80_sinh(floatx80 a, float_status *stat= us) return packFloatx80(aSign, 0, 0); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 compact =3D floatx80_make_compact(aExp, aSig); @@ -2691,7 +2691,7 @@ floatx80 floatx80_sinh(floatx80 a, float_status *stat= us) if (compact > 0x400CB167) { /* SINHBIG */ if (compact > 0x400CB2B3) { - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 return roundAndPackFloatx80(status->floatx80_rounding_precisio= n, @@ -2707,7 +2707,7 @@ floatx80 floatx80_sinh(floatx80 a, float_status *stat= us) fp0 =3D floatx80_etox(fp0, status); fp2 =3D packFloatx80(aSign, 0x7FFB, one_sig); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, fp2, status); @@ -2727,7 +2727,7 @@ floatx80 floatx80_sinh(floatx80 a, float_status *stat= us) =20 fact =3D packFloat32(aSign, 0x7E, 0); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, float32_to_floatx80(fact, status), status); @@ -2767,16 +2767,16 @@ floatx80 floatx80_cosh(floatx80 a, float_status *st= atus) return packFloatx80(0, one_exp, one_sig); } =20 - user_rnd_mode =3D status->float_rounding_mode; + user_rnd_mode =3D get_float_rounding_mode(status); user_rnd_prec =3D status->floatx80_rounding_precision; - status->float_rounding_mode =3D float_round_nearest_even; + set_float_rounding_mode(float_round_nearest_even, status); status->floatx80_rounding_precision =3D floatx80_precision_x; =20 compact =3D floatx80_make_compact(aExp, aSig); =20 if (compact > 0x400CB167) { if (compact > 0x400CB2B3) { - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; return roundAndPackFloatx80(status->floatx80_rounding_precisio= n, 0, 0x8000, one_sig, 0, status); @@ -2791,7 +2791,7 @@ floatx80 floatx80_cosh(floatx80 a, float_status *stat= us) fp0 =3D floatx80_etox(fp0, status); fp1 =3D packFloatx80(0, 0x7FFB, one_sig); =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_mul(fp0, fp1, status); @@ -2809,7 +2809,7 @@ floatx80 floatx80_cosh(floatx80 a, float_status *stat= us) fp1 =3D float32_to_floatx80(make_float32(0x3E800000), status); /* 1/4 = */ fp1 =3D floatx80_div(fp1, fp0, status); /* 1/(2*EXP(|X|)) */ =20 - status->float_rounding_mode =3D user_rnd_mode; + set_float_rounding_mode(user_rnd_mode, status); status->floatx80_rounding_precision =3D user_rnd_prec; =20 a =3D floatx80_add(fp0, fp1, status); diff --git a/target/ppc/fpu_helper.c b/target/ppc/fpu_helper.c index 850aca6ed1..c1bdde9e10 100644 --- a/target/ppc/fpu_helper.c +++ b/target/ppc/fpu_helper.c @@ -1616,7 +1616,7 @@ void helper_xsaddqp(CPUPPCState *env, uint32_t opcode, =20 tstat =3D env->fp_status; if (unlikely(Rc(opcode) !=3D 0)) { - tstat.float_rounding_mode =3D float_round_to_odd; + set_float_rounding_mode(float_round_to_odd, &tstat); } =20 set_float_exception_flags(0, &tstat); @@ -1688,7 +1688,7 @@ void helper_xsmulqp(CPUPPCState *env, uint32_t opcode, helper_reset_fpstatus(env); tstat =3D env->fp_status; if (unlikely(Rc(opcode) !=3D 0)) { - tstat.float_rounding_mode =3D float_round_to_odd; + set_float_rounding_mode(float_round_to_odd, &tstat); } =20 set_float_exception_flags(0, &tstat); @@ -1762,7 +1762,7 @@ void helper_xsdivqp(CPUPPCState *env, uint32_t opcode, helper_reset_fpstatus(env); tstat =3D env->fp_status; if (unlikely(Rc(opcode) !=3D 0)) { - tstat.float_rounding_mode =3D float_round_to_odd; + set_float_rounding_mode(float_round_to_odd, &tstat); } =20 set_float_exception_flags(0, &tstat); @@ -2095,7 +2095,7 @@ void helper_##op(CPUPPCState *env, ppc_vsr_t *xt, ppc= _vsr_t *s1, ppc_vsr_t *s2,\ float_status tstat =3D env->fp_status; = \ set_float_exception_flags(0, &tstat); = \ if (ro) { = \ - tstat.float_rounding_mode =3D float_round_to_odd; = \ + set_float_rounding_mode(float_round_to_odd, &tstat); = \ } = \ t.f128 =3D float128_muladd(s1->f128, s3->f128, s2->f128, maddflgs, &ts= tat); \ env->fp_status.float_exception_flags |=3D tstat.float_exception_flags;= \ @@ -2706,7 +2706,7 @@ void helper_XSCVQPDP(CPUPPCState *env, uint32_t ro, p= pc_vsr_t *xt, =20 tstat =3D env->fp_status; if (ro !=3D 0) { - tstat.float_rounding_mode =3D float_round_to_odd; + set_float_rounding_mode(float_round_to_odd, &tstat); } =20 t.VsrD(0) =3D float128_to_float64(xb->f128, &tstat); @@ -3306,7 +3306,7 @@ void helper_xssqrtqp(CPUPPCState *env, uint32_t opcod= e, =20 tstat =3D env->fp_status; if (unlikely(Rc(opcode) !=3D 0)) { - tstat.float_rounding_mode =3D float_round_to_odd; + set_float_rounding_mode(float_round_to_odd, &tstat); } =20 set_float_exception_flags(0, &tstat); @@ -3332,7 +3332,7 @@ void helper_xssubqp(CPUPPCState *env, uint32_t opcode, =20 tstat =3D env->fp_status; if (unlikely(Rc(opcode) !=3D 0)) { - tstat.float_rounding_mode =3D float_round_to_odd; + set_float_rounding_mode(float_round_to_odd, &tstat); } =20 set_float_exception_flags(0, &tstat); diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c index 5a3554dd71..c826702bf8 100644 --- a/target/riscv/vector_helper.c +++ b/target/riscv/vector_helper.c @@ -4270,9 +4270,9 @@ static uint64_t frec7(uint64_t f, int exp_size, int f= rac_size, s->float_exception_flags |=3D (float_flag_inexact | float_flag_overflow); =20 - if ((s->float_rounding_mode =3D=3D float_round_to_zero) || - ((s->float_rounding_mode =3D=3D float_round_down) && !sign= ) || - ((s->float_rounding_mode =3D=3D float_round_up) && sign)) { + if ((get_float_rounding_mode(s) =3D=3D float_round_to_zero) || + ((get_float_rounding_mode(s) =3D=3D float_round_down) && != sign) || + ((get_float_rounding_mode(s) =3D=3D float_round_up) && sig= n)) { /* Return greatest/negative finite value. */ return (sign << (exp_size + frac_size)) | (MAKE_64BIT_MASK(frac_size, exp_size) - 1); diff --git a/target/s390x/tcg/fpu_helper.c b/target/s390x/tcg/fpu_helper.c index 33e0f6100d..6ca0b7162b 100644 --- a/target/s390x/tcg/fpu_helper.c +++ b/target/s390x/tcg/fpu_helper.c @@ -62,7 +62,7 @@ static int s390_get_bfp_rounding_mode(CPUS390XState *env,= int m3) switch (m3) { case 0: /* current mode */ - return env->fpu_status.float_rounding_mode; + return get_float_rounding_mode(&env->fpu_status); case 1: /* round to nearest with ties away from 0 */ return float_round_ties_away; @@ -634,7 +634,7 @@ uint32_t HELPER(cxb)(CPUS390XState *env, Int128 a, Int1= 28 b) =20 int s390_swap_bfp_rounding_mode(CPUS390XState *env, int m3) { - int ret =3D env->fpu_status.float_rounding_mode; + int ret =3D get_float_rounding_mode(&env->fpu_status); =20 set_float_rounding_mode(s390_get_bfp_rounding_mode(env, m3), &env->fpu_status); diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c index d90f542ea2..2b6f66817e 100644 --- a/tests/fp/fp-bench.c +++ b/tests/fp/fp-bench.c @@ -615,7 +615,7 @@ static void set_soft_precision(enum rounding rounding) default: g_assert_not_reached(); } - soft_status.float_rounding_mode =3D mode; + set_float_rounding_mode(mode, &soft_status); } =20 static void parse_args(int argc, char *argv[]) diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c index c619e5dbf7..fdb0cccf14 100644 --- a/tests/fp/fp-test.c +++ b/tests/fp/fp-test.c @@ -967,7 +967,7 @@ void run_test(void) =20 verCases_roundingCode =3D 0; slowfloat_roundingMode =3D rmode; - qsf.float_rounding_mode =3D sf_rounding_to_qemu(rmode); + set_float_rounding_mode(sf_rounding_to_qemu(rmode), &qsf); =20 if (attrs & (FUNC_ARG_ROUNDINGMODE | FUNC_EFF_ROUNDINGMODE)) { /* print rounding mode if the op is affected by it */ diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 8253d480f5..ab9445ade8 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -300,7 +300,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, int exp; FloatExceptionFlags flags =3D 0; =20 - switch (s->float_rounding_mode) { + switch (get_float_rounding_mode(s)) { case float_round_nearest_even_max: overflow_norm =3D true; /* fall through */ @@ -441,7 +441,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, =20 if (p->frac_lo & round_mask) { /* Need to recompute round-to-even/round-to-odd. */ - switch (s->float_rounding_mode) { + switch (get_float_rounding_mode(s)) { case float_round_nearest_even: if (N > 64 && frac_lsb =3D=3D 0) { inc =3D ((p->frac_hi & 1) || @@ -568,7 +568,7 @@ FloatPartsN partsN(addsub)(const FloatPartsN *a_orig, =20 if (ab_mask =3D=3D float_cmask_zero) { /* 0 - 0 */ - a.sign =3D s->float_rounding_mode =3D=3D float_round_down; + a.sign =3D get_float_rounding_mode(s) =3D=3D float_round_down; return a; } =20 @@ -772,7 +772,7 @@ FloatPartsN partsN(muladd)(const FloatPartsN *a, const = FloatPartsN *b, return_sub_zero: /* 0 - 0 =3D=3D -0 for round_down, +0 otherwise. */ return (FloatPartsN){ - .sign =3D s->float_rounding_mode =3D=3D float_round_down, + .sign =3D get_float_rounding_mode(s) =3D=3D float_round_down, .cls =3D float_class_zero }; =20 diff --git a/tests/fp/wrap.c.inc b/tests/fp/wrap.c.inc index 9ff884c140..a67b390e5a 100644 --- a/tests/fp/wrap.c.inc +++ b/tests/fp/wrap.c.inc @@ -168,7 +168,7 @@ WRAP_SF_TO_128(qemu_f64_to_f128M, float64_to_float128, = float64) { \ type *ap =3D (type *)&a; \ \ - qsf.float_rounding_mode =3D sf_rounding_to_qemu(round); \ + set_float_rounding_mode(sf_rounding_to_qemu(round), &qsf); \ return func(*ap, &qsf); \ } =20 @@ -328,7 +328,7 @@ WRAP_INT_TO_80(qemu_i64_to_extF80M, int64_to_floatx80, = int64_t) floatx80 a; \ \ a =3D soft_to_qemu80(*ap); \ - qsf.float_rounding_mode =3D sf_rounding_to_qemu(round); \ + set_float_rounding_mode(sf_rounding_to_qemu(round), &qsf); \ return func(a, &qsf); \ } =20 @@ -360,7 +360,7 @@ WRAP_80_TO_INT_MINMAG(qemu_extF80M_to_i64_r_minMag, float128 a; \ \ a =3D soft_to_qemu128(*ap); \ - qsf.float_rounding_mode =3D sf_rounding_to_qemu(round); \ + set_float_rounding_mode(sf_rounding_to_qemu(round), &qsf); \ return func(a, &qsf); \ } =20 @@ -414,7 +414,7 @@ WRAP_INT_TO_128(qemu_i64_to_f128M, int64_to_float128, i= nt64_t) type *ap =3D (type *)&a; \ type ret; \ \ - qsf.float_rounding_mode =3D sf_rounding_to_qemu(round); \ + set_float_rounding_mode(sf_rounding_to_qemu(round), &qsf); \ ret =3D func(*ap, &qsf); \ return *(type##_t *)&ret; \ } @@ -431,7 +431,7 @@ static void qemu_extF80M_roundToInt(const extFloat80_t = *ap, uint_fast8_t round, floatx80 ret; =20 a =3D soft_to_qemu80(*ap); - qsf.float_rounding_mode =3D sf_rounding_to_qemu(round); + set_float_rounding_mode(sf_rounding_to_qemu(round), &qsf); ret =3D floatx80_round_to_int(a, &qsf); *res =3D qemu_to_soft80(ret); } @@ -443,7 +443,7 @@ static void qemu_f128M_roundToInt(const float128_t *ap,= uint_fast8_t round, float128 ret; =20 a =3D soft_to_qemu128(*ap); - qsf.float_rounding_mode =3D sf_rounding_to_qemu(round); + set_float_rounding_mode(sf_rounding_to_qemu(round), &qsf); ret =3D float128_round_to_int(a, &qsf); *res =3D qemu_to_soft128(ret); } --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177819233836036.68045225016283; Thu, 7 May 2026 15:18:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72E-0000pm-9w; Thu, 07 May 2026 18:17:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72D-0000pU-JE for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:33 -0400 Received: from mail-oo1-xc2a.google.com ([2607:f8b0:4864:20::c2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL729-0003Ci-CK for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:33 -0400 Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-696ad0c2c2dso758082eaf.0 for ; Thu, 07 May 2026 15:17:29 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192248; x=1778797048; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=KCo+wD8N44ZCWiLcNlX2vFV691X/Knl4fAZ2l88NYrw=; b=A0mOch3+1/VpDEaYCnVZxn+2jFOkOTma/JNS/OdVA6GjdXBBj58uwTIN5uMRqTB6it OZuuCLbJpQPpXnwNmX/Wrgii3dRWZlxW9fJIsQWPaIdvzs8IvveHfPBgRxc/yUT/8knx K56gWjSDWZJmwyHiA1XZ9IHqZnf64QtEd4lMyfuW+a1iNdXaodO1BNvS3vKDP/e3SOoE S49XWviZWQkW9wzxGwwR89q1737/fXzroiuQUgYD+He3VKiPKM3i4he95tWReszpN7Cu WLjPp7CeRLbPJ+gxC8+u5JxBm9M0+Rcx4uP/rbUeJouP+nB3jGMD/W4BMQ5ViD/zDTWm nmAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192248; x=1778797048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=KCo+wD8N44ZCWiLcNlX2vFV691X/Knl4fAZ2l88NYrw=; b=VWTFdnTYUl9KBr2Ky/4prMWCe+Y2bZ18kEagg6wXelZ/P4YGiNdD6fVw+IHsFf3i2u brwjS2paGMY/GyyFWqr0alIcMsryQOY8N0N4gttyhvkwOSXDouM8zoDhxzyYDZzp/dhT wzUWnZ2obOHmEXsF5ByKH8pGF/doU8psv2TzGPPfVar0SAGYp+5YtjDUe0EKje3GgXKn rEF7fRLibiOUeJDj+eyWbpIAa9CkThRDbttQdqnVSylnG5UFOBIVBzB6Tn3m2WiwfWcq NRTqU4uyDzQ28YQ90gdtk4xro3+vVuv2dritWCI8E42Qxd8t4dKjVYvLgy0+vowSmGd3 1rEg== X-Gm-Message-State: AOJu0YxN2gaWy9hWh6FMxX9H6tiorU9Tgea05lzfmoTn7lObdzO1gybS GOZ6tu9v8f+QaFwEW+pzhjQqVEpJgrarlDrk4X34i9ILOdexnocWI1wnfFvyAvV+JTTwxqrgBQg RxfZ8 X-Gm-Gg: AeBDievHd+5biRgnnAVoz027HzTnA9jERjuB9DD5uFjHiAtJMpYxfAQVY6trqHlyGbu VHAuGAJq63h/vP17v9KW410ptc4x4xT4FcG7TAy7wa4Qn+qLLhklYeZN4YRIsZqATlmyJPTV1bJ t6TspeBvZhJNMpHWak/QB/Y94v143ChT5tCFvEdqGcS6UAoMeGA46I1qZxuXsha8YsVTdxWuJYT ID4xe63uElXEbTrJ1+RhOikFR1pxSNQj7gJ3IDFwtOoPvPKBgXmB1ae9EjhXnHkMSMOQGfdalRk U+2b5MZil/2rQVxJAS3KPf5/gmWe/bBS0jhYeLv+6CNW2t6SfADlsDYloSkh7vCt0EwCAILevhk 0jHkyD3lah+ZRYL3KlUGg2qw020f3r/NZm4UGX/z5AU7PHoclvXgy8tFftTiVGvcq/ytPz8QGuE KEPdIOqb3HcZjsNWbvuRuyhxjIpMFBfA0ym5HvDlg2TZ6XoQ== X-Received: by 2002:a05:6820:1c91:b0:67e:ae5:732e with SMTP id 006d021491bc7-69998cfe0e9mr5068968eaf.36.1778192247771; Thu, 07 May 2026 15:17:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/18] fpu: Use of {get, set}_floatx80_rounding_precision everywhere Date: Thu, 7 May 2026 17:17:05 -0500 Message-ID: <20260507221717.486023-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c2a; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc2a.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1778192340074158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- fpu/softfloat.c | 10 +- target/i386/tcg/fpu_helper.c | 37 ++++--- target/m68k/softfloat.c | 208 ++++++++++++++++++----------------- tests/fp/fp-test.c | 2 +- 4 files changed, 130 insertions(+), 127 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 231b308b50..11ab26c7f6 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -1503,7 +1503,7 @@ float128 float128_round_pack_canonical(FloatParts128 = *p, float_status *s) bool floatx80_unpack_canonical(FloatParts128 *p, floatx80 f, float_status = *s) { /* Ensure rounding precision is set before beginning. */ - switch (s->floatx80_rounding_precision) { + switch (get_floatx80_rounding_precision(s)) { case floatx80_precision_x: case floatx80_precision_d: case floatx80_precision_s: @@ -1538,14 +1538,14 @@ bool floatx80_unpack_canonical(FloatParts128 *p, fl= oatx80 f, float_status *s) =20 floatx80 floatx80_round_pack_canonical(FloatParts128 *p, float_status *s) { - const FloatFmt *fmt =3D &floatx80_params[s->floatx80_rounding_precisio= n]; + const FloatFmt *fmt =3D &floatx80_params[get_floatx80_rounding_precisi= on(s)]; uint64_t frac; int exp; =20 switch (p->cls) { case float_class_normal: case float_class_denormal: - if (s->floatx80_rounding_precision =3D=3D floatx80_precision_x) { + if (get_floatx80_rounding_precision(s) =3D=3D floatx80_precision_x= ) { parts128_uncanon_normal(p, s, fmt, false); frac =3D p->frac_hi; exp =3D p->exp; @@ -2841,7 +2841,7 @@ floatx80 floatx80_round_to_int(floatx80 a, float_stat= us *status) } =20 p =3D parts128_round_to_int(&p, get_float_rounding_mode(status), 0, st= atus, - &floatx80_params[status->floatx80_rounding_p= recision]); + &floatx80_params[get_floatx80_rounding_preci= sion(status)]); return floatx80_round_pack_canonical(&p, status); } =20 @@ -4491,7 +4491,7 @@ floatx80 floatx80_sqrt(floatx80 a, float_status *s) if (!floatx80_unpack_canonical(&p, a, s)) { return floatx80_default_nan(s); } - parts128_sqrt(&p, s, &floatx80_params[s->floatx80_rounding_precision]); + parts128_sqrt(&p, s, &floatx80_params[get_floatx80_rounding_precision(= s)]); return floatx80_round_pack_canonical(&p, s); } =20 diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 7b0b0dd520..978eb1411b 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -1185,9 +1185,9 @@ void helper_f2xm1(CPUX86State *env) uint64_t asig0, asig1, asig2, bsig0, bsig1; FloatRoundMode save_mode =3D get_float_rounding_mode(&env->fp_stat= us); FloatX80RoundPrec save_prec =3D - env->fp_status.floatx80_rounding_precision; + get_floatx80_rounding_precision(&env->fp_status); set_float_rounding_mode(float_round_nearest_even, &env->fp_status); - env->fp_status.floatx80_rounding_precision =3D floatx80_precision_= x; + set_floatx80_rounding_precision(floatx80_precision_x, &env->fp_sta= tus); =20 /* Find the nearest multiple of 1/32 to the argument. */ tmp =3D floatx80_scalbn(ST0, 5, &env->fp_status); @@ -1290,7 +1290,7 @@ void helper_f2xm1(CPUX86State *env) &env->fp_status); } =20 - env->fp_status.floatx80_rounding_precision =3D save_prec; + set_floatx80_rounding_precision(save_prec, &env->fp_status); } merge_exception_flags(env, old_flags); } @@ -1406,10 +1406,10 @@ void helper_fpatan(CPUX86State *env) * (and underflowing where appropriate). */ FloatX80RoundPrec save_prec =3D - env->fp_status.floatx80_rounding_precision; - env->fp_status.floatx80_rounding_precision =3D floatx80_precision_= x; + get_floatx80_rounding_precision(&env->fp_status); + set_floatx80_rounding_precision(floatx80_precision_x, &env->fp_sta= tus); ST1 =3D floatx80_div(ST1, ST0, &env->fp_status); - env->fp_status.floatx80_rounding_precision =3D save_prec; + set_floatx80_rounding_precision(save_prec, &env->fp_status); if (!floatx80_is_zero(ST1) && !(get_float_exception_flags(&env->fp_status) & float_flag_inexact)) { @@ -1485,9 +1485,10 @@ void helper_fpatan(CPUX86State *env) floatx80 x8; FloatRoundMode save_mode =3D get_float_rounding_mode(&env->fp_= status); FloatX80RoundPrec save_prec =3D - env->fp_status.floatx80_rounding_precision; + get_floatx80_rounding_precision(&env->fp_status); set_float_rounding_mode(float_round_nearest_even, &env->fp_sta= tus); - env->fp_status.floatx80_rounding_precision =3D floatx80_precis= ion_x; + set_floatx80_rounding_precision(floatx80_precision_x, + &env->fp_status); =20 if (arg0_exp =3D=3D 0) { normalizeFloatx80Subnormal(arg0_sig, &arg0_exp, &arg0_sig); @@ -1794,7 +1795,7 @@ void helper_fpatan(CPUX86State *env) } =20 set_float_rounding_mode(save_mode, &env->fp_status); - env->fp_status.floatx80_rounding_precision =3D save_prec; + set_floatx80_rounding_precision(save_prec, &env->fp_status); } /* This result is inexact. */ rsig1 |=3D 1; @@ -2123,9 +2124,9 @@ void helper_fyl2xp1(CPUX86State *env) uint64_t asig0, asig1, asig2; FloatRoundMode save_mode =3D get_float_rounding_mode(&env->fp_stat= us); FloatX80RoundPrec save_prec =3D - env->fp_status.floatx80_rounding_precision; + get_floatx80_rounding_precision(&env->fp_status); set_float_rounding_mode(float_round_nearest_even, &env->fp_status); - env->fp_status.floatx80_rounding_precision =3D floatx80_precision_= x; + set_floatx80_rounding_precision(floatx80_precision_x, &env->fp_sta= tus); =20 helper_fyl2x_common(env, ST0, &aexp, &asig0, &asig1); /* @@ -2143,7 +2144,7 @@ void helper_fyl2xp1(CPUX86State *env) ST1 =3D normalizeRoundAndPackFloatx80(floatx80_precision_x, arg0_sign ^ arg1_sign, aexp, asig0, asig1, &env->fp_status); - env->fp_status.floatx80_rounding_precision =3D save_prec; + set_floatx80_rounding_precision(save_prec, &env->fp_status); } fpop(env); merge_exception_flags(env, old_flags); @@ -2226,9 +2227,9 @@ void helper_fyl2x(CPUX86State *env) floatx80 arg0_m1; FloatRoundMode save_mode =3D get_float_rounding_mode(&env->fp_stat= us); FloatX80RoundPrec save_prec =3D - env->fp_status.floatx80_rounding_precision; + get_floatx80_rounding_precision(&env->fp_status); set_float_rounding_mode(float_round_nearest_even, &env->fp_status); - env->fp_status.floatx80_rounding_precision =3D floatx80_precision_= x; + set_floatx80_rounding_precision(floatx80_precision_x, &env->fp_sta= tus); =20 if (arg0_exp =3D=3D 0) { normalizeFloatx80Subnormal(arg0_sig, &arg0_exp, &arg0_sig); @@ -2290,7 +2291,7 @@ void helper_fyl2x(CPUX86State *env) asig0, asig1, &env->fp_sta= tus); } =20 - env->fp_status.floatx80_rounding_precision =3D save_prec; + set_floatx80_rounding_precision(save_prec, &env->fp_status); } fpop(env); merge_exception_flags(env, old_flags); @@ -2368,14 +2369,14 @@ void helper_fscale(CPUX86State *env) } } else { int n; - FloatX80RoundPrec save =3D env->fp_status.floatx80_rounding_precis= ion; + FloatX80RoundPrec save =3D get_floatx80_rounding_precision(&env->f= p_status); int save_flags =3D get_float_exception_flags(&env->fp_status); set_float_exception_flags(0, &env->fp_status); n =3D floatx80_to_int32_round_to_zero(ST1, &env->fp_status); set_float_exception_flags(save_flags, &env->fp_status); - env->fp_status.floatx80_rounding_precision =3D floatx80_precision_= x; + set_floatx80_rounding_precision(floatx80_precision_x, &env->fp_sta= tus); ST0 =3D floatx80_scalbn(ST0, n, &env->fp_status); - env->fp_status.floatx80_rounding_precision =3D save; + set_floatx80_rounding_precision(save, &env->fp_status); } merge_exception_flags(env, old_flags); } diff --git a/target/m68k/softfloat.c b/target/m68k/softfloat.c index 51706f6db8..f5d683bcc5 100644 --- a/target/m68k/softfloat.c +++ b/target/m68k/softfloat.c @@ -72,7 +72,8 @@ floatx80 floatx80_getman(floatx80 a, float_status *status) normalizeFloatx80Subnormal(aSig, &aExp, &aSig); } =20 - return roundAndPackFloatx80(status->floatx80_rounding_precision, aSign, + return roundAndPackFloatx80(get_floatx80_rounding_precision(status), + aSign, 0x3FFF, aSig, 0, status); } =20 @@ -160,7 +161,7 @@ floatx80 floatx80_scale(floatx80 a, floatx80 b, float_s= tatus *status) =20 if (0x400F < bExp) { aExp =3D bSign ? -0x6001 : 0xE000; - return roundAndPackFloatx80(status->floatx80_rounding_precision, + return roundAndPackFloatx80(get_floatx80_rounding_precision(status= ), aSign, aExp, aSig, 0, status); } =20 @@ -168,7 +169,7 @@ floatx80 floatx80_scale(floatx80 a, floatx80 b, float_s= tatus *status) bSig >>=3D shiftCount; aExp =3D bSign ? (aExp - bSig) : (aExp + bSig); =20 - return roundAndPackFloatx80(status->floatx80_rounding_precision, + return roundAndPackFloatx80(get_floatx80_rounding_precision(status), aSign, aExp, aSig, 0, status); } =20 @@ -192,10 +193,11 @@ floatx80 floatx80_move(floatx80 a, float_status *stat= us) if (aSig =3D=3D 0) { return a; } - normalizeRoundAndPackFloatx80(status->floatx80_rounding_precision, + normalizeRoundAndPackFloatx80(get_floatx80_rounding_precision(stat= us), aSign, aExp, aSig, 0, status); } - return roundAndPackFloatx80(status->floatx80_rounding_precision, aSign, + return roundAndPackFloatx80(get_floatx80_rounding_precision(status), + aSign, aExp, aSig, 0, status); } =20 @@ -267,9 +269,9 @@ floatx80 floatx80_lognp1(floatx80 a, float_status *stat= us) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 compact =3D floatx80_make_compact(aExp, aSig); =20 @@ -337,7 +339,7 @@ floatx80 floatx80_lognp1(floatx80 a, float_status *stat= us) fp0 =3D floatx80_add(fp0, fp1, status); /* FP0 IS LOG(F) + LOG(1+U= ) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, klog2, status); =20 @@ -403,7 +405,7 @@ floatx80 floatx80_lognp1(floatx80 a, float_status *stat= us) status); /* U*V*([B1+W*(B3+W*B5)] + [V*(B2+W*B4= )]) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, saveu, status); =20 @@ -465,9 +467,9 @@ floatx80 floatx80_logn(floatx80 a, float_status *status) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 compact =3D floatx80_make_compact(aExp, aSig); =20 @@ -524,7 +526,7 @@ floatx80 floatx80_logn(floatx80 a, float_status *status) fp0 =3D floatx80_add(fp0, fp1, status); /* FP0 IS LOG(F) + LOG(1+U= ) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, klog2, status); =20 @@ -570,7 +572,7 @@ floatx80 floatx80_logn(floatx80 a, float_status *status) status); /* U*V*([B1+W*(B3+W*B5)] + [V*(B2+W*B4= )]) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, saveu, status); =20 @@ -621,15 +623,15 @@ floatx80 floatx80_log10(floatx80 a, float_status *sta= tus) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 fp0 =3D floatx80_logn(a, status); fp1 =3D packFloatx80(0, 0x3FFD, UINT64_C(0xDE5BD8A937287195)); /* INV_= L10 */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, fp1, status); /* LOGN(X)*INV_L10 */ =20 @@ -680,13 +682,13 @@ floatx80 floatx80_log2(floatx80 a, float_status *stat= us) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 if (aSig =3D=3D one_sig) { /* X is 2^k */ set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D int32_to_floatx80(aExp - 0x3FFF, status); } else { @@ -694,7 +696,7 @@ floatx80 floatx80_log2(floatx80 a, float_status *status) fp1 =3D packFloatx80(0, 0x3FFF, UINT64_C(0xB8AA3B295C17F0BC)); /* = INV_L2 */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, fp1, status); /* LOGN(X)*INV_L2 */ } @@ -740,9 +742,9 @@ floatx80 floatx80_etox(floatx80 a, float_status *status) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 adjflag =3D 0; =20 @@ -818,7 +820,7 @@ floatx80 floatx80_etox(floatx80 a, float_status *status) } =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, scale, status); =20 @@ -828,15 +830,13 @@ floatx80 floatx80_etox(floatx80 a, float_status *stat= us) } else { /* |X| >=3D 16380 log2 */ if (compact > 0x400CB27C) { /* |X| >=3D 16480 log2 */ set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); if (aSign) { - a =3D roundAndPackFloatx80( - status->floatx80_rounding_preci= sion, - 0, -0x1000, aSig, 0, status); + a =3D roundAndPackFloatx80(get_floatx80_rounding_preci= sion(status), + 0, -0x1000, aSig, 0, status); } else { - a =3D roundAndPackFloatx80( - status->floatx80_rounding_preci= sion, - 0, 0x8000, aSig, 0, status); + a =3D roundAndPackFloatx80(get_floatx80_rounding_preci= sion(status), + 0, 0x8000, aSig, 0, status); } float_raise(float_flag_inexact, status); =20 @@ -877,7 +877,7 @@ floatx80 floatx80_etox(floatx80 a, float_status *status) } } else { /* |X| < 2^(-65) */ set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(a, float32_to_floatx80(make_float32(0x3F800000), status), status); /* 1 + X */ @@ -923,9 +923,9 @@ floatx80 floatx80_twotox(floatx80 a, float_status *stat= us) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 fp0 =3D a; =20 @@ -935,18 +935,18 @@ floatx80 floatx80_twotox(floatx80 a, float_status *st= atus) /* |X| > 16480 or |X| < 2^(-70) */ if (compact > 0x3FFF8000) { /* |X| > 16480 */ set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 if (aSign) { - return roundAndPackFloatx80(status->floatx80_rounding_prec= ision, + return roundAndPackFloatx80(get_floatx80_rounding_precisio= n(status), 0, -0x1000, aSig, 0, status); } else { - return roundAndPackFloatx80(status->floatx80_rounding_prec= ision, + return roundAndPackFloatx80(get_floatx80_rounding_precisio= n(status), 0, 0x8000, aSig, 0, status); } } else { /* |X| < 2^(-70) */ set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, float32_to_floatx80( make_float32(0x3F800000), status), @@ -1028,7 +1028,7 @@ floatx80 floatx80_twotox(floatx80 a, float_status *st= atus) fp0 =3D floatx80_add(fp0, fact1, status); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, adjfact, status); =20 @@ -1073,9 +1073,9 @@ floatx80 floatx80_tentox(floatx80 a, float_status *st= atus) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 fp0 =3D a; =20 @@ -1085,18 +1085,18 @@ floatx80 floatx80_tentox(floatx80 a, float_status *= status) /* |X| > 16480 LOG2/LOG10 or |X| < 2^(-70) */ if (compact > 0x3FFF8000) { /* |X| > 16480 */ set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 if (aSign) { - return roundAndPackFloatx80(status->floatx80_rounding_prec= ision, + return roundAndPackFloatx80(get_floatx80_rounding_precisio= n(status), 0, -0x1000, aSig, 0, status); } else { - return roundAndPackFloatx80(status->floatx80_rounding_prec= ision, + return roundAndPackFloatx80(get_floatx80_rounding_precisio= n(status), 0, 0x8000, aSig, 0, status); } } else { /* |X| < 2^(-70) */ set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, float32_to_floatx80( make_float32(0x3F800000), status), @@ -1183,7 +1183,7 @@ floatx80 floatx80_tentox(floatx80 a, float_status *st= atus) fp0 =3D floatx80_add(fp0, fact1, status); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, adjfact, status); =20 @@ -1228,9 +1228,9 @@ floatx80 floatx80_tan(floatx80 a, float_status *statu= s) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 compact =3D floatx80_make_compact(aExp, aSig); =20 @@ -1295,7 +1295,7 @@ floatx80 floatx80_tan(floatx80 a, float_status *statu= s) goto loop; } else { set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_move(a, status); =20 @@ -1355,7 +1355,7 @@ floatx80 floatx80_tan(floatx80 a, float_status *statu= s) fp1 =3D packFloatx80(xSign, xExp, xSig); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_div(fp0, fp1, status); =20 @@ -1393,7 +1393,7 @@ floatx80 floatx80_tan(floatx80 a, float_status *statu= s) status); /* 1+S(Q1+S(Q2+S(Q3+SQ4))) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_div(fp0, fp1, status); =20 @@ -1439,9 +1439,9 @@ floatx80 floatx80_sin(floatx80 a, float_status *statu= s) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 compact =3D floatx80_make_compact(aExp, aSig); =20 @@ -1510,7 +1510,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *statu= s) status); /* 1 */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 /* SINTINY */ a =3D floatx80_move(a, status); @@ -1583,7 +1583,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *statu= s) fp0 =3D floatx80_mul(fp0, x, status); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, float32_to_floatx80(posneg1, status), = status); =20 @@ -1633,7 +1633,7 @@ floatx80 floatx80_sin(floatx80 a, float_status *statu= s) fp0 =3D floatx80_mul(fp0, fp1, status); /* SIN(R')-R' */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, x, status); =20 @@ -1679,9 +1679,9 @@ floatx80 floatx80_cos(floatx80 a, float_status *statu= s) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 compact =3D floatx80_make_compact(aExp, aSig); =20 @@ -1749,7 +1749,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *statu= s) fp0 =3D float32_to_floatx80(make_float32(0x3F800000), status);= /* 1 */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 /* COSTINY */ a =3D floatx80_sub(fp0, float32_to_floatx80( @@ -1823,7 +1823,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *statu= s) fp0 =3D floatx80_mul(fp0, x, status); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, float32_to_floatx80(posneg1, status), = status); =20 @@ -1871,7 +1871,7 @@ floatx80 floatx80_cos(floatx80 a, float_status *statu= s) fp0 =3D floatx80_mul(fp0, fp1, status); /* SIN(R')-R' */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, x, status); =20 @@ -1918,9 +1918,9 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) compact =3D floatx80_make_compact(aExp, aSig); =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 if (compact < 0x3FFB8000 || compact > 0x4002FFFF) { /* |X| >=3D 16 or |X| < 1/16 */ @@ -1930,7 +1930,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) fp1 =3D packFloatx80(aSign, 0x0001, one_sig); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_sub(fp0, fp1, status); =20 @@ -1970,7 +1970,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) fp1 =3D packFloatx80(aSign, piby2_exp, pi_sig); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, fp1, status); =20 @@ -1981,7 +1981,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) } else { /* |X| < 1/16 */ if (compact < 0x3FD78000) { /* |X| < 2^(-40) */ set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_move(a, status); =20 @@ -2021,7 +2021,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) fp0 =3D floatx80_mul(fp0, fp1, status); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, xsave, status); =20 @@ -2070,7 +2070,7 @@ floatx80 floatx80_atan(floatx80 a, float_status *stat= us) fp0 =3D floatx80_add(fp0, fp1, status); /* ATAN(U) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, fp3, status); /* ATAN(X) */ =20 @@ -2123,9 +2123,9 @@ floatx80 floatx80_asin(floatx80 a, float_status *stat= us) } /* |X| < 1 */ =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 one =3D packFloatx80(0, one_exp, one_sig); fp0 =3D a; @@ -2137,7 +2137,7 @@ floatx80 floatx80_asin(floatx80 a, float_status *stat= us) fp0 =3D floatx80_div(fp0, fp1, status); /* X/SQRT((1+X)*(1-X)) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_atan(fp0, status); /* ATAN(X/SQRT((1+X)*(1-X)))= */ =20 @@ -2171,7 +2171,8 @@ floatx80 floatx80_acos(floatx80 a, float_status *stat= us) } if (aExp =3D=3D 0 && aSig =3D=3D 0) { float_raise(float_flag_inexact, status); - return roundAndPackFloatx80(status->floatx80_rounding_precision, 0, + return roundAndPackFloatx80(get_floatx80_rounding_precision(status= ), + 0, piby2_exp, pi_sig, 0, status); } =20 @@ -2193,9 +2194,9 @@ floatx80 floatx80_acos(floatx80 a, float_status *stat= us) } /* |X| < 1 */ =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 one =3D packFloatx80(0, one_exp, one_sig); fp0 =3D a; @@ -2207,7 +2208,7 @@ floatx80 floatx80_acos(floatx80 a, float_status *stat= us) fp0 =3D floatx80_atan(fp0, status); /* ATAN(SQRT((1-X)/(1+X))) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, fp0, status); /* 2 * ATAN(SQRT((1-X)/(1+X)= )) */ =20 @@ -2257,9 +2258,9 @@ floatx80 floatx80_atanh(floatx80 a, float_status *sta= tus) } /* |X| < 1 */ =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 one =3D packFloatx80(0, one_exp, one_sig); fp2 =3D packFloatx80(aSign, 0x3FFE, one_sig); /* SIGN(X) * (1/2) */ @@ -2271,7 +2272,7 @@ floatx80 floatx80_atanh(floatx80 a, float_status *sta= tus) fp0 =3D floatx80_lognp1(fp0, status); /* LOG1P(Z) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, fp2, status); /* ATANH(X) =3D SIGN(X) * (1/2) * LOG1P(Z) */ @@ -2316,9 +2317,9 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 if (aExp >=3D 0x3FFD) { /* |X| >=3D 1/4 */ compact =3D floatx80_make_compact(aExp, aSig); @@ -2411,7 +2412,7 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) sc =3D packFloatx80(0, m + 0x3FFF, one_sig); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, sc, status); =20 @@ -2424,7 +2425,7 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) status); /* -1 */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, float32_to_floatx80( make_float32(0x00800000), status), @@ -2435,7 +2436,7 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) return a; } else { set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 return floatx80_etox(a, status); } @@ -2496,7 +2497,7 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *st= atus) fp0 =3D floatx80_add(fp0, fp1, status); /* S*B1+Q */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, a, status); =20 @@ -2514,14 +2515,14 @@ floatx80 floatx80_etoxm1(floatx80 a, float_status *= status) fp0 =3D floatx80_add(fp0, sc, status); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, float64_to_floatx80( make_float64(0x3730000000000000), status), status); } else { set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, sc, status); } @@ -2566,9 +2567,9 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 compact =3D floatx80_make_compact(aExp, aSig); =20 @@ -2577,7 +2578,7 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) if (compact < 0x3FFF8000) { /* TANHSM */ set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_move(a, status); =20 @@ -2594,7 +2595,7 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) sign ^=3D 0x80800000; /* -SIGN(X)*EPS */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, float32_to_floatx80(make_float32(s= ign), status), status); @@ -2616,7 +2617,7 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) status); /* SIGN */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp1, fp0, status); =20 @@ -2639,7 +2640,7 @@ floatx80 floatx80_tanh(floatx80 a, float_status *stat= us) fp1 =3D packFloatx80(vSign ^ aSign, vExp, vSig); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_div(fp0, fp1, status); =20 @@ -2682,9 +2683,9 @@ floatx80 floatx80_sinh(floatx80 a, float_status *stat= us) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 compact =3D floatx80_make_compact(aExp, aSig); =20 @@ -2692,9 +2693,9 @@ floatx80 floatx80_sinh(floatx80 a, float_status *stat= us) /* SINHBIG */ if (compact > 0x400CB2B3) { set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 - return roundAndPackFloatx80(status->floatx80_rounding_precisio= n, + return roundAndPackFloatx80(get_floatx80_rounding_precision(st= atus), aSign, 0x8000, aSig, 0, status); } else { fp0 =3D floatx80_abs(a); /* Y =3D |X| */ @@ -2708,7 +2709,7 @@ floatx80 floatx80_sinh(floatx80 a, float_status *stat= us) fp2 =3D packFloatx80(aSign, 0x7FFB, one_sig); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, fp2, status); =20 @@ -2728,7 +2729,7 @@ floatx80 floatx80_sinh(floatx80 a, float_status *stat= us) fact =3D packFloat32(aSign, 0x7E, 0); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, float32_to_floatx80(fact, status), status); =20 @@ -2768,17 +2769,18 @@ floatx80 floatx80_cosh(floatx80 a, float_status *st= atus) } =20 user_rnd_mode =3D get_float_rounding_mode(status); - user_rnd_prec =3D status->floatx80_rounding_precision; + user_rnd_prec =3D get_floatx80_rounding_precision(status); set_float_rounding_mode(float_round_nearest_even, status); - status->floatx80_rounding_precision =3D floatx80_precision_x; + set_floatx80_rounding_precision(floatx80_precision_x, status); =20 compact =3D floatx80_make_compact(aExp, aSig); =20 if (compact > 0x400CB167) { if (compact > 0x400CB2B3) { set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; - return roundAndPackFloatx80(status->floatx80_rounding_precisio= n, 0, + set_floatx80_rounding_precision(user_rnd_prec, status); + return roundAndPackFloatx80(get_floatx80_rounding_precision(st= atus), + 0, 0x8000, one_sig, 0, status); } else { fp0 =3D packFloatx80(0, aExp, aSig); @@ -2792,7 +2794,7 @@ floatx80 floatx80_cosh(floatx80 a, float_status *stat= us) fp1 =3D packFloatx80(0, 0x7FFB, one_sig); =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_mul(fp0, fp1, status); =20 @@ -2810,7 +2812,7 @@ floatx80 floatx80_cosh(floatx80 a, float_status *stat= us) fp1 =3D floatx80_div(fp1, fp0, status); /* 1/(2*EXP(|X|)) */ =20 set_float_rounding_mode(user_rnd_mode, status); - status->floatx80_rounding_precision =3D user_rnd_prec; + set_floatx80_rounding_precision(user_rnd_prec, status); =20 a =3D floatx80_add(fp0, fp1, status); =20 diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c index fdb0cccf14..326a1201f3 100644 --- a/tests/fp/fp-test.c +++ b/tests/fp/fp-test.c @@ -996,7 +996,7 @@ void run_test(void) =20 verCases_roundingPrecision =3D 0; slow_extF80_roundingPrecision =3D prec80; - qsf.floatx80_rounding_precision =3D qsf_prec80; + set_floatx80_rounding_precision(qsf_prec80, &qsf); =20 if (attrs & FUNC_EFF_ROUNDINGPRECISION) { verCases_roundingPrecision =3D prec80; --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192337; cv=none; d=zohomail.com; s=zohoarc; b=W0tV0VGHy1s+6F9nhadhGRCyTvW51v0Cd8a2VTcJMiGIt3FiT1FSRf4uc9iusPIOT39qTIm3jH3PCOPddqPhVnhOIy/3JecNmfc3TLQZUlF0UWQTeZlGB8i+sWCnXmRuy2U/3wB+Hob2XoZf9QRwQlPdg2RkCr6W9LZ8lO8bqDE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192337; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=g3dJawXa8mZF25lb4548tyk5sXY0Sa8giHPPus3KxDI=; b=dctJoM/q0TdNbO2kig6TR09RJmgTpuATs0vA8Xsu5RCurkNXzq7vNksyNKyFMiZjGa9bMm03csZTDlm0ZR8CA76K03yJo2UF3DcoEVreXDVapTts3elAn07djs6VDsxQ5XQIl2pJmn+CHllYMp0ko/YibP8JOLEbRpt+B/MJeHk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192337122582.2034789368286; Thu, 7 May 2026 15:18:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72G-0000rB-LV; Thu, 07 May 2026 18:17:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72E-0000pn-85 for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:34 -0400 Received: from mail-oa1-x30.google.com ([2001:4860:4864:20::30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72B-0003D1-Lf for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:33 -0400 Received: by mail-oa1-x30.google.com with SMTP id 586e51a60fabf-40ede943bf0so1070383fac.2 for ; Thu, 07 May 2026 15:17:31 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192249; x=1778797049; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=g3dJawXa8mZF25lb4548tyk5sXY0Sa8giHPPus3KxDI=; b=aMNBDDE+9dJ6V6ZMyUM1ZwVSLdDXmjZFRGRPzHhcgNGx9Sd/+Bcv10vXnRbACCL2lv M7U0M0vbI7HMIETgli1JibjNxAPgfEzDnF5TVp17Wb9q81of8f9F+1TTJRhtqiZ2CwTP nCvJqT5yL++nQ3k1weopZoOQgWduXW0NAcCPWoKp4sqi315saO8rCcR2I6L34xjkb649 br1twcm69p6S89JN9QFWrzSdTq1yo4s8kND8wu+y8gkcPvHdPAh/ZSG6W9i2OUwepTEb beP04P8zKHEkljj9ALHdsz6+39XAZJ/uN/2c0MsBOKwlShbaDsQjUb9g63e4eEDI6LgJ 5t1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192249; x=1778797049; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=g3dJawXa8mZF25lb4548tyk5sXY0Sa8giHPPus3KxDI=; b=T74yCgyeSrkz9C8/LIksgH3V2ykvsM7FqpM2yAPQ1rUdTCoXl2TYG1CfdXUImPFaqp WMfX3GIMXyEhF/YxhT4r79f7S/gCDuekSjmzs4xsiUurzy2xBkFTfQhUzqBGvCM5rsu6 zAzqhpo3/WBXX3VESgQoMDJRhguRclJLRIQ7VxpmrBq7V00D1+ikS5chpCgmimrPRjGE NVQeJcZIcHWTR+rsHtdHAJ9D5k+qVma5GTVm9JMqGl6mxLsvVS6PPj9Xo2+5CyKV/UpX j/I/OP0+fIYzyYPPO9vv07QnL2cc17i4eCjMbUe130+9Da/zTOAyWQLAGs6liIEya5yj wrLQ== X-Gm-Message-State: AOJu0YwscHQ3JDr2tEg3sWEQm8Bk1wW/pAi8/1hGc3ihw3G2cSD0tLJI fexL5i0NPjkJeLTaVXbQPq8VnJvTZIN+aP8uCiTcC8kT5CmA+/QsJXue6D7QVolRk7QlkSRqqK0 p4Q/E X-Gm-Gg: AeBDies78HtDA8enIj3x8lkrdBti9ZtTwRGyoRG07F7uRmC3O4OXALz577nn54n3SfA rEKFNsqFSA3CjhNuSi748ex+uF54pO2WOQtbfmMmrwGPVnXjaf890vmrPQh1HCv2Nf4yvCPNj4S X/vmDIBrw+EY4Zgk3Uj+oRBGGvFz2DGLHv97JlG15BNgrcOkyK7SqNRZMImLLfKHpp/bmtGBrVY PDuMnDuVIIEy/TLRbr1m/gE0D12I6cLxu39fr2soR3EFCqUYNAIgi5W1S8G9ZsWxppgk4Z/T/1k 42raf9RFiHYOm1NGXO4FRTCA//7MmRj17rFoU3SdOHSRw9cLrVYg3USjIPocRj8un2AQUIxNBSj SBTue2fa99QuKB9dPyWxDPSTGRQRvH80V6LD+tW4At6gHXo2dMXllfG907+jfw7s8fb1r0a7q9E 25bc8Ixit9jOM6WjxI82ChD8nqkcPmnP+jUn61ZGYkoN/J4Q== X-Received: by 2002:a05:6871:28a0:b0:417:5a8c:feba with SMTP id 586e51a60fabf-434f5866e4bmr6679257fac.12.1778192249256; Thu, 07 May 2026 15:17:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 07/18] fpu: Use get_floatx80_behaviour everywhere Date: Thu, 7 May 2026 17:17:06 -0500 Message-ID: <20260507221717.486023-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::30; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x30.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192338135158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat.h | 10 ++++++---- fpu/softfloat.c | 2 +- fpu/softfloat-parts.c.inc | 4 ++-- fpu/softfloat-specialize.c.inc | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h index 4ae4ddc799..e08d1c374d 100644 --- a/include/fpu/softfloat.h +++ b/include/fpu/softfloat.h @@ -1018,7 +1018,7 @@ static inline bool floatx80_is_infinity(floatx80 a, f= loat_status *status) bool intbit =3D a.low >> 63; =20 if (!intbit && - !(status->floatx80_behaviour & floatx80_pseudo_inf_valid)) { + !(get_floatx80_behaviour(status) & floatx80_pseudo_inf_valid)) { return false; } return (a.high & 0x7fff) =3D=3D 0x7fff && !(a.low << 1); @@ -1112,6 +1112,8 @@ static inline bool floatx80_unordered_quiet(floatx80 = a, floatx80 b, *-------------------------------------------------------------------------= ---*/ static inline bool floatx80_invalid_encoding(floatx80 a, float_status *s) { + FloatX80Behaviour rule =3D get_floatx80_behaviour(s); + if ((a.low >> 63) || (a.high & 0x7fff) =3D=3D 0) { /* Anything with the Integer bit set or the exponent 0 is valid */ return false; @@ -1119,12 +1121,12 @@ static inline bool floatx80_invalid_encoding(floatx= 80 a, float_status *s) =20 if ((a.high & 0x7fff) =3D=3D 0x7fff) { if (a.low) { - return !(s->floatx80_behaviour & floatx80_pseudo_nan_valid); + return !(rule & floatx80_pseudo_nan_valid); } else { - return !(s->floatx80_behaviour & floatx80_pseudo_inf_valid); + return !(rule & floatx80_pseudo_inf_valid); } } else { - return !(s->floatx80_behaviour & floatx80_unnormal_valid); + return !(rule & floatx80_unnormal_valid); } } =20 diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 11ab26c7f6..1be90c9c7c 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -1566,7 +1566,7 @@ floatx80 floatx80_round_pack_canonical(FloatParts128 = *p, float_status *s) =20 case float_class_inf: /* x86 and m68k differ in the setting of the integer bit. */ - frac =3D s->floatx80_behaviour & floatx80_default_inf_int_bit_is_z= ero ? + frac =3D get_floatx80_behaviour(s) & floatx80_default_inf_int_bit_= is_zero ? 0 : (1ULL << 63); exp =3D fmt->exp_max; break; diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index ab9445ade8..0406a38206 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -213,7 +213,7 @@ static void partsN(canonicalize)(FloatPartsN *p, float_= status *status, * how we uncanonicalize results. */ bool has_pseudo_denormals =3D fmt->has_explicit_bit && - (status->floatx80_behaviour & floatx80_pseudo_denormal_valid); + (get_floatx80_behaviour(status) & floatx80_pseudo_denormal_valid); =20 if (unlikely(p->exp =3D=3D 0)) { if (likely(fracN(eqz)(p))) { @@ -430,7 +430,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, } else { bool is_tiny =3D s->tininess_before_rounding || exp < 0; bool has_pseudo_denormals =3D fmt->has_explicit_bit && - (s->floatx80_behaviour & floatx80_pseudo_denormal_valid); + (get_floatx80_behaviour(s) & floatx80_pseudo_denormal_valid); =20 if (!is_tiny) { FloatPartsN discard; diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 29a2fdeb9b..91250bc5a1 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -223,7 +223,7 @@ floatx80 floatx80_default_inf(bool zSign, float_status = *status) * Whether the Integer bit is set in the default Infinity is * target dependent. */ - bool z =3D status->floatx80_behaviour & floatx80_default_inf_int_bit_i= s_zero; + bool z =3D get_floatx80_behaviour(status) & floatx80_default_inf_int_b= it_is_zero; return packFloatx80(zSign, 0x7fff, z ? 0 : (1ULL << 63)); } =20 --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192283; cv=none; d=zohomail.com; s=zohoarc; b=BqZiqCfAGMoI9un6/WBtj0RUZCecLlniYY3UWap/l0mfxnK1Rt3bMqzv8wkjUj//zrFdgkff9cG1nhbeDhNQsXiiKyXRhgXg4LlgS8fZckir8Y4C+3JhvXfIBujjVns7OfDia7j+vqf/C8N/6pEYWLnjx8ZCaRsLng6/WLE18Q0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192283; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=s1EGlKjHauv/m/x0LCQ+RWfPuZ6/ygY2+9s9UxJlW7A=; b=Z9y9CLw0jcgRS/NQTmfaAwxzi6nk/H+DIhSkawgZU8eXQDQSSgogkDdMI8sCfftquo7d0+tA3f1WJoRUolCwh4wwHfuWSMfc6A33wsfSf8tLnJR7+vwl9Sz0NEtv3Owzci8h1FAhouLk8NeW+aPVDt+6H8dUqEFth3oErSPn9QM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177819228341127.21159396128212; Thu, 7 May 2026 15:18:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72F-0000qj-VM; Thu, 07 May 2026 18:17:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72D-0000pd-VI for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:33 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72B-0003Cz-IQ for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:33 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-4043b27ddeaso701430fac.1 for ; Thu, 07 May 2026 15:17:31 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192250; x=1778797050; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=s1EGlKjHauv/m/x0LCQ+RWfPuZ6/ygY2+9s9UxJlW7A=; b=PzJMcE+71RhBXYrfX9sy3AA/lizT1tE6mmxPbJpLyr8jk0APmtWnTXQyxq9wCQB843 HMl/E3FV3DnjUgDK8HhUEa9otFa+YChnrFYLv2vKtjQzsd8YdlR7nJdEbGuH1gpsUl6r deODTyukE/s+jE64ooDq+94wT/0r/y5IsP3l+bDFbYSiOSwp0uhaOPBea3qy5drhuiBl +UZdMucW4sjXyfIqWTXIJ1CqAbqtPp0BKVmHhE8TLggE0FhsWN0L/+MxQy6pPlQfX5Sy wffUQfx2dmmxXJuSEohdaa0XFpbbDIFaeJrCNRTQHXkGvnbf5IdeNdtzAl1Twrf1gC9t 2LGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192250; x=1778797050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=s1EGlKjHauv/m/x0LCQ+RWfPuZ6/ygY2+9s9UxJlW7A=; b=B1FsANnl0l/PupAGyyp0U3foA2JrI46koC/9E+v/PyUoxEkKxbI8XnK3LiR9w1dYyM EIiqV19hW/UKjfYTIb0neRqM5REP19klZlA5934ukA4RsN7zvD9iHqbjN7P4MrDlWOqs Ejy93GWuinNa+VIJo7fhewh9DhFcfsUFXnGYJyZg0L7JDoMWOo83LeNw0pBwIVxBZezB PRyzFTtNBBOb8z178Z2qpzTzlEUmN8GMxu9OYZzBgwRt4Vul9s4dJGNN4BsU70FAjHbp cNl3vmOXGsdcd0PWZ2TqFjsetV48LIfTnyEjdA4bYksW7R+TuS1HzQqI/BQN/mwggeVo bc9w== X-Gm-Message-State: AOJu0YxNQ+1uNApO8D2OFZoSkRJL264wzhMohtF1TTFi7381y+7M7ykz Usk3yLotkbdz2vwgxaCwl59CAOcBY9KFR0WUp4sGpZEGvt2t4LM1Q+oeV3oWxuJxJPUlxTa/TnT iYKMi X-Gm-Gg: AeBDietuO38SObDsWvCrL4HlAysHXp+Msg/hI0UNzTyG2V8/8SZwdE3EL1aWqFA2IlR plghcwfHL6bJCbSO8jJZwEhMWL3hrWRF0TMSeF7nnFmuJreOVfmGgq6EVeZLKuelyKtQRd3N8AV yrJQNkIJLPEfkoVKcwOU+8HL/9DZim7awX+6voKoY5mJIOmrCcCYFve6sFKZYSS0Bo3EoBkmHmd sm6eaKkXqWefxUSBKShw54wlwg+ZfBpxBKX6oTfUzp223JnEiZeSiZABW6R7o9S7ZvJTeZJTLGQ q14u0f513v9FORyfz9Uk00UmQY6AncpHuB/ISTJrg3/Ao3ScNn35LovKJeGGUA8TqIZQdJedEEM f1yfk8my0sHbfY/03Wq2QxjP40BtmJEClrcsFiysq0rBn+uQcVeFPfhLLmfa1b1b6uw4Yy0V565 hU0DGwD5edEGHqU7sDSjShkg20lQC6Qv/EZ1pVaQD7HR96ww== X-Received: by 2002:a05:6871:4e46:b0:42c:a86:abd0 with SMTP id 586e51a60fabf-434f66d107cmr6556352fac.30.1778192250204; Thu, 07 May 2026 15:17:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 08/18] fpu: Use get_float_2nan_prop_rule in partsN_pick_nan Date: Thu, 7 May 2026 17:17:07 -0500 Message-ID: <20260507221717.486023-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2a.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192283948158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- fpu/softfloat-parts.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 0406a38206..ed28262aba 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -53,7 +53,7 @@ FloatPartsN partsN(pick_nan)(const FloatPartsN *a, const = FloatPartsN *b, return partsN(default_nan)(s); } =20 - switch (s->float_2nan_prop_rule) { + switch (get_float_2nan_prop_rule(s)) { case float_2nan_prop_s_ab: if (have_snan) { ret =3D is_snan(a->cls) ? a : b; --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192321; cv=none; d=zohomail.com; s=zohoarc; b=J3kZMmArQ2j2LpDC6a0cqEbad0acjOtugOY3IJ+3oC57Ivb3TbdYOwxRaifnvZvJ1T12Z0gpygHbF2sclT1yxlpKgp3+8mdAnTxHdDQHV9x1JDSj6BGJvXZAVOWCoW01vBwQKGtciml/uZxTO2uJACQ2Dm6QkcpntCNjcHmhcr0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192321; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=UH45RYPjBMezm0+7sjNDgFLgzbFhfUGKizw3De6+epY=; b=inHwiLSZwMgonEda4l29BgZrVNkflqbCziVhzr3zkmVdJTk51r3AjAOMjVfi0iDUHDidbFgJPjk7smNoaUt7Kj0EgGCzmvEYpjIbZvvqXpY+OWZfCoOaKvi/VI1YWPD38eAtQnggFptsez7VCQ1+I3NSLySomfkXv48BJWiJc9U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192321405100.2240277674232; Thu, 7 May 2026 15:18:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72G-0000qk-7I; Thu, 07 May 2026 18:17:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72F-0000qZ-9q for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:35 -0400 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72D-0003DS-Jn for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:34 -0400 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-7df05fc49e5so1408350a34.3 for ; Thu, 07 May 2026 15:17:33 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192252; x=1778797052; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=UH45RYPjBMezm0+7sjNDgFLgzbFhfUGKizw3De6+epY=; b=nu5kkEO5bf+O4ke2667mvnybegSJCU29KF9AWoyQeYQLC6GRyRoZrKgRxSMjwEUVR+ yVJjp79lg61wPgSuWM9g+SDqEqWz8dW+9TBquKN1RXraaS/4iT+ZlgPlgkHUrAAfH3WU xo7iwx6Fx+K1VZweJs3o3zdihcYeLmzlMDWELzs9EP6Nmoc4Ng5DR5NFi3nCGl0msh5e iEmVyxsqUmrlYennuD3dSuIk4yrFhZTqYqbtEhMZDMqCnQVRo5xkQRp6MtKnqoO0sToO TlBQHNTmtcK0CnGUE3BKNAMVWnZLoi/NPptvtz3jxDTI5/vB1aI4AwlR0tE4C9C6+Lz5 N+Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192252; x=1778797052; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=UH45RYPjBMezm0+7sjNDgFLgzbFhfUGKizw3De6+epY=; b=c313OkM0gtJR1dymEF5S5Agt+sRJP4Rxagyz0KmO+zz+CrAMKYtERxXWsU/mgPwkI2 NSer/T+z9zbNgYfpOCTf97VYao/ZvLtgtbWNXk+RV/PG7albs9yRSKeSspek+LUEpYoL 2lgk9dtBXuN/pUcir9TKE/Jds88Gh5n9MvB0RL8OJLiD6hBfdFYQjsMngU+clB0yOyg2 MGLhnit/ktVBlzVUMxCmn22OhmHt9Ynb+OTP4TwTt7ro4eH5TsFYQGvglXVarIWM5Kw3 sxm04MEUFpOh90IwXIN5pceyGn8bzonlIhrm6adDaPzTYBvvMAn40EY8QaLnrZwPhnwm 2UfQ== X-Gm-Message-State: AOJu0YzPxkuYN2Vbuy7GEWmQTiK+bsmlXQXNf73Nwo704kkqG7AM5bA7 87kHHF22/+cfqu7XKwIn6Jxbc9VTgZUaG6jNwLh4GUp/8ECHOCCzIu7t7oB3nCHxkEdlqQuuRvK QiqD4 X-Gm-Gg: AeBDieuf3IynE7M/iRUuWddv/w+3Dn5dEPa28Ip0LGlu++r82Ln+84MhIs9z8f8PtOM CY3pAdGOaLouNHSz0bmHDOg8Znm/C7dgFxb/hn26ucG+Cm4dA1QkzGxziJjcw70hl3a5O8DG7Tg KGfB7qQx/0/orelm8nGC1oYCiY/ZwZ13vZTd+z96lHtMnjpSM+qFDbZvzMDaN2DFP2GdriJcUnm wSegcDAROs1YjRseOd/xEYXHAP08xeOl7CviuRX3Ug9g8WqztFiz87qXbksPtqEgTvuZQrK64u6 fhNdp9gVn+yPJrYMYW0jIuuXW/RrSraXMcSVR7JcoQLNsHQnBdVv+fsCcd7l8gyL7ylASfmj5mG EjDFeVMUMU9j+myvrAAJs/aW4CxJhgIe9/oqssrytmNup0haQbN2fTvxh5bIR69ddIJXm27TsrU 8kCFVjTKpOD/siGrNks3UvURjlkYy2Xhu3XW2hobCWj4KjMw== X-Received: by 2002:a05:6820:f026:b0:696:1a25:fdda with SMTP id 006d021491bc7-69998cf6a75mr5446611eaf.26.1778192251822; Thu, 07 May 2026 15:17:31 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/18] fpu: Use get_float_3nan_prop_rule in partsN_pick_nan_muladd Date: Thu, 7 May 2026 17:17:08 -0500 Message-ID: <20260507221717.486023-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::330; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x330.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192322139158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- fpu/softfloat-parts.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index ed28262aba..1d8a98358c 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -163,7 +163,7 @@ static FloatPartsN partsN(pick_nan_muladd)(const FloatP= artsN *a, ret =3D c; } else { const FloatPartsN *val[R_3NAN_1ST_MASK + 1] =3D { a, b, c }; - Float3NaNPropRule rule =3D s->float_3nan_prop_rule; + Float3NaNPropRule rule =3D get_float_3nan_prop_rule(s); =20 assert(rule !=3D float_3nan_prop_none); if (have_snan && (rule & R_3NAN_SNAN_MASK)) { --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192381; cv=none; d=zohomail.com; s=zohoarc; b=hocCU1bffxbt6lFAealQvL3exNHpDu019oXqUIReTiPzvK7U4Lig76pTsD0wKRDvUXU8+R/qPHYADSIh4jHVZoDKgjE4RkCJ3Tm/BHlHxuOMTJ3dIJa8cPDRC6HuGbXnxKo/Nt1YFtJgvOQOulI0I6IUq/nV252jWyNFufuBrfU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192381; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=6mhxD7cbQ/YZv44JJy0FmHUyr5nrKMnYo0KO5fHYf+A=; b=Cg4i2aSy5Ig2n73KJLhGKVr0gR5QIRdM37OEB7gFoLu1NI50algFXPB5Uhj11i0mbBS3qpHinvcYzDQQlFyweZQ/T0QZvFo7XEok+g5i5VVl8eIQVeeEz+TLJwRzGIze8XUeK8z4HeX5ejGhkipY0nuUozeUbcKB4ajYuZ89ts0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192381120492.28790478718827; Thu, 7 May 2026 15:19:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72I-0000rr-Bk; Thu, 07 May 2026 18:17:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72G-0000qm-7A for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:36 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72E-0003E1-AU for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:35 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-40ede943bf0so1070424fac.2 for ; Thu, 07 May 2026 15:17:33 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192253; x=1778797053; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=6mhxD7cbQ/YZv44JJy0FmHUyr5nrKMnYo0KO5fHYf+A=; b=jEm1CDW+k0NCN/Zx4K7xp7a7GGaiuth1ByyQvOOeLIQ0n2qivpAf+kj1xWTZxfDdYo IBJmQImwr9W/tt/isUgOhtyhBv920jIHsGwdLSUn97uJQ4HN3j52W6e9rpKq6kaRCsRa 9N8CGVoBnsfPFtW4eX7U3iYAcjKM5aUU8gRcaZb3CuN3hHsLAsrhUhFBaB3uq1dQCmxo ecL6RWCNFgugy3ENVk29Uuo2bMJDMSmge7UqvIyrXUSoOH7JxMBEhfAo6yjtvAfN15QH iZLwa9nl8PoUF/IhPGpgCRmhkuHn92KIPyIfWF3zqB9YARHopVoG68Nx/hUoO0Nje0nK ecxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192253; x=1778797053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=6mhxD7cbQ/YZv44JJy0FmHUyr5nrKMnYo0KO5fHYf+A=; b=a5GyiF5TcNB+hOdCpEJWzZU2BVE+H4U43nrnf3FmgsISrnhqy9zQJE5d9Na9swh8LE 4zvP6at2bJ13ffQqaQYE//OyfTh/j4M6Whvx0sVrOCJ2Y6C2qjh/IZZ5DPIN11rzz1nA QGnbOciAfy0DalYAVcl0P0ulMy3HTnSsl5H0t+V2CjYpM0CQebBzFakZCQ99K21aPZtY KdQLbRsH1C8ByX246tIUkEGIsWw7zksmfqjcdaU7pRLS+upvUtMXgHkac5Ai0NgvcAHg p5Fr5oq8tP6XATPSRF5ynfj45k2bVVDdc+zdKnd4E/uq3mxwy0b/S7amVxxQ0Ii4tNEE bYyg== X-Gm-Message-State: AOJu0Yx0Dq2VJowl14GsrtqvLAB9jXxqo4JyNfXlDMG0o1g5r5pJwEOD 2z+ZNXh3t++C9xtw/zC40tfIq2r19fr71iFzwbCL/SHVXs8eXGw7kiv59xv+bmPjsqhHfZ6DpMq 2uCeW X-Gm-Gg: AeBDies/vRvr6w9KtL+Md1Z5yhLn5cXmbCCcleomFAX+sdXTuTfW2u1vW8XQy4+1jGD DTAS8jGejAHcBNbil7UvmrbuDsB4vOZ3cpWxLd5daeLr5VvyR2XBrIEKEIlv1+sT5OByETy8kNt MxfVldNGYdO4v6pDb1laD54vMwqfHKp7WyzqslzKpMRprjt8cU2hajwV4FhRMYwXVCyoQLLSFIv LO4B/+0RRd6mMF93uK/ZrdnTvPq2n5tRkY/H6rk5jjo2MIvySqghzgqbTDSJkRLphfm/evnP6Z9 ammyFQ9lkF8eql5jz6Oh2BcDBFpLLzti0gHyWkS0Ah4Y+3m0txuRfbwXEr18e4PPRf1kyWHOexo xRY+P6R0QLONKfJWsLHHFxKCIUpo0DQmgyNQg5BcVTAL1/crUf3I1CLNw4urTf7l3ElDRzCPG+p VSCEc8Oaa4sd25Byq0A+tHc9/8x5CpWxa6cYwe44nN9c8dcQ== X-Received: by 2002:a05:687c:20e7:b0:42f:ca4a:e7ab with SMTP id 586e51a60fabf-434f65fcea6mr6931479fac.37.1778192253030; Thu, 07 May 2026 15:17:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 10/18] fpu: Use get_float_infzeronan_rule in partsN_pick_nan_muladd Date: Thu, 7 May 2026 17:17:09 -0500 Message-ID: <20260507221717.486023-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2a.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192382388158500 Content-Type: text/plain; charset="utf-8" Deduplicate the uses to a local variable. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- fpu/softfloat-parts.c.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 1d8a98358c..38b317c1a7 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -122,14 +122,14 @@ static FloatPartsN partsN(pick_nan_muladd)(const Floa= tPartsN *a, { bool infzero =3D (ab_mask =3D=3D float_cmask_infzero); bool have_snan =3D (abc_mask & float_cmask_snan); + FloatInfZeroNaNRule izn_rule =3D get_float_infzeronan_rule(s); const FloatPartsN *ret; =20 if (unlikely(have_snan)) { float_raise(float_flag_invalid | float_flag_invalid_snan, s); } =20 - if (infzero && - !(s->float_infzeronan_rule & float_infzeronan_suppress_invalid)) { + if (infzero && !(izn_rule & float_infzeronan_suppress_invalid)) { /* This is (0 * inf) + NaN or (inf * 0) + NaN */ float_raise(float_flag_invalid | float_flag_invalid_imz, s); } @@ -147,7 +147,7 @@ static FloatPartsN partsN(pick_nan_muladd)(const FloatP= artsN *a, * Inf * 0 + NaN -- some implementations return the * default NaN here, and some return the input NaN. */ - switch (s->float_infzeronan_rule & ~float_infzeronan_suppress_inva= lid) { + switch (izn_rule & ~float_infzeronan_suppress_invalid) { case float_infzeronan_dnan_never: break; case float_infzeronan_dnan_always: --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192339; cv=none; d=zohomail.com; s=zohoarc; b=YHu2bAoc9DOXH33AO7wsyY2jzxtNuWYLe7CYY0h/p5JX16SsD3AvdzcCwSrloFkiz6A2iHPAIbkj0oWBjyB2lkl6sIox3BMQuxOKro4/wcNlt2GknbBRVndNEyJsmtGG8yV/KRig/GCWOTnRCqKokkhIJBOcMloyEOqbRRtN8wg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192339; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=m63KohySy09FkFyyCZ8fbqOzqD49GaHFi9mPn3TK+k4=; b=JvrvltFuuOLXxSyxm1hYVMUU+sYNaPEORX/G6kXRll7iYAjj5Y/yc3KMtKtru1DiRgRwQg0MYysxTcGm/shrLn99gFuqhxGyCCR9PIwgRet0muZQzAe/K9ClSnrbatgwlGRwQU30XVcyXNeFK0UJmlVH/6RqxEgQ7MTlxKbk+AU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192339983310.8422133251695; Thu, 7 May 2026 15:18:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72K-0000s7-3a; Thu, 07 May 2026 18:17:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72I-0000ru-Qw for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:38 -0400 Received: from mail-oo1-xc34.google.com ([2607:f8b0:4864:20::c34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72G-0003Ex-BF for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:38 -0400 Received: by mail-oo1-xc34.google.com with SMTP id 006d021491bc7-6949f3eeaf6so1216157eaf.0 for ; Thu, 07 May 2026 15:17:35 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192254; x=1778797054; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=m63KohySy09FkFyyCZ8fbqOzqD49GaHFi9mPn3TK+k4=; b=W2W0yGCl6FQ8aNgjA9zd63DmAWbjllVLHP2kgd+jbNEpyCMPjUp7SdPyu/ANoHh+lg wp9NGXkTX5/CaTN3oVVyKfOyBOxY7tasBYRFAeDDrvd3D+b2x3CgEeZMBYuVHfpLFZTn 2eUYDOrGDyEBn+D76hAn1z+x+iITfMJZMwblPq0kKmTR8z9EE28ka6Fr5biZ42jrNvkC qkvcMC+pV41AMsqGPuh3EKA4h9BBMdrSfkzg+uzHvH5e7SAPBKiDhb2UlwPya7P7LfFO 26oSfshq+O8rJYzdnD9Gfjb92SNlEUDhJkwZsG+DEoqzvEUUXoj1SCOIx3Umzo3Q/Fin ZxIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192254; x=1778797054; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=m63KohySy09FkFyyCZ8fbqOzqD49GaHFi9mPn3TK+k4=; b=V3x6P8HDuJ4o6SwPsNmX3SNFiR1j05cg9730TM4TnHwRySUiXMrM/TShxK8q9zuE3G bSUowZIv2KVKDaemBXxvQ6FBynkYOyplCtslV4IglhuzYw3xJTb8rJ+kOOJF29LPoxel 8bs0torto5aqGLPHHTLwAdOvbwxtMg8Gs2KCrdn6cs9hrxjC6i+ezJsIRMF1EJlPSqsZ XYN0E6m2TszAKBcSFIJ3mP6dr5dVU65hYuVasbrb8E4VyDL1asAqw0YdQF1qwHDdYNdC 3Ckokssl1vpeSeMsSL4sXhW1HT0LvcD/676l/XjTGw36r/7WDNGh1Ib6FDhMlaG0it09 22tQ== X-Gm-Message-State: AOJu0YyebAFYpYE2PSp63W0Q2q5zDbfl2ZaO9LpY92XELT4ze0/RSvb4 C8ro9A5gXdUQfs89152YeqV2IYVHfXxCgATPDZ6nbDlFBpMJR7lq9nx0ZMZ2JTgCU5HNeyHGAed y+o8b X-Gm-Gg: AeBDiesgeBcCboFp5K5I1wMcDxUaiDibaws+Jt4dLp4XG7zjP8YfaA1XerZg1EvUSxc Jvdt49i8N1L0hfGeac3h2R3VVGallRSd0cNyvarGK5FP9v/edGQU+qwGpPQ+Ved8pS5Bqx3CJor ah0+Wjma46GxWibUCZx9UrGzVdU3FV+PNYQzpsEE3jLfGrDCNfc6N0/L5cJucw/fMaobxR/IrsI FFOxw9IPPjNCHJBlvW7iodPny+YrToPr6r1dCpivE3CNpqO9H+2a4npZ5lH83lxJFZzg+1bYTDz xGF3t555yxTcst9HYd6em/cBUt3h1eWuAnKdl7PYtPb+Knn7fKqnRp9R5RC+1tzpFjZZ/7ruL3+ KHydSCz8yKSigz07Yr8x0yYqgFQgnA/ewKkzbi1Ge7NXeVCRhZWOt4tqBQhSkjX6zy9Ofm/Z63e alp48iviar84NOdxY/SxMGtyNMmtY5I5/i340GNi60wSkyIw== X-Received: by 2002:a05:6820:c8f:b0:67d:e6fa:4488 with SMTP id 006d021491bc7-699ab64e49dmr2547814eaf.22.1778192254263; Thu, 07 May 2026 15:17:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/18] fpu: Use accessors for tininess_before_rounding Date: Thu, 7 May 2026 17:17:10 -0500 Message-ID: <20260507221717.486023-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c34; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc34.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192341906154100 Content-Type: text/plain; charset="utf-8" Rename get_float_detect_tininess to get_tininess_before_rounding and move to softfloat.c, as there are no external users. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat-helpers.h | 5 ----- fpu/softfloat.c | 4 ++-- tests/fp/fp-test.c | 2 +- fpu/softfloat-parts.c.inc | 2 +- fpu/softfloat-specialize.c.inc | 5 +++++ 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helper= s.h index 95edd22842..395ce67abf 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -132,11 +132,6 @@ static inline void set_snan_rule(FloatSNaNRule val, fl= oat_status *status) status->float_snan_rule =3D val; } =20 -static inline bool get_float_detect_tininess(const float_status *status) -{ - return status->tininess_before_rounding; -} - static inline FloatRoundMode get_float_rounding_mode(const float_status *s= tatus) { return status->float_rounding_mode; diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 1be90c9c7c..b1c2b0e6e1 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -4911,7 +4911,7 @@ floatx80 roundAndPackFloatx80(FloatX80RoundPrec round= ingPrecision, bool zSign, float_raise(float_flag_output_denormal_flushed, status); return packFloatx80(zSign, 0, 0); } - isTiny =3D status->tininess_before_rounding + isTiny =3D get_tininess_before_rounding(status) || (zExp < 0 ) || (zSig0 <=3D zSig0 + roundIncrement); shift64RightJamming( zSig0, 1 - zExp, &zSig0 ); @@ -4985,7 +4985,7 @@ floatx80 roundAndPackFloatx80(FloatX80RoundPrec round= ingPrecision, bool zSign, return floatx80_default_inf(zSign, status); } if ( zExp <=3D 0 ) { - isTiny =3D status->tininess_before_rounding + isTiny =3D get_tininess_before_rounding(status) || (zExp < 0) || !increment || (zSig0 < UINT64_C(0xFFFFFFFFFFFFFFFF)); diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c index 326a1201f3..16ffd36e6f 100644 --- a/tests/fp/fp-test.c +++ b/tests/fp/fp-test.c @@ -1011,7 +1011,7 @@ void run_test(void) =20 verCases_tininessCode =3D 0; slowfloat_detectTininess =3D tmode; - qsf.tininess_before_rounding =3D sf_tininess_to_qemu(t= mode); + set_float_detect_tininess(sf_tininess_to_qemu(tmode), = &qsf); =20 if (attrs & FUNC_EFF_TININESSMODE || ((attrs & FUNC_EFF_TININESSMODE_REDUCEDPREC) && diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 38b317c1a7..72bbafcb13 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -428,7 +428,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, exp =3D 0; fracN(clear)(p); } else { - bool is_tiny =3D s->tininess_before_rounding || exp < 0; + bool is_tiny =3D get_tininess_before_rounding(s) || exp < 0; bool has_pseudo_denormals =3D fmt->has_explicit_bit && (get_floatx80_behaviour(s) & floatx80_pseudo_denormal_valid); =20 diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 91250bc5a1..ac3fc85138 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -79,6 +79,11 @@ this code that are retained. * version 2 or later. See the COPYING file in the top-level directory. */ =20 +static inline bool get_tininess_before_rounding(const float_status *status) +{ + return status->tininess_before_rounding; +} + /*------------------------------------------------------------------------= ---- | For the deconstructed floating-point with fraction FRAC, return true | if the fraction represents a signalling NaN; otherwise false. --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192313; cv=none; d=zohomail.com; s=zohoarc; b=AuDKRRnvEhAyvdoDwzirOD1Sf/4JRIn64ihWJ+H1wdQG3lyBX/f2ZdIxdhiecgIIbd/fl0Y8SrVWsEBlMPzfGpa6jwN8jwTE83f0NS7VtrXFb5g//UbM3fsH0RP6Egsg2ap1xwJnfWbpsuJCTAD+qryw9xDuhf6H5adqj/G2fKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192313; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=cfDp2cVCfYURQ+rFBATt97muosYYkvTYqLFUpW+zi2A=; b=Wl4+LHhjlEJuIEwkrjQuxZHBPJ0MnvUaAMJ4Wb8AXnwbNEM2v+vbbfS7LjjEdEc/QgzQkD0mIsijnhdeKUAomnb2jntRF+4gn2KsWOlmHo57Fzhvi1FIpJWfAGzvRV1FaghTlGlMEYmDHsziAbmBwGjlVQ9UloqXzMQVxr6FiEE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192313904594.5058804971959; Thu, 7 May 2026 15:18:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72M-0000sx-VS; Thu, 07 May 2026 18:17:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72J-0000s2-Qf for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:39 -0400 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72H-0003F5-1H for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:39 -0400 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-4350cd5b97fso752300fac.0 for ; Thu, 07 May 2026 15:17:36 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192255; x=1778797055; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=cfDp2cVCfYURQ+rFBATt97muosYYkvTYqLFUpW+zi2A=; b=NVfisssZBJNiQJdsAIgTxLHGxNEnjbJRISfdaF/eMCBoAEJg1iiklsrtLg/7ynKRw5 uxkhoUow6uYnZIhnp+x6cAjXCjTb/HFUDhZUf6o1UPh0HJ0GahGzz92OrpNxsfGQsdbx b8wz+vveW7lH91SByKvMe8lJbYkrXOSYYZPceFGUQOQPhCA8yfsFvoZ5zTRhFUURo1qN 8mArkwxjtiec2Dr/dDz0EkiWnahdAOLzXhstaAMUnaXnNbkWbtEraCriyBOb0pAEqLiT jj6qoohe85QGK1dAdFw4a1UskRyy7f35w3hrecZGbOGTbN8oThp8GDq+xfYp8qd8eplu gIGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192255; x=1778797055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=cfDp2cVCfYURQ+rFBATt97muosYYkvTYqLFUpW+zi2A=; b=so0mlHpmnZDqG+lz5HTiS8wJ0ZikjPm1nPnvr8NJ7R2UjchAZjiJJM6beIb+8EGrEh O5F0j5AxcMtbpwUUK2yq8DcWlyFxyPUu1Nv/N14CkfwFl1BATYxnJCwvKvUNONoAmebi 3Nm8pHp8iZbyDSQ5TPLF1w2/wJU81lVlRqsLdqfpFUjnoOAJy7Hta1P/bajAFURZdazE uROuU9+kFtn5Igb+VFWEBLTZV9TzU07n+h1Y5/YlLYAukDmKrCedTABf6hM6vlpZhSOX YmosFHseNkw+B+BV8rHFzN9ItcjIG2M7YlcbajVDNlkpH2BqXavW8AEygamluTxFfFCn 3a0g== X-Gm-Message-State: AOJu0YyCW4zz/XVATiOp1MgF7KTymWzD9yTIvv2plU6uRTDSZuSoXa5J SC8VvCyeU4Wp4h22ilOoGtVQbi+KoYDMNMiH8HkiR1rPIrpZWILrOaWyuqDSwuXDg2JiKwxaT5f w3KKr X-Gm-Gg: AeBDieswG+DIJmiMIP1A1AO+CyWdWAe9xV+xHF4a0fxoe1mS7cEmSAPBgdflRHH4Xyh 8BSowAR9MViAniPOEzQjsv8CyQ0ltJEIyBMtOsn+62afcbNgfLWtfgiVYp0cARAg3Afv5oe03a+ kVyR8VNRbehrgy9O9QxB+zctnx1uqe+A1Ee3auA059HE7e4Y0obL+Xkn8uKURALBFOJvsaih5Px m57UoFtDzHNq9DqWPga4whCb154O5dHRr2v9bOgF4J2mMyeRxEYiAALSAu4NBjrH4STA7VfovUC z4r/uwXXYVuTYeBZpoeisrbtBofxN54DR/vAi9fD+I1LITMacSZwCZbn0bvpskgzBioKlZdLcmD 35fr8q4dtyNdoiaJq5Uaet1+KaxQdZF7B42gp8aD2WAw+bJUQ52jCri7l0/DT755vrIVCrDt+f7 S76+e8j+PzWu7n96mr+b1vg6q3tWSYv0QQuokLaIqBaGHnjQ== X-Received: by 2002:a05:6870:e243:b0:42c:f89:755f with SMTP id 586e51a60fabf-434f613e1c5mr6878295fac.9.1778192255072; Thu, 07 May 2026 15:17:35 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 12/18] fpu: Use {get,set}_flush_to_zero everywhere Date: Thu, 7 May 2026 17:17:11 -0500 Message-ID: <20260507221717.486023-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::36; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x36.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192315503154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- fpu/softfloat.c | 2 +- target/arm/tcg/vfp_helper.c | 6 +++--- tests/fp/fp-bench.c | 2 +- fpu/softfloat-parts.c.inc | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index b1c2b0e6e1..98cb0623ac 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -4907,7 +4907,7 @@ floatx80 roundAndPackFloatx80(FloatX80RoundPrec round= ingPrecision, bool zSign, goto overflow; } if ( zExp <=3D 0 ) { - if (status->flush_to_zero) { + if (get_flush_to_zero(status)) { float_raise(float_flag_output_denormal_flushed, status); return packFloatx80(zSign, 0, 0); } diff --git a/target/arm/tcg/vfp_helper.c b/target/arm/tcg/vfp_helper.c index 5839e82449..495ce8a329 100644 --- a/target/arm/tcg/vfp_helper.c +++ b/target/arm/tcg/vfp_helper.c @@ -711,7 +711,7 @@ uint32_t HELPER(recpe_f16)(uint32_t input, float_status= *fpst) } else { return float16_set_sign(float16_maxnorm, f16_sign); } - } else if (f16_exp >=3D 29 && fpst->flush_to_zero) { + } else if (f16_exp >=3D 29 && get_flush_to_zero(fpst)) { float_raise(float_flag_underflow, fpst); return float16_set_sign(float16_zero, float16_is_neg(f16)); } @@ -764,7 +764,7 @@ static float32 do_recpe_f32(float32 input, float_status= *fpst, bool rpres) } else { return float32_set_sign(float32_maxnorm, f32_sign); } - } else if (f32_exp >=3D 253 && fpst->flush_to_zero) { + } else if (f32_exp >=3D 253 && get_flush_to_zero(fpst)) { float_raise(float_flag_underflow, fpst); return float32_set_sign(float32_zero, float32_is_neg(f32)); } @@ -823,7 +823,7 @@ float64 HELPER(recpe_f64)(float64 input, float_status *= fpst) } else { return float64_set_sign(float64_maxnorm, f64_sign); } - } else if (f64_exp >=3D 2045 && fpst->flush_to_zero) { + } else if (f64_exp >=3D 2045 && get_flush_to_zero(fpst)) { float_raise(float_flag_underflow, fpst); return float64_set_sign(float64_zero, float64_is_neg(f64)); } diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c index 2b6f66817e..ccc561b578 100644 --- a/tests/fp/fp-bench.c +++ b/tests/fp/fp-bench.c @@ -675,7 +675,7 @@ static void parse_args(int argc, char *argv[]) soft_status.flush_inputs_to_zero =3D 1; break; case 'Z': - soft_status.flush_to_zero =3D 1; + set_flush_to_zero(true, &soft_status); break; } } diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 72bbafcb13..ddef8cc089 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -421,7 +421,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, p->frac_lo &=3D ~round_mask; } fracN(shr)(p, frac_shift); - } else if (s->flush_to_zero && + } else if (get_flush_to_zero(s) && s->ftz_detection =3D=3D float_ftz_before_rounding) { flags |=3D float_flag_output_denormal_flushed; p->cls =3D float_class_zero; @@ -472,7 +472,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, fracN(shr)(p, frac_shift); =20 if (is_tiny) { - if (s->flush_to_zero) { + if (get_flush_to_zero(s)) { assert(s->ftz_detection =3D=3D float_ftz_after_rounding); flags |=3D float_flag_output_denormal_flushed; p->cls =3D float_class_zero; --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192321; cv=none; d=zohomail.com; s=zohoarc; b=QiFjRSw+BOp+sZeW7TBu9mJRJ2UdsN3HcKdti/AeyU0KyElOmCcCKMQKkz7Iof8DnjwueceEkFYYTmBguzP7sNdPCiz9ht5fWA3Nw+jWrbYn+TN9/xwgToNwmFWE/J/lRFUjtQPfRNsD0xM4FSzJSTu1p4Vptqbf4jRH7UVIeyE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192321; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=qpHmtar2AeEUNpLjC+puJZ8I/ID4F4UwiaLMpyjXJYg=; b=PrYAAn6znmGu/Ua6JswZipWi3PX7VWhvhqGVyZd22eBUQ0so1QW/UbM6NCVDAknNzG03tiCtC9q2Gqw5YUDfe1YtpwyvtOee0GF58RTPHWe/mTXWU8Wy0PX6oY6RhVfGrfVUmRAW8bP2X9XNuZ77/n25ZhhYO9jCmZKM4k8TiQo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192321939898.803332354204; Thu, 7 May 2026 15:18:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72M-0000sy-W9; Thu, 07 May 2026 18:17:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72K-0000sX-TO for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:41 -0400 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72I-0003FI-Fz for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:40 -0400 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-42fbf95cca8so1028182fac.0 for ; Thu, 07 May 2026 15:17:37 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192256; x=1778797056; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qpHmtar2AeEUNpLjC+puJZ8I/ID4F4UwiaLMpyjXJYg=; b=qA3UGcvt1pxH08QAO4YSe7Ea+8RfVDVVfBEfj8AIOQqBtVSIlPFuVeotHfVi0AZv6T cv6eVoIutaujMkHX81wMmOWs8Jrj4SOZ00eMxL9mX7+/Mh1WmzWp183JYGggA07ljICu bK2H2cbS6Obyc7rfsn/LgBtCEDfCU3QdtMDD2gx7ODckXEjqL7iRdgHGeds05ZwzReyO 0np6Ps/mXYsH/XrRYELnGsNpYCGtUo4uv/bIB8qH0c8px35sEweIpQPNUj/hWZMuWH9P AjA0gBMFibM62cCJSeJgjOnH20l0iv6e1TNnnOL/V47PNzM4mXZ7kxx2nSIoB9UqPptn OvGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192256; x=1778797056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=qpHmtar2AeEUNpLjC+puJZ8I/ID4F4UwiaLMpyjXJYg=; b=NCxvtBO8PsOPzQo0yzxgjaNoF0oPzWXKS6ale4pvRcEpDsuyciAEjIKM/o1dNv2WqF UbHwjmlWir+6C1PLZB23sLEsRZAsH0RMwucCTBsqvZn5thxBF1Vpt1KPMZv2YS/+Sfem MXCWRJlpbJLROkeLnNBV3nNT/qnKg1QV8X2+55EDCJSNzaJi3zoz0roBLa3iGhZR/EWt Aj52FVWf03W3useWbbk2kiD4/ztwm/7Mgvg9PiJaonSh4ORyYz2fpLVTIWhG8L9aJDIY FO4excSIdzaWI4Bhncm8Ho+k5V0p5fPsaVUnMSX/SHjZZDYlwBES49rCWH3bUhWTYYfu 9hKA== X-Gm-Message-State: AOJu0Yzf1hq+JKZzDLEUXfDc48z+gnhfCURAKIUFF/i9rMpvYqdap1Eu K5+MIFbKcnSENnBs3Soe+a8RcbvT21M9CpzwNwr5IUBH0a00EkkJl26+7mqkbAQAXUcbvM+gkc0 FoGxb X-Gm-Gg: AeBDiesKdMopC5rVttGDaNGiTI/TTLDXAANMm/r+SgS2cSD9Bn6XVMU4S59TVPFDoxR 1/dTEh9ugOvYarudCHEqQ9bcW8mFssSDTYi82pTefAbbLPm4jvt5bzxysLIlmSleT5qquRkGePt S4HQnsZ7tZv7OO7QuiBLviWQYVehmTmR4DyY2B6xO7Om85W1jKcWx27keTxPNucp2pD+4TPAZPN C2dBPh2Gj7TQ3hsK5r3CgV0LelKcg6cX8+chYdR8C014+JDDTGPXiXvCd9Ri/SfJuk9Tv/7igTi /LH/E90ihzV36GjewsnRMiPK+ETnctxhsVqMeYLG1TRsOnbf0K4W7mWMZjWhEsXOeOpF7JaVkRU jf42n/cMcpqGnr+hNEkCH416Qqe9+QDBpgJMVgtYa2x7sKTHQ6Pv1hEZ/znHyEDWMZhn7y6lJec cjC2fMDKjGrUC7tSIkoP0ABU0JOfnMme0KBYLPKtae6y7bUoLs3r1yLsyb X-Received: by 2002:a05:6870:889d:b0:42d:a405:efe1 with SMTP id 586e51a60fabf-43556ebb4camr109454fac.22.1778192256224; Thu, 07 May 2026 15:17:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 13/18] fpu: Use accessors for ftz_before_rounding Date: Thu, 7 May 2026 17:17:12 -0500 Message-ID: <20260507221717.486023-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::29; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x29.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192323844154100 Content-Type: text/plain; charset="utf-8" Drop FloatFTZDetection and use #defines, like we do for tininess_before_rounding. Rename get_float_ftz_detection to get_ftz_before_rounding and move to softfloat.c, as there are no external users. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat-helpers.h | 10 ++-------- include/fpu/softfloat-types.h | 8 +++----- fpu/softfloat-parts.c.inc | 5 ++--- fpu/softfloat-specialize.c.inc | 5 +++++ 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helper= s.h index 395ce67abf..d36e3a24b1 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -116,10 +116,9 @@ static inline void set_flush_inputs_to_zero(bool val, = float_status *status) status->flush_inputs_to_zero =3D val; } =20 -static inline void set_float_ftz_detection(FloatFTZDetection d, - float_status *status) +static inline void set_float_ftz_detection(bool val, float_status *status) { - status->ftz_detection =3D d; + status->ftz_before_rounding =3D val; } =20 static inline void set_default_nan_mode(bool val, float_status *status) @@ -198,9 +197,4 @@ static inline FloatSNaNRule get_snan_rule(float_status = *status) return status->float_snan_rule; } =20 -static inline FloatFTZDetection get_float_ftz_detection(const float_status= *status) -{ - return status->ftz_detection; -} - #endif /* SOFTFLOAT_HELPERS_H */ diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index b8ce8ff78e..b83f67defc 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -341,10 +341,8 @@ typedef enum __attribute__((__packed__)) { * configure it matches the default for tininess_before_rounding * (i.e. "after rounding"). */ -typedef enum __attribute__((__packed__)) { - float_ftz_after_rounding =3D 0, - float_ftz_before_rounding =3D 1, -} FloatFTZDetection; +#define float_ftz_after_rounding false +#define float_ftz_before_rounding true =20 /* * floatx80 is primarily used by x86 and m68k, and there are @@ -416,7 +414,7 @@ typedef struct float_status { /* should denormalised results go to zero and set output_denormal_flus= hed? */ bool flush_to_zero; /* do we detect and flush denormal results before or after rounding? */ - FloatFTZDetection ftz_detection; + bool ftz_before_rounding; /* should denormalised inputs go to zero and set input_denormal_flushe= d? */ bool flush_inputs_to_zero; bool default_nan_mode; diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index ddef8cc089..22c11171f3 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -421,8 +421,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, p->frac_lo &=3D ~round_mask; } fracN(shr)(p, frac_shift); - } else if (get_flush_to_zero(s) && - s->ftz_detection =3D=3D float_ftz_before_rounding) { + } else if (get_flush_to_zero(s) && get_ftz_before_rounding(s)) { flags |=3D float_flag_output_denormal_flushed; p->cls =3D float_class_zero; exp =3D 0; @@ -473,7 +472,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, =20 if (is_tiny) { if (get_flush_to_zero(s)) { - assert(s->ftz_detection =3D=3D float_ftz_after_rounding); + assert(!get_ftz_before_rounding(s)); flags |=3D float_flag_output_denormal_flushed; p->cls =3D float_class_zero; exp =3D 0; diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index ac3fc85138..bde68aa0ec 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -84,6 +84,11 @@ static inline bool get_tininess_before_rounding(const fl= oat_status *status) return status->tininess_before_rounding; } =20 +static inline bool get_ftz_before_rounding(const float_status *status) +{ + return status->ftz_before_rounding; +} + /*------------------------------------------------------------------------= ---- | For the deconstructed floating-point with fraction FRAC, return true | if the fraction represents a signalling NaN; otherwise false. --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192363; cv=none; d=zohomail.com; s=zohoarc; b=lMdAMd8yB+O7+7KO981pIpKazxTzsM2uSrBA9TaEULC2OqkKjtWj5XdxMhfnE/GrBXukWMLJnKZr6qqSiHjdSDvKFRQTBapb6OaoTU2QzfX//A6/eKWzaIKjFRhLD4ZkP6rxsIxudbufqx94cEicwpm77u7rP6prvh8MRgLe6hw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192363; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=H48kL1TGtLHSlE6jIiyOAdlJRT3IfBPUgx3FRBLUEz4=; b=OxFwBow09flR/YHaeRHWekkIEpV6J7OygumtDTXkyFbZ88PgVr/EBRj7FDiAJHf0zgZflEXjhOu9pRdyynuqH99gRF3o3TOdULqj3m01pRoXciGw89UiSTDST5+eYN4nZxNR0XV7uIucOIAARtWZHTF6zuzCcIHdMa2C8vXaSdw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192363764525.3281270473627; Thu, 7 May 2026 15:19:23 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72N-0000tY-K0; Thu, 07 May 2026 18:17:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72M-0000sn-EV for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:42 -0400 Received: from mail-oa1-x32.google.com ([2001:4860:4864:20::32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72J-0003FQ-PZ for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:41 -0400 Received: by mail-oa1-x32.google.com with SMTP id 586e51a60fabf-43454c72d2bso513805fac.0 for ; Thu, 07 May 2026 15:17:38 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192257; x=1778797057; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=H48kL1TGtLHSlE6jIiyOAdlJRT3IfBPUgx3FRBLUEz4=; b=RR8I6FgdxEAWFrXLVBIItCb4I1+RU9ea1tzHo7wyTTQa3xSdSC/HoBOIyUTtyN/Eas Za3Jaj2q1C6aL4uPpHqhi1r+ruU/Fbn3kG80ejbvn3zvwzlsQeTbCRW8XnzflaVh+VPE RdmPVmjGqNfnGUCdl1e5VNmCQ7P3Wc+Bh5OjuRZrYN44tijYLr8raPK/d3pfzoYXVpZm gjT30s+odxMWvlMEy4vb0r9Brg4GaLNUJuaS5NbNyXD65aXhwQx2QwrGvj1Y73HogvR1 bP0fi5sPbJh1TAt3YQFQTO7VhRIkjLjJW1no2KXD4y/CgzWcjW8DEfcr/J+0HOIohCr/ XO7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192257; x=1778797057; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=H48kL1TGtLHSlE6jIiyOAdlJRT3IfBPUgx3FRBLUEz4=; b=PhLY9LcY+pE/InrzF2d/FhyhQHywxzxPEr9Py/ps7M+fZyuotFeoddYHFbqxZwbdDE mZXIhL9cV+nt3ngUtmUvpeIdIj7uusoRBfpc1PrzkhtlPi5r5dWC8K6dN/LD1NUURPuS 3ro4u+/md24WnDq1HmGpLyZ9fGlbqQA28HZK2LhNWiEnONdET/ebZwyjo9c/TP7U5pqi rS8PaihDDA2uBgpGW/7/88tPqD06Bt9yAF8RGru8Db1fuTLwDLve8KH5CSJ+JQ1bS400 5MjxgBcXw/0VboM3KldgU+ZjDpDdfrOvnp2gJnRmkMH1dNIWKDFXPDMCFoKf8hO57yIt mKzg== X-Gm-Message-State: AOJu0YwTfVgTTOH5qZvWoWKb1l44Ff/f0rIQU9soyHYMvkjv9s0BKdI/ h3He7JsnxVXqpuImfhCX9ASkX1x2TQt84L0rO2a0XK2b8LBjSM7R2LaTIFlznktfhjOJ6ZK4LlD Jga2f X-Gm-Gg: AeBDieuNL3S8kquQBXSQDQXE7CbCJHYzkENnZabWxc6OBs5a4nbN95FtEBvqIzXQ+Oj lgnF87GdJlXKDNCfHbuweXdlOhmYRhhze+juu1FxzWJtc1lpzHH0lNaVu5VrbL/1l46ruNq+mCd 5sFtIM8NZEA+/JBCLsJ3eM5CbQQwOvqRhetbrlgrUy/NR1CYZGw5mIRYrBTU1y85PJYl4DpBnyR Wd5baqOsqT09PlhLD0c1E4rdP2KiuIBHAW9n21LfLnoDumz7MPuoerRT7OMN+HJi5jsE4gJBOnD ngI2fC/XzqMkkJUfWlSkCVakFDiPHlWKv49zLHjwy/+YBMyEK8y57XVoy+hOvIrHfpXGy0j506U QQAddAn5RW0M5ePGbgW0T5dIvkbSawoLoM3+LyPZr0zz3ycONEK8CWtZnzKggUfgIZtb7cCkxZp 5lLGgWDQhcKo6uHJnoJ4Wq7RZUNZ/rnusWhxuGqTLNkJw5PjsXKcqquExT X-Received: by 2002:a05:6871:a60b:b0:417:6224:5855 with SMTP id 586e51a60fabf-434f4e8e8b9mr6251870fac.0.1778192257408; Thu, 07 May 2026 15:17:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 14/18] fpu: Use {get,set}_flush_inputs_to_zero everywhere Date: Thu, 7 May 2026 17:17:13 -0500 Message-ID: <20260507221717.486023-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::32; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x32.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192366293154100 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- fpu/softfloat.c | 14 +++++++------- target/alpha/fpu_helper.c | 2 +- target/alpha/helper.c | 3 ++- tests/fp/fp-bench.c | 2 +- fpu/softfloat-parts.c.inc | 2 +- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 98cb0623ac..92918df89a 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -141,7 +141,7 @@ GEN_INPUT_FLUSH__NOCHECK(float64_input_flush__nocheck, = float64) #define GEN_INPUT_FLUSH1(name, soft_t) \ static inline void name(soft_t *a, float_status *s) \ { \ - if (likely(!s->flush_inputs_to_zero)) { \ + if (likely(!get_flush_inputs_to_zero(s))) { \ return; \ } \ soft_t ## _input_flush__nocheck(a, s); \ @@ -154,7 +154,7 @@ GEN_INPUT_FLUSH1(float64_input_flush1, float64) #define GEN_INPUT_FLUSH2(name, soft_t) \ static inline void name(soft_t *a, soft_t *b, float_status *s) \ { \ - if (likely(!s->flush_inputs_to_zero)) { \ + if (likely(!get_flush_inputs_to_zero(s))) { \ return; \ } \ soft_t ## _input_flush__nocheck(a, s); \ @@ -168,7 +168,7 @@ GEN_INPUT_FLUSH2(float64_input_flush2, float64) #define GEN_INPUT_FLUSH3(name, soft_t) \ static inline void name(soft_t *a, soft_t *b, soft_t *c, float_status = *s) \ { \ - if (likely(!s->flush_inputs_to_zero)) { \ + if (likely(!get_flush_inputs_to_zero(s))) { \ return; \ } \ soft_t ## _input_flush__nocheck(a, s); \ @@ -4752,7 +4752,7 @@ static bool parts_squash_denormal(FloatParts64 p, flo= at_status *status) =20 float16 float16_squash_input_denormal(float16 a, float_status *status) { - if (status->flush_inputs_to_zero) { + if (get_flush_inputs_to_zero(status)) { FloatParts64 p =3D unpack_raw64(&float16_params, a); =20 if (parts_squash_denormal(p, status)) { @@ -4764,7 +4764,7 @@ float16 float16_squash_input_denormal(float16 a, floa= t_status *status) =20 float32 float32_squash_input_denormal(float32 a, float_status *status) { - if (status->flush_inputs_to_zero) { + if (get_flush_inputs_to_zero(status)) { FloatParts64 p =3D unpack_raw64(&float32_params, a); =20 if (parts_squash_denormal(p, status)) { @@ -4776,7 +4776,7 @@ float32 float32_squash_input_denormal(float32 a, floa= t_status *status) =20 float64 float64_squash_input_denormal(float64 a, float_status *status) { - if (status->flush_inputs_to_zero) { + if (get_flush_inputs_to_zero(status)) { FloatParts64 p =3D unpack_raw64(&float64_params, a); =20 if (parts_squash_denormal(p, status)) { @@ -4788,7 +4788,7 @@ float64 float64_squash_input_denormal(float64 a, floa= t_status *status) =20 bfloat16 bfloat16_squash_input_denormal(bfloat16 a, float_status *status) { - if (status->flush_inputs_to_zero) { + if (get_flush_inputs_to_zero(status)) { FloatParts64 p =3D unpack_raw64(&bfloat16_params, a); =20 if (parts_squash_denormal(p, status)) { diff --git a/target/alpha/fpu_helper.c b/target/alpha/fpu_helper.c index 0ced53c54e..5b7e4bd5eb 100644 --- a/target/alpha/fpu_helper.c +++ b/target/alpha/fpu_helper.c @@ -151,7 +151,7 @@ void helper_ieee_input_cmp(CPUAlphaState *env, uint64_t= val) void helper_ieee_input_s(CPUAlphaState *env, uint64_t val) { if (unlikely(2 * val - 1 < 0x1fffffffffffffull) - && !env->fp_status.flush_inputs_to_zero) { + && !get_flush_inputs_to_zero(&env->fp_status)) { arith_excp(env, GETPC(), EXC_M_INV | EXC_M_SWC, 0); } } diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 179dc2dc7a..b7eb13d0d2 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -24,6 +24,7 @@ #include "exec/page-protection.h" #include "exec/target_page.h" #include "fpu/softfloat-types.h" +#include "fpu/softfloat-helpers.h" #include "exec/helper-proto.h" #include "qemu/qemu-print.h" #include "system/memory.h" @@ -80,7 +81,7 @@ void cpu_alpha_store_fpcr(CPUAlphaState *env, uint64_t va= l) env->fpcr_exc_enable =3D ~t & FPCR_STATUS_MASK; =20 env->fpcr_dyn_round =3D rm_map[(fpcr & FPCR_DYN_MASK) >> FPCR_DYN_SHIF= T]; - env->fp_status.flush_inputs_to_zero =3D (fpcr & FPCR_DNZ) !=3D 0; + set_flush_inputs_to_zero(fpcr & FPCR_DNZ, &env->fp_status); =20 t =3D (fpcr & FPCR_UNFD) && (fpcr & FPCR_UNDZ); #ifdef CONFIG_USER_ONLY diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c index ccc561b578..c53d6e4b34 100644 --- a/tests/fp/fp-bench.c +++ b/tests/fp/fp-bench.c @@ -672,7 +672,7 @@ static void parse_args(int argc, char *argv[]) tester =3D val; break; case 'z': - soft_status.flush_inputs_to_zero =3D 1; + set_flush_inputs_to_zero(true, &soft_status); break; case 'Z': set_flush_to_zero(true, &soft_status); diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 22c11171f3..c6a3ba9a22 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -218,7 +218,7 @@ static void partsN(canonicalize)(FloatPartsN *p, float_= status *status, if (unlikely(p->exp =3D=3D 0)) { if (likely(fracN(eqz)(p))) { p->cls =3D float_class_zero; - } else if (status->flush_inputs_to_zero) { + } else if (get_flush_inputs_to_zero(status)) { float_raise(float_flag_input_denormal_flushed, status); p->cls =3D float_class_zero; fracN(clear)(p); --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192344; cv=none; d=zohomail.com; s=zohoarc; b=LuRJ+Htt1fZEr+qNHgQkRINdKCnj4DdxJkkTfC/PxSdecRG2Gs+gIoo1d5EBxoQttdUsOqKYYHiXFbUwWM64hEScX5ThgrPtBIVfplB48Ze38jMtwaTCQ9Ujc7uwulpXGy0YaNz9gUtiEX5IJA2wCZs1Qa5iWdnsIsfSOqrSxkM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192344; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=xPhav+rZ0D3mHeKIb/ZgfInrRVs0ZlagVufHC+pW9rQ=; b=IHKnTQ0W1nTM/rYywrLg8tihLzmabYLijZcuSfvrM45Hi3JhSd7fpr8R7WuoxT1gsoscScavYcT/fDMXJObMYs11NDChPhMQK/r+vXNQVabk9IAe9ViHJ8Q8RykKWA6gChrC7wT7pqBfO90WRReWE04WT/ibW/N/h/XdXKjpXl8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177819234425258.631258161646656; Thu, 7 May 2026 15:19:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72O-0000u4-IC; Thu, 07 May 2026 18:17:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72N-0000tm-Lw for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:43 -0400 Received: from mail-oa1-x35.google.com ([2001:4860:4864:20::35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72K-0003Fe-Ir for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:43 -0400 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-435428c81a3so468273fac.1 for ; Thu, 07 May 2026 15:17:40 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192258; x=1778797058; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xPhav+rZ0D3mHeKIb/ZgfInrRVs0ZlagVufHC+pW9rQ=; b=kWZwj28SodhextP1iahfB57oEMOJM4DYreYMIR3wiJxzSENvlOnfPXyomrb3g3ukWf MUUpr4lTNG3SSwTrMpws8nt2s2n0l8B9I7/Gil/AwkhBmdkYl2d/DaGyzBNpCXy4/SLV G82YfbfqdhBQlLxmREA3T2oJr+bRv8Or5Va8heItGFwpppJg7K9LpZR3EoQBHHb4+2uE sLcjqvH3uSsWJC/OlQkSd4ksKdCPQND91orDkza75j94veAv6G+x3pUOnxGgkqDQnb8F ZXo9PWQXbpXSmADCr/w79wLLF+aBweHeYp1ErEeGVp85CbHoChDJV2LyC6m2S8KjVfPV yXjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192258; x=1778797058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=xPhav+rZ0D3mHeKIb/ZgfInrRVs0ZlagVufHC+pW9rQ=; b=B8Eb/0JWDUGx/5lCgk26xMcM5XNEINKOz7H/zGzEZUTdQhJzfSHpSXDNzfCnC7JLQ9 N9BR421UjiKMexobbBUtjRvLWUtXLBCAIGu76eBHluRGORR5AEQjDBcF0tXfyeaeFmCV xZy8bLBtG0sYk18PKHlHO5AYVPDycgiVO4v3DvgJsTD2jouJo1TlAMUAlE9ch8bm0ez2 yxEdaXQAD3+kVUGxJMrdPO8Zfuq0Esfj6y6nplN3hegOXBrVuWf0hdwPaReteRbH2tRj QOoV3CPb2R38Dj7UBEGij4QCQ8InW2Uz6nsecavEps9nZsAKEqAl4YqVlmRht35eUYYQ 21Dw== X-Gm-Message-State: AOJu0YzHu/jnjKsqwXOmbQtY4Ve/0jSlALy9s75gukSZvJjIWDzLPFOu gXsADq8LXKJU0n9/lr+w8o7V+eesbo8KgymirqSLR+j2q7goFrOOdXZRtZUZkLi+EH6X/p1zUjx EdRVg X-Gm-Gg: Acq92OGkgA8SPaACMmlKezN7aOoUS0/XvbIYD0PCoUuBUMaDGpcwFU2p9jaTyogzrfr 4UMLxPr/DymCuFbfzkjUGR7/QRv403qBtYhZGVZKOdP7EmGIZtpzKUUqFvJ6STL9edS6ngRl0Fa LS4BpgdnPw7nrKVYexJ3g+raJ5zuKpmhg9yzk75u+ngmKX4pvEB5/ktS4HYXhZQBvhDXqmS4++J QOcBDEIOO9IX7r5ECX/nfSnxcZYn4yxFn68BWaYdcgqzgpmjcH052M1N1K50Vch66aUeBKyiEYx hfXAnwi4jgEcS782woHgAZrHye8tC0F+kIJbZGhLhvHcfa6uEfKMonf13Aq6Te1ncCfLoJieYpi WVinUVph81FF9vdwIfvFu9kIa5dYLs6gUzrM+XtYNCEBYvHTIXTxBKLe2a3e7CXY7sTHhT9HDcH QVZBiVZ7pXjHThfiqZSTqtM7y4mNvd/pSUYNi0dt21V50vPo246Z7oMA9o X-Received: by 2002:a05:6870:2315:b0:42f:dd2e:e41e with SMTP id 586e51a60fabf-43556d0d6f1mr118670fac.17.1778192258336; Thu, 07 May 2026 15:17:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 15/18] fpu: Use get_default_nan_mode everywhere Date: Thu, 7 May 2026 17:17:14 -0500 Message-ID: <20260507221717.486023-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::35; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x35.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192346208158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/tcg/helper-a64.c | 12 ++++++------ target/arm/tcg/vfp_helper.c | 24 ++++++++++++------------ target/m68k/softfloat.c | 2 +- fpu/softfloat-parts.c.inc | 8 ++++---- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c index dd1f9c6dc6..6505ee3c94 100644 --- a/target/arm/tcg/helper-a64.c +++ b/target/arm/tcg/helper-a64.c @@ -273,11 +273,11 @@ uint32_t HELPER(frecpx_f16)(uint32_t a, float_status = *fpst) float16 nan =3D a; if (float16_is_signaling_nan(a, fpst)) { float_raise(float_flag_invalid, fpst); - if (!fpst->default_nan_mode) { + if (!get_default_nan_mode(fpst)) { nan =3D float16_silence_nan(a, fpst); } } - if (fpst->default_nan_mode) { + if (get_default_nan_mode(fpst)) { nan =3D float16_default_nan(fpst); } return nan; @@ -305,11 +305,11 @@ float32 HELPER(frecpx_f32)(float32 a, float_status *f= pst) float32 nan =3D a; if (float32_is_signaling_nan(a, fpst)) { float_raise(float_flag_invalid, fpst); - if (!fpst->default_nan_mode) { + if (!get_default_nan_mode(fpst)) { nan =3D float32_silence_nan(a, fpst); } } - if (fpst->default_nan_mode) { + if (get_default_nan_mode(fpst)) { nan =3D float32_default_nan(fpst); } return nan; @@ -337,11 +337,11 @@ float64 HELPER(frecpx_f64)(float64 a, float_status *f= pst) float64 nan =3D a; if (float64_is_signaling_nan(a, fpst)) { float_raise(float_flag_invalid, fpst); - if (!fpst->default_nan_mode) { + if (!get_default_nan_mode(fpst)) { nan =3D float64_silence_nan(a, fpst); } } - if (fpst->default_nan_mode) { + if (get_default_nan_mode(fpst)) { nan =3D float64_default_nan(fpst); } return nan; diff --git a/target/arm/tcg/vfp_helper.c b/target/arm/tcg/vfp_helper.c index 495ce8a329..8d3f6e3a2e 100644 --- a/target/arm/tcg/vfp_helper.c +++ b/target/arm/tcg/vfp_helper.c @@ -690,11 +690,11 @@ uint32_t HELPER(recpe_f16)(uint32_t input, float_stat= us *fpst) float16 nan =3D f16; if (float16_is_signaling_nan(f16, fpst)) { float_raise(float_flag_invalid, fpst); - if (!fpst->default_nan_mode) { + if (!get_default_nan_mode(fpst)) { nan =3D float16_silence_nan(f16, fpst); } } - if (fpst->default_nan_mode) { + if (get_default_nan_mode(fpst)) { nan =3D float16_default_nan(fpst); } return nan; @@ -743,11 +743,11 @@ static float32 do_recpe_f32(float32 input, float_stat= us *fpst, bool rpres) float32 nan =3D f32; if (float32_is_signaling_nan(f32, fpst)) { float_raise(float_flag_invalid, fpst); - if (!fpst->default_nan_mode) { + if (!get_default_nan_mode(fpst)) { nan =3D float32_silence_nan(f32, fpst); } } - if (fpst->default_nan_mode) { + if (get_default_nan_mode(fpst)) { nan =3D float32_default_nan(fpst); } return nan; @@ -802,11 +802,11 @@ float64 HELPER(recpe_f64)(float64 input, float_status= *fpst) float64 nan =3D f64; if (float64_is_signaling_nan(f64, fpst)) { float_raise(float_flag_invalid, fpst); - if (!fpst->default_nan_mode) { + if (!get_default_nan_mode(fpst)) { nan =3D float64_silence_nan(f64, fpst); } } - if (fpst->default_nan_mode) { + if (get_default_nan_mode(fpst)) { nan =3D float64_default_nan(fpst); } return nan; @@ -945,11 +945,11 @@ uint32_t HELPER(rsqrte_f16)(uint32_t input, float_sta= tus *s) float16 nan =3D f16; if (float16_is_signaling_nan(f16, s)) { float_raise(float_flag_invalid, s); - if (!s->default_nan_mode) { + if (!get_default_nan_mode(s)) { nan =3D float16_silence_nan(f16, s); } } - if (s->default_nan_mode) { + if (get_default_nan_mode(s)) { nan =3D float16_default_nan(s); } return nan; @@ -994,11 +994,11 @@ static float32 do_rsqrte_f32(float32 input, float_sta= tus *s, bool rpres) float32 nan =3D f32; if (float32_is_signaling_nan(f32, s)) { float_raise(float_flag_invalid, s); - if (!s->default_nan_mode) { + if (!get_default_nan_mode(s)) { nan =3D float32_silence_nan(f32, s); } } - if (s->default_nan_mode) { + if (get_default_nan_mode(s)) { nan =3D float32_default_nan(s); } return nan; @@ -1056,11 +1056,11 @@ float64 HELPER(rsqrte_f64)(float64 input, float_sta= tus *s) float64 nan =3D f64; if (float64_is_signaling_nan(f64, s)) { float_raise(float_flag_invalid, s); - if (!s->default_nan_mode) { + if (!get_default_nan_mode(s)) { nan =3D float64_silence_nan(f64, s); } } - if (s->default_nan_mode) { + if (get_default_nan_mode(s)) { nan =3D float64_default_nan(s); } return nan; diff --git a/target/m68k/softfloat.c b/target/m68k/softfloat.c index f5d683bcc5..99c2dcbe8c 100644 --- a/target/m68k/softfloat.c +++ b/target/m68k/softfloat.c @@ -35,7 +35,7 @@ static floatx80 propagateFloatx80NaNOneArg(floatx80 a, fl= oat_status *status) a =3D floatx80_silence_nan(a, status); } =20 - if (status->default_nan_mode) { + if (get_default_nan_mode(status)) { return floatx80_default_nan(status); } =20 diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index c6a3ba9a22..5598c8b44a 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -20,14 +20,14 @@ FloatPartsN partsN(return_nan)(const FloatPartsN *a, fl= oat_status *s) switch (a->cls) { case float_class_snan: float_raise(float_flag_invalid | float_flag_invalid_snan, s); - if (s->default_nan_mode) { + if (get_default_nan_mode(s)) { return partsN(default_nan)(s); } else { return partsN(silence_nan)(a, s); } break; case float_class_qnan: - if (s->default_nan_mode) { + if (get_default_nan_mode(s)) { return partsN(default_nan)(s); } break; @@ -49,7 +49,7 @@ FloatPartsN partsN(pick_nan)(const FloatPartsN *a, const = FloatPartsN *b, have_snan =3D true; } =20 - if (s->default_nan_mode) { + if (get_default_nan_mode(s)) { return partsN(default_nan)(s); } =20 @@ -134,7 +134,7 @@ static FloatPartsN partsN(pick_nan_muladd)(const FloatP= artsN *a, float_raise(float_flag_invalid | float_flag_invalid_imz, s); } =20 - if (s->default_nan_mode) { + if (get_default_nan_mode(s)) { /* * We guarantee not to require the target to tell us how to * pick a NaN if we're always returning the default NaN. --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192359; cv=none; d=zohomail.com; s=zohoarc; b=PtGpsxINN/kGh81T/bbvMBx/C/CsfLwDIfwZLG3+AzAipNRB89Z9q4mlbsZW7YVj9hc6HNcBHRrpHBIIUzOdY31ZcjKzPw2cI0kKGtwgtIzYa9N5l0S5kxTfuQcCqMtmaHf6BXysHs/cmCGpWnTeenIBrZSAutnlTFK4zOc2tek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192359; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=KUxov8RzTJ3rWeBI2h10aJQ4FcxGcG5WyfWqnxlNA08=; b=ZMNU5gDimB6pmBqZZ9FfI8pJV5McZ2mbM/DAv2LsMze5DTE2rbgJxnmM7qR4VUyhtYyeBIw/MHNMKNMp/u7BY/SC0z9D0Iyg1zwO/kRCa65Z0WpcTYA3ub3Czn1DavUFirnGi2y6gDIif0SKpyZOBBS1AnyqaRbS8L8NGAo9mm4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192359270238.8910810086461; Thu, 7 May 2026 15:19:19 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72Q-0000v7-TV; Thu, 07 May 2026 18:17:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72N-0000tn-OB for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:43 -0400 Received: from mail-oa1-x2a.google.com ([2001:4860:4864:20::2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72L-0003Fs-96 for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:43 -0400 Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-40423dbe98bso768036fac.2 for ; Thu, 07 May 2026 15:17:40 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192259; x=1778797059; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=KUxov8RzTJ3rWeBI2h10aJQ4FcxGcG5WyfWqnxlNA08=; b=uw8gpPnNK9UL7BOoWSx01G9WNb0IH1ZItrsch0VQhxELEjMBQCdzBnRFIUDAYmOeR6 xlCucgwW+n3WO71eS4PStiQsG3YJpWwWfQ5YXtNFAL+OR4tilHVSV+mTHcbh2TPF/dO6 tspH3Z35tUQFqux0UBAgMC6pdpytZEAZH8Lo/07KuEChK8BChOVsrSqrwJ0lCJX3hcUP Ta5UDqwj0Q75LJAEdjramNvHMTGHLJ7O9q2+96LzGp+BlWPKsL5DLqzGVgsQawskaOiE t9Co8G7h5uGbClncB7m1yMxvtSLdRldESO7NxGGvryOcFNEv5z0D6g6ASeaOcSTkCNM9 Pbfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192259; x=1778797059; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=KUxov8RzTJ3rWeBI2h10aJQ4FcxGcG5WyfWqnxlNA08=; b=M98uTLxlH+uIQkdtiH2LcSgkErlDkRzuUOE2wzXW4Cllk9C8jIIabUDe+SfVT3VOtx mfcBjdLc+eYlPZiOw1eZAkZ7mw6Qn0qInVWym3/Qx4Zg4Q2dqSa7xmg8nkyhi4Wtuimn rbEq35mr+9mFAihSkaE+8qM4L1QYiuPK4EMJ2i/BV6ZYSSnYAjChQEFO+SE5FFSb6LeL sZto+qiAUOgDg0FCYiP2GJlWLkneERTCamPNqfzbsYc6CgW5S9pDMxFK6aRLKkggWyIT JCVyTmYsKQNmhBtuuyF/R+M/J26tfdh58nfAzpEbTJ0wtI8O4hoNEho1CI9y59jSOObg WQGQ== X-Gm-Message-State: AOJu0YwiChkVCIAh5FSdpHkmrs6c6BS2FSoSLZKtQYRvO/jSBsboZpfi ke8a0cdI/4PQ0y66pyDhlUuiO7/xPMUk1uVsH1w4o4ICANeBR10/rf6XWFa3jJDdqHhfuqovsii 3Z3sE X-Gm-Gg: AeBDievTRgF8HFyTf6cZNkRG1XCBdZpqNqD3TeDgqc0NYeLRVeM95n4xSSi70s9lhlH R2I00i4tgnON6SQ5u/+6T2TStM2LrA8B3i8IIP3d+6O6JvhDxnk7KoOjfBvrcqHH6bWahlF7qBK OqRa5s1Ggwxt1Xgc8EtdzCSRvyugeQLP5Nwb0Q3hTjXeU7QhPn3POTBL1eFhvnoXj3EhMlRoJf5 /kDl/k+CF+D2GXkPigiiT2kH1ECuBQlL7swtOHr6GOrxMXzGZdQU+x3mgGnGt/2kj5dhvNz9dxR 7zhPMTgkuJxRMBJcqIPNdxiYvHGeN3b1KKQ5xzL7axAlvFzXRB/M35aHQsW59Cw93sZq1PlwdvO tqCV+cbEF/su4/G4DcekYiZyddfpMwdPhSA53AfgDXZ9W96g14fSJ9zUpF/WDzYWbtAJfp3QlLJ ho1Rh7J5Qn7QHTKMIaA/dqJf4HHG8ay+4KY9yHOTdE54pOkA== X-Received: by 2002:a05:6820:2014:b0:696:6585:a51 with SMTP id 006d021491bc7-69998cbe152mr5228110eaf.13.1778192259398; Thu, 07 May 2026 15:17:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 16/18] fpu: Use get_float_default_nan_pattern in partsN_default_nan Date: Thu, 7 May 2026 17:17:15 -0500 Message-ID: <20260507221717.486023-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::2a; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2a.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192360163158500 Content-Type: text/plain; charset="utf-8" Move get_float_default_nan_pattern to softfloat-specialize.c.inc, since there are no external users. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat-helpers.h | 5 ----- fpu/softfloat-specialize.c.inc | 7 ++++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helper= s.h index d36e3a24b1..49e04ffee9 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -172,11 +172,6 @@ get_float_infzeronan_rule(const float_status *status) return status->float_infzeronan_rule; } =20 -static inline uint8_t get_float_default_nan_pattern(const float_status *st= atus) -{ - return status->default_nan_pattern; -} - static inline bool get_flush_to_zero(const float_status *status) { return status->flush_to_zero; diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index bde68aa0ec..fe56cb7c7a 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -89,6 +89,11 @@ static inline bool get_ftz_before_rounding(const float_s= tatus *status) return status->ftz_before_rounding; } =20 +static inline uint8_t get_float_default_nan_pattern(const float_status *st= atus) +{ + return status->default_nan_pattern; +} + /*------------------------------------------------------------------------= ---- | For the deconstructed floating-point with fraction FRAC, return true | if the fraction represents a signalling NaN; otherwise false. @@ -122,7 +127,7 @@ FloatParts64 parts64_default_nan(float_status *status) { bool sign =3D 0; uint64_t frac; - uint8_t dnan_pattern =3D status->default_nan_pattern; + uint8_t dnan_pattern =3D get_float_default_nan_pattern(status); =20 assert(dnan_pattern !=3D 0); =20 --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192370; cv=none; d=zohomail.com; s=zohoarc; b=HS0o3Sobot/vnK+qP3bNrsQfSeazkG91pWKit0akpVWxfrXR+sio+nbl4OVA8jJOh9cyj9/Cy5TSb7k8oQbxvklBU1mEfsaRk3W0LrygH7Hd4MhCcXiGRk2lgdcFClNNjC2+Xo/bxoZc9NJNVToQHtJgTbevD9UM4XDWLti+gkE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192370; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=DHW/PVSACyLCeJ01Jj+8W8gGU3WJOwf4DpmqjVgtWRw=; b=G6a68WI02dQfqP9L8cBkBOHDX28nr0jRduNxUESiPNRIIyhe+8OiWDlLTKKC1jwHNf/u6NgD2Ra9pgYOQqKMPRaH4lus+dVKwxiLI1a/BKlntBLtKijjlyddSttOW0rjgV05NTwCRjEoJjX8pobmSxQiN1xbT3xG2xUgUuR3KjI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192370670243.48465595142432; Thu, 7 May 2026 15:19:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72Q-0000uq-2W; Thu, 07 May 2026 18:17:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72O-0000u5-Rl for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:44 -0400 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72M-0003G2-E8 for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:44 -0400 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-408778a8ec4so807660fac.0 for ; Thu, 07 May 2026 15:17:41 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192260; x=1778797060; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=DHW/PVSACyLCeJ01Jj+8W8gGU3WJOwf4DpmqjVgtWRw=; b=Uu8Y43q25PTCOJEfnHlEAr/04lenDI6HRuTslVhlAfsVRn/LHS247Q3JbVtXOJQJKM 2eejI/xtG5vbjCmU+g85ejdXIPbyO6aWE0HxI9aa5l2Qb+rCL0A2PW6QB9xBcoGKtYN/ i4B5NHIonWRoo9dGZ9CdKxclZTPWWeRXkWqHF8vAe8y6/XwCLPqJcPs2Ke990xdns4i2 x/1bPIEWpg9bsrp3yy74b9F7jPgaywAfyOA31V3hF7pzD1j9FS5s9DcenrL2YG4PXNqb fPX2ZtVhKK8MErGgqkR3tThHiJp6XE2ANNmIxLmu/4BaOslSc0M1iJlE6I9HmfNBgaCO Qs7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192260; x=1778797060; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=DHW/PVSACyLCeJ01Jj+8W8gGU3WJOwf4DpmqjVgtWRw=; b=kmU0X5Qx/VgFFaRbY2SBVzqJWvqarjUaza1aeb+I5Nl2FoL+SVximD4e+M2hX0MYfw ZtyCkeCz8D+j+5Sp/FM2tKyG+stDdylP6yTIUFZ4Dsp9wXZ+YiG1LVQlFX0JVcOQOMoK RC0FekEq0q93lgb5+nA7iY9nGPMoIB1GNu3GlcXDZy0idSGgXSSLGD0CJ+PuQt9Ko5ER KfKrtT2bfPA22gzHl0STUJ+3p/FaS4OzaluykaiCP23+39WtS/qjWZpEX+TnV+8ZyfZF 8v3QAoJ/hlK3gCO+jU2SZtKzQW1EFr4PEj0xQ3RK4k7AL6vWiW8oVtczthFDW7GjEI4s HSJg== X-Gm-Message-State: AOJu0Yw7IF7fajn/MlCsuxCg8fSqEKpZIZyrckaKLYtSGwCZ9BHNvnF0 pQxMNeB5A0Qi9fOk9vNqpk8F3xdyk8K4NEhx30Va36nY6VvbFPEOFzp+douWiVoQ4GQmkE4bAMT IatQu X-Gm-Gg: AeBDietiZmR8kI/e09P2m65uZ7DrCYMci3hw1FfAJfPuHpo+28Q6flgBNo/q94d9OZV 4ZwBjGyltD7wfEMMqtW1F8UagNvmvjTfztMB0nsEgUW6Dsi23Vh8XS0if1auMEVU/pWGhz+ZuFq OpvM8o4CCC5c9ExTWLjs377JEM/q9L8NGeW6kv/pk16swMMMLmb12NeCwbcND8oT0LAFm1aECgm n8aYsyCWcouMcA4eEmpKL5qTQV95h99Gn4jyYUF0x2N8u4OXQCXWbKpDnPi7HEb8rFOVNPKvZEW SfFX26f/v5k6cJ+mDQDI4h9r2qaMlmJnyfn/c7rsAnhfdHyp9T7vHwyoi5MV/6Qvb9BZJYdHWcV Zdk8RVFCvqy71qqfPq2fUiEubR+Zl9ToFxtqvVH12I2N4WGFVVuyi5wMAudDU7ss6ynyVw0sT3E hZWTa7IgdJDbemX4zbsKrA289ZOakPddlX/fg6pBJntiUdPgzdGxfZ0jvm3i1/lmOmXSI= X-Received: by 2002:a05:6820:1745:b0:694:6acf:a423 with SMTP id 006d021491bc7-69998d22f94mr5417823eaf.44.1778192260176; Thu, 07 May 2026 15:17:40 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 17/18] fpu: Add accessors for rebias_{underflow,overflow} Date: Thu, 7 May 2026 17:17:16 -0500 Message-ID: <20260507221717.486023-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2001:4860:4864:20::34; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x34.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192372262158500 Content-Type: text/plain; charset="utf-8" Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat-helpers.h | 10 ++++++++++ target/ppc/cpu.c | 4 ++-- fpu/softfloat-parts.c.inc | 4 ++-- fpu/softfloat-specialize.c.inc | 10 ++++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helper= s.h index 49e04ffee9..4791a7fc87 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -131,6 +131,16 @@ static inline void set_snan_rule(FloatSNaNRule val, fl= oat_status *status) status->float_snan_rule =3D val; } =20 +static inline void set_float_rebias_overflow(bool val, float_status *statu= s) +{ + status->rebias_overflow =3D val; +} + +static inline void set_float_rebias_underflow(bool val, float_status *stat= us) +{ + status->rebias_underflow =3D val; +} + static inline FloatRoundMode get_float_rounding_mode(const float_status *s= tatus) { return status->float_rounding_mode; diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c index 4d8faaddee..41edb18643 100644 --- a/target/ppc/cpu.c +++ b/target/ppc/cpu.c @@ -248,8 +248,8 @@ void ppc_store_fpscr(CPUPPCState *env, target_ulong val) val |=3D FP_FEX; } env->fpscr =3D val; - env->fp_status.rebias_overflow =3D (FP_OE & env->fpscr) ? true : fals= e; - env->fp_status.rebias_underflow =3D (FP_UE & env->fpscr) ? true : fals= e; + set_float_rebias_overflow(FP_OE & env->fpscr, &env->fp_status); + set_float_rebias_underflow(FP_UE & env->fpscr, &env->fp_status); if (tcg_enabled()) { fpscr_set_rounding_mode(env); } diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 5598c8b44a..2198841f05 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -368,7 +368,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, switch (fmt->exp_max_kind) { case float_expmax_ieee: flags |=3D float_flag_overflow; - if (s->rebias_overflow) { + if (get_float_rebias_overflow(s)) { exp -=3D fmt->exp_re_bias; } else if (overflow_norm) { flags |=3D float_flag_inexact; @@ -408,7 +408,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, floa= t_status *s, } } fracN(shr)(p, frac_shift); - } else if (unlikely(s->rebias_underflow)) { + } else if (unlikely(get_float_rebias_underflow(s))) { flags |=3D float_flag_underflow; exp +=3D fmt->exp_re_bias; if (p->frac_lo & round_mask) { diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index fe56cb7c7a..d9bea064e3 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -94,6 +94,16 @@ static inline uint8_t get_float_default_nan_pattern(cons= t float_status *status) return status->default_nan_pattern; } =20 +static inline bool get_float_rebias_overflow(const float_status *status) +{ + return status->rebias_overflow; +} + +static inline bool get_float_rebias_underflow(const float_status *status) +{ + return status->rebias_underflow; +} + /*------------------------------------------------------------------------= ---- | For the deconstructed floating-point with fraction FRAC, return true | if the fraction represents a signalling NaN; otherwise false. --=20 2.43.0 From nobody Mon May 25 20:37:29 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1778192343; cv=none; d=zohomail.com; s=zohoarc; b=MEkLMXKpruD4OPhaZhDmWY0E28QYzJvl/r+rxTKvUt7cLeCK2C/lY+QfJbl+xCzdcx7YbB3MjAOn4sM7I13SBda+QOvRWYT83rsNYOSIKF0tkvBC/RiZx6fDnnPVoDk32xf2TpAhnN9+Ssw8umLkoKGKBJOcSt+lJweVkl3OWgw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1778192343; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=ql6IrJYv3xEXqYOspRQ/aUl8zlzTCfoV/nJUo5gvq8Y=; b=krqvKY/nlaFC06U6cFyR3f0Gk9feGdEuqBHruACh5ev1IRz4LLlCrYTVobw3+TEYDZpM68Xiv6g/VrCvy6L3EmHVYhsRLb05Rbkh2nsRVsZ6Ca9EpD08r5/ROkmwqWxPDxMSpSY9Y1cRJd022s1zUNubGt2LGACBCKwnBudEpG4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists1p.gnu.org (lists1p.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1778192343587142.86047140045696; Thu, 7 May 2026 15:19:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists1p.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1wL72R-0000vB-9Y; Thu, 07 May 2026 18:17:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1wL72P-0000uj-OL for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:45 -0400 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1wL72N-0003GE-IC for qemu-devel@nongnu.org; Thu, 07 May 2026 18:17:45 -0400 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-69489b43d66so493521eaf.2 for ; Thu, 07 May 2026 15:17:42 -0700 (PDT) Received: from stoup.attlocal.net ([2600:381:c938:6375:9641:bbb2:a93a:bb4c]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435573e7254sm45037fac.14.2026.05.07.15.17.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 15:17:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778192261; x=1778797061; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ql6IrJYv3xEXqYOspRQ/aUl8zlzTCfoV/nJUo5gvq8Y=; b=i74wCC1ru0QKwF7H4+Z5zmZ6HN3YdM9Uvprw706Lt5ES+x9mMK/5kyG276ANQzO9EP CP9a6IKZiGV1d8WwqT6jkZeUV9DoI+hVqKqHwRcLotYEKajbkHQrJOzihovirCNxy8DI lF+4rzalXDldeEbwsKsWi1YvEOkFqQMCEZpMIFw42O4IKTOzAcNSQL3Y4Rvw84bZZUyq lsSWUfNFzQSd2TlEynVvqQaUdlqY4S8wklS9B1kqmjFR/VvI4i12wvn3/rxLbqw6fXyW o3EJp50Y2hiE7o7A8KFOLsSPNEU4g+xoSK8h1t+Gqcq8Sh8FRF905yXDfZdQ6D2ZsPXm yLhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778192261; x=1778797061; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ql6IrJYv3xEXqYOspRQ/aUl8zlzTCfoV/nJUo5gvq8Y=; b=fVzVnODR2wietO2jTb2cmC2dqHYF8wEAGQ1kayNSjaQ2abrx+5nKck/zbIBraZ+rd3 +BvbeASwkwUyRqzJd1umMmAn+Pdd8UswjtIe13ubHMafKFcz1L1c5IPTjVBdkNNWqtBJ 7rGiT+deGeVdt34WeXLGr84qNf17oa+n0oUTuQqjiKMgdG9wRuMPMX5Nxvqo0nAzEZ0d vvRnCiN+Qb3APb7L8W3A69fYntNmpaxdcgkM5ODtOLgccpFdYt4NEM2gxlEZHywDURF3 D0mTV0gIIkvx4i1/a8sVhAKQz0xwxWVZwgi37JSmZ31L1YS3gsO1nnVVLQ4FrVfaSInK RIHw== X-Gm-Message-State: AOJu0Yy49rRcxyKwxGobf8dVoupOs/0KnfzqGEj5+a0kFddD5GrHF0/L u4n2zTwiV4DpGlnxRD0KFV3VikmQazGfpwM/rGakl0Xg8LfH2Unm+z18d64ynFlTKCtzkfR2SwH XI/2H X-Gm-Gg: AeBDieveCn2lFVgAZfdUssg/BG73pFL9FLQOUbThyXQOfzm2yvVmOv0JJUyqqTB3xCn 8Mg/nZvbWuaunVZf9kawjYYOQ013A4AELcRxWqqScEDlBu+4P0wqDdcjjOLAFbsbhmcDWsnYcc/ 6R1mhckB+IHs98fTmMauBNkExkukp4bAVLwzeBECerR2juV1TDIqVmgwMtjB/Pit2+KmD5TeEyl AA0duO+7q3suSxGWvxb4jluGXQWgpjjFpQmZeR5owNqAcXQnuqykbsIE+ha255lq6mAZ7b+haa7 O6P5OivZRm78a57WufLUEgtZkBHCFIqRqFD8tlycbWz1J2bCH+2bF6PojYE/xUPjjaCLKo/AkOr d9EmEkBtQThO69nIQKd9zTAuZWfBJglCOidFQHPsujW9AY7aWDS4qYEsWVYyU5/e5m5xayc5jGg SpZG1QCINdMhy+BhlsOuGqk5U+eg3X7swx96d1eRzKqh7RCA== X-Received: by 2002:a05:6820:180e:b0:696:155e:cd49 with SMTP id 006d021491bc7-69998d61d09mr5441497eaf.54.1778192261336; Thu, 07 May 2026 15:17:41 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 18/18] fpu: Reorg float_status Date: Thu, 7 May 2026 17:17:17 -0500 Message-ID: <20260507221717.486023-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260507221717.486023-1-richard.henderson@linaro.org> References: <20260507221717.486023-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists1p.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::c30; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc30.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.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1778192344164158500 Content-Type: text/plain; charset="utf-8" Use bitfields to compress float_status from 18 bytes down to 8 bytes. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/fpu/softfloat-types.h | 53 ++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index b83f67defc..d77f48f6b0 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -327,7 +327,7 @@ typedef enum __attribute__((__packed__)) { * This is a flag which can be ORed in with any of the above * DNaN behaviour options. */ - float_infzeronan_suppress_invalid =3D (1 << 7), + float_infzeronan_suppress_invalid =3D (1 << 2), } FloatInfZeroNaNRule; =20 /* @@ -402,22 +402,39 @@ typedef enum __attribute__((__packed__)) { */ =20 typedef struct float_status { - FloatExceptionFlags float_exception_flags; - FloatRoundMode float_rounding_mode; - FloatX80RoundPrec floatx80_rounding_precision; - FloatX80Behaviour floatx80_behaviour; - Float2NaNPropRule float_2nan_prop_rule; - Float3NaNPropRule float_3nan_prop_rule; - FloatInfZeroNaNRule float_infzeronan_rule; - FloatSNaNRule float_snan_rule; - bool tininess_before_rounding; + FloatExceptionFlags float_exception_flags : 16; + + /* + * Floating point status controls. + * Items that, in general, may be updated by writes to an architectural + * floating point control register. + */ + FloatRoundMode float_rounding_mode : 3; + FloatX80RoundPrec floatx80_rounding_precision : 2; /* should denormalised results go to zero and set output_denormal_flus= hed? */ - bool flush_to_zero; - /* do we detect and flush denormal results before or after rounding? */ - bool ftz_before_rounding; + bool flush_to_zero : 1; /* should denormalised inputs go to zero and set input_denormal_flushe= d? */ - bool flush_inputs_to_zero; - bool default_nan_mode; + bool flush_inputs_to_zero : 1; + /* should default nans be produced instead of propagating an input nan= ? */ + bool default_nan_mode : 1; + /* should overflowed results subtract re_bias to its exponent? */ + bool rebias_overflow : 1; + /* should underflowed results add re_bias to its exponent? */ + bool rebias_underflow : 1; + + /* + * Floating point behaviour controls. + * Items that, in general, will be set at cpu realization because + * the behaviour is baked into the specific hardware implementation. + */ + bool tininess_before_rounding : 1; + /* do we detect and flush denormal results before or after rounding? */ + bool ftz_before_rounding : 1; + FloatSNaNRule float_snan_rule : 2; + Float2NaNPropRule float_2nan_prop_rule : 3; + Float3NaNPropRule float_3nan_prop_rule : 7; + FloatInfZeroNaNRule float_infzeronan_rule: 3; + FloatX80Behaviour floatx80_behaviour : 5; /* * The pattern to use for the default NaN. Here the high bit specifies * the default NaN's sign bit, and bits 6..0 specify the high bits of = the @@ -427,11 +444,7 @@ typedef struct float_status { * this to the correct non-zero value, or we will assert when trying to * create a default NaN. */ - uint8_t default_nan_pattern; - /* should overflowed results subtract re_bias to its exponent? */ - bool rebias_overflow; - /* should underflowed results add re_bias to its exponent? */ - bool rebias_underflow; + unsigned default_nan_pattern : 8; } float_status; =20 #endif /* SOFTFLOAT_TYPES_H */ --=20 2.43.0