From nobody Thu Dec 26 10:34:23 2024 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=1732790710; cv=none; d=zohomail.com; s=zohoarc; b=dFpv+X99IQ1Evme+mDzcOH3vuY5jJFAHggqjvgqiT3y7ZKVtoA0JCXo6E73tjDwdGLZmahNsE9ujYzITqj/JNyCILl5SyvPUv+YDlKmqp85qurAe3nPOp+Lx4dlVxDdccYQ1MpIaKItH2rlH2FviuA+97QCe2Tp3A3kthFKO1U0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790710; h=Content-Transfer-Encoding:Cc:Cc: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; bh=mSyVUvmTPOthYAn2vH+po+80+oHdzpSNwVHWEQhdvFo=; b=AX4/3kheOQlfuFnPYcI7nIFpmIZoUs4+7C9hK/PSLOJk3WTRHVbZ1CgoOBh7syHEyYVGDM+s1AuddJ1PwaHkrY+qwoTjoiFgn2WdIcVkgRf38ysFhdPoifLiWni9sFPPiFkCIbyqbkOXkY4iKOow26Ddi7ytZ0C9nYL5VR99hfg= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790710534813.4083054030166; Thu, 28 Nov 2024 02:45:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGbzU-0001wM-UX; Thu, 28 Nov 2024 05:43:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzS-0001tv-Lc for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:18 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzP-0000PN-81 for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:18 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-434a0fd9778so6060545e9.0 for ; Thu, 28 Nov 2024 02:43:14 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790594; x=1733395394; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mSyVUvmTPOthYAn2vH+po+80+oHdzpSNwVHWEQhdvFo=; b=RrsJNYeFgayL7gMpFYGBAdO3CL6ikjysMM+5O5s0FaR25PoRqKjKiPKoj+hLHcoP0L iujXrq0sl6iMgrOxhPTwtjz13/PS4kBoZFMusU2EnBWdxdIuvj4riHJHG8vP9O/jNoBs sSwflTrktexgCrEDrBDrGaDxKJ4DA34kBp41EW6t0Fgk2ES8ONpf1ZDjDouRyA42KV0f ZxWy7omlpsLAhvlwRIlaiwohzB4w928o1f1hUZ3lIkdOOPxZ980ct6Dx7oGLLkyAEo+b qw6IR5KIjd0z/NHRhI8SqM4vmzMuunxny7dDElnU4zVw+hCgrC7M/iDwk3IkPVvoFrMB MgxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790594; x=1733395394; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mSyVUvmTPOthYAn2vH+po+80+oHdzpSNwVHWEQhdvFo=; b=bRAB+p4l4oqCuemWO+TkNrnEytAFTnLjO62YhX9nA5TIJKSXAP/A9HmX7/Tx7Fk3Tw +c4yP/pBV4ZhItYMSx1QmHdgwhw4sedKOB/UeiQ3JUVtHd4Yom94sBwBfta/DK8SeUm/ NvbbUw07HRxp8Pcu+k/8MXp3sT0UD1dXWkaQWreZkKujEeF5J+sOWqttxn8VUBjo8Mn+ 31TLY0q2mZYYnF4zs2OqjTWlHNowYoc+UC+e3vqtN+tX+sdaWL3uSJg3oLSoB9Vt0R7D +2M+l8CcdrsCJDlOiAcXvHxswSZddJHbSG7575H8V0IqlAJY66sqbVvW+QqSbW2+y9iA mCRw== X-Gm-Message-State: AOJu0YyKCs9fpwu2agVDk6pie/whqi4sRYaraMfzqGOXTfL1+OsTK2er LZTsEsXKsm+1Z96LK5/myJoPNQQZmVy6TmUUgOyKjBj6u3hs9ZKY+W04D01HBPiOCxDL9H8t6UQ r X-Gm-Gg: ASbGncuVYPUtk9HQssnV6TC1aQUx0THUBmyyhJLN6AKqZDzKez9zuwzPvmsKmHEANRj LsMADRhKtlfMnt7mHmpjclZaE4hvRYcdztsPFln93xAVSDwS5IPJZvnGXH1EzJc0YO7ReFRAXT8 qbgfarUTTZk5V2q3exb5HocUh2hlOEiJ4Vn/6KCZzaqoZLk9LphLHKbwLeWiaFFxivtO/00xFW5 +PUw74DJwRJBaGsjO24DvUjqvtUUvmCs+SickvGt4th9fRqWCrrgNo= X-Google-Smtp-Source: AGHT+IEnmQFdf94EyW0+87R6ugb6E5SiCnBQ2ZMZdtsS835ZaEq231LF7X5KL39Q+yvycbFJZ4gYiA== X-Received: by 2002:a05:600c:3596:b0:434:a386:6cf with SMTP id 5b1f17b1804b1-434a9dbbc00mr59891585e9.2.1732790593612; Thu, 28 Nov 2024 02:43:13 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 01/25] fpu: handle raising Invalid for infzero in pick_nan_muladd Date: Thu, 28 Nov 2024 10:42:46 +0000 Message-Id: <20241128104310.3452934-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x333.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790711727019100 Content-Type: text/plain; charset="utf-8" For IEEE fused multiply-add, the (0 * inf) + NaN case should raise Invalid for the multiplication of 0 by infinity. Currently we handle this in the per-architecture ifdef ladder in pickNaNMulAdd(). However, since this isn't really architecture specific we can hoist it up to the generic code. For the cases where the infzero test in pickNaNMulAdd was returning 2, we can delete the check entirely and allow the code to fall into the normal pick-a-NaN handling, because this will return 2 anyway (input 'c' being the only NaN in this case). For the cases where infzero was returning 3 to indicate "return the default NaN", we must retain that "return 3". For Arm, this looks like it might be a behaviour change because we used to set float_flag_invalid | float_flag_invalid_imz only if C is a quiet NaN. However, it is not, because Arm target code never looks at float_flag_invalid_imz, and for the (0 * inf) + SNaN case we already raised float_flag_invalid via the "abc_mask & float_cmask_snan" check in pick_nan_muladd. For any target architecture using the "default implementation" at the bottom of the ifdef, this is a behaviour change but will be fixing a bug (where we failed to raise the Invalid exception for (0 * inf + QNaN). The architectures using the default case are: * hppa * sh4 * tricore The Tricore and SH4 CPU architecture manuals are clear that this should have raised Invalid; HPPA is a bit vaguer but still seems clear enough. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- fpu/softfloat-parts.c.inc | 13 +++++++------ fpu/softfloat-specialize.c.inc | 29 +---------------------------- 2 files changed, 8 insertions(+), 34 deletions(-) diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index cc6e06b9761..d63cd957a19 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -66,19 +66,20 @@ static FloatPartsN *partsN(pick_nan_muladd)(FloatPartsN= *a, FloatPartsN *b, int ab_mask, int abc_mask) { int which; + bool infzero =3D (ab_mask =3D=3D float_cmask_infzero); =20 if (unlikely(abc_mask & float_cmask_snan)) { float_raise(float_flag_invalid | float_flag_invalid_snan, s); } =20 - which =3D pickNaNMulAdd(a->cls, b->cls, c->cls, - ab_mask =3D=3D float_cmask_infzero, s); + if (infzero) { + /* This is (0 * inf) + NaN or (inf * 0) + NaN */ + float_raise(float_flag_invalid | float_flag_invalid_imz, s); + } + + which =3D pickNaNMulAdd(a->cls, b->cls, c->cls, infzero, s); =20 if (s->default_nan_mode || which =3D=3D 3) { - /* - * Note that this check is after pickNaNMulAdd so that function - * has an opportunity to set the Invalid flag for infzero. - */ parts_default_nan(a, s); return a; } diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 9bca03c4aed..c557c41b2af 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -480,7 +480,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, * the default NaN */ if (infzero && is_qnan(c_cls)) { - float_raise(float_flag_invalid | float_flag_invalid_imz, status); return 3; } =20 @@ -507,7 +506,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, * case sets InvalidOp and returns the default NaN */ if (infzero) { - float_raise(float_flag_invalid | float_flag_invalid_imz, statu= s); return 3; } /* Prefer sNaN over qNaN, in the a, b, c order. */ @@ -529,10 +527,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, * For MIPS systems that conform to IEEE754-2008, the (inf,zero,na= n) * case sets InvalidOp and returns the input value 'c' */ - if (infzero) { - float_raise(float_flag_invalid | float_flag_invalid_imz, statu= s); - return 2; - } /* Prefer sNaN over qNaN, in the c, a, b order. */ if (is_snan(c_cls)) { return 2; @@ -553,10 +547,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, * For LoongArch systems that conform to IEEE754-2008, the (inf,zero,n= an) * case sets InvalidOp and returns the input value 'c' */ - if (infzero) { - float_raise(float_flag_invalid | float_flag_invalid_imz, status); - return 2; - } + /* Prefer sNaN over qNaN, in the c, a, b order. */ if (is_snan(c_cls)) { return 2; @@ -576,10 +567,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, * to return an input NaN if we have one (ie c) rather than generating * a default NaN */ - if (infzero) { - float_raise(float_flag_invalid | float_flag_invalid_imz, status); - return 2; - } =20 /* If fRA is a NaN return it; otherwise if fRB is a NaN return it; * otherwise return fRC. Note that muladd on PPC is (fRA * fRC) + frB @@ -592,14 +579,9 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, return 1; } #elif defined(TARGET_RISCV) - /* For RISC-V, InvalidOp is set when multiplicands are Inf and zero */ - if (infzero) { - float_raise(float_flag_invalid | float_flag_invalid_imz, status); - } return 3; /* default NaN */ #elif defined(TARGET_S390X) if (infzero) { - float_raise(float_flag_invalid | float_flag_invalid_imz, status); return 3; } =20 @@ -617,11 +599,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, return 2; } #elif defined(TARGET_SPARC) - /* For (inf,0,nan) return c. */ - if (infzero) { - float_raise(float_flag_invalid | float_flag_invalid_imz, status); - return 2; - } /* Prefer SNaN over QNaN, order C, B, A. */ if (is_snan(c_cls)) { return 2; @@ -641,10 +618,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, * For Xtensa, the (inf,zero,nan) case sets InvalidOp and returns * an input NaN if we have one (ie c). */ - if (infzero) { - float_raise(float_flag_invalid | float_flag_invalid_imz, status); - return 2; - } if (status->use_first_nan) { if (is_nan(a_cls)) { return 0; --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790651; cv=none; d=zohomail.com; s=zohoarc; b=SlaB2HoUDNQyGo38KChi9dlfV1+mkbTllj+nMI5cAe7cKt/+x73jW+9YiWwHWXIW547mT//IS2rS+Rf4+4uGYoQWVJyjUfNWQxyknYa0c36ne2r/eQY5RcF58wGT4uqNj0JP/fHDt8lwpWhDVjcBQZuJI9UV8mBH/UPzUiPYah4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790651; h=Content-Transfer-Encoding:Cc:Cc: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; bh=ZOEO9KTfNfjM4NNmDftZ94Iu5DxbBvsjabJVOrSGkdQ=; b=jvMmmHIl0JImI8se3XDfydhfuauH6b9wtKxztdQVh2K1Bd0FTzME0hMXJoAh1jYuvN70BNMvuNJ354MudHfsf3p+IkLOhP29ncybSParoX0Sl3/dm5yzCn3X3ImlrE68PSqEnjRh7WeKxpg7RH0M/QWUfve+MHuyS6ZJF9ic7QM= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790651534272.6968441937805; Thu, 28 Nov 2024 02:44:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGbzV-0001xC-Sj; Thu, 28 Nov 2024 05:43:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzT-0001uR-FK for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:19 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzQ-0000Qa-Bf for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:19 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-382610c7116so502721f8f.0 for ; Thu, 28 Nov 2024 02:43:15 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790595; x=1733395395; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZOEO9KTfNfjM4NNmDftZ94Iu5DxbBvsjabJVOrSGkdQ=; b=v1Cj6jut/p2F0IxA6hJ4P4H1k+uEAx31OVT7VhUIKciDTgdnS26zbIjdACa2npQOVU /PJ5hwT+Q0VIQ3ZNAdOH9NLIDPHEV2HO0F61k69scqry5vBSRMPnFHUvrhz9jEeOSVt6 qMU75wyGf/C2BTRNTiFCjD1AdLZg1RqAaHx2e2zO9QbmIxN2cThgfInXOYZEq4nudiDK zcVy5wyJFk2Z6kMvCaY9ZFjGd2jKECc9T6IlBbqrIwZr/PdN9GneG6djITjFYxvfA1sn xZGdklOiIZ9+Q2HAPrKtofSdM2+KiuYDhspHM/TrGxIYpwBnK2kZ2ZLjs93DXnFRtj3D PtAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790595; x=1733395395; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZOEO9KTfNfjM4NNmDftZ94Iu5DxbBvsjabJVOrSGkdQ=; b=LujJpz3gygtPmHehzgnsDQP3t7q2SQ4NNLrStIQMbbxEoQQ1nkctJaeVFpeHkEiIuj rPzYyOAoW1wHWOsemjqKq7pJZDXNYxIA6pRH1FyHGP5X0ClwTh6Z+kNYwknWqmCX/T8T pxCV2bCeRbpudAgcIdGZEdc3Ct9lnZgT9LcW2fm8bAEDX9A8L8s6ZOpfm0plnVt0v/oO jh6ixRB7QGz80p2aasTEjf84GVGHqui6+61vjcIFkoa3f6Ehs5L3/C98UETXJMYT003h Wa4EvDCW+075gE07EpoQtQjVYEhDAdahkn1hCp27HUfBoeAtd11zlyn3xrWeVE3RwI1T JN0Q== X-Gm-Message-State: AOJu0YzXTqDLuuxMYA+zj/+QwW4Z7is4nHwxJoO7Yf9ZeOcnQ0qr+XFA 8S9entiAGgnDqWS1Yi5UaeeRKky3Nzane4PiX/XerxhYXrV48x2RUrAIMBoXexEatALHbyovO6G u X-Gm-Gg: ASbGncttcZkAjyfXm3e9vmKr93dGPp0WD6zectQQHylCHHCaSwspHOK8nQq9rvOyhxw cmpSj7P0Er9V7Zc9I0BHegAAD4MtAgnu0NMqAxj5HUaYUrL4RodLvuMdN27IDrdNUYYs5EvjDl6 OXpQyNcyHApEjgYJlApyxZ3yIdxQG7nFJnBTzd+SMX2b6d/OMWNuJi5f+7wOA1rrcRgLNiAwdOI JCBQufPDuB47Fx2G+cx/9SmNQL2+X8wFjq6fytg0VzNuHp6+We9IMA= X-Google-Smtp-Source: AGHT+IEHV2k+O/xTAwFMT5IKBm3rjKsR1oFixoePTjRIgioOUVa39hCCEWN6/3kQ60QTDkyvzGk3rw== X-Received: by 2002:a5d:5f86:0:b0:382:4a6c:fdd4 with SMTP id ffacd0b85a97d-385c6cca1edmr4753490f8f.9.1732790594521; Thu, 28 Nov 2024 02:43:14 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 02/25] fpu: Check for default_nan_mode before calling pickNaNMulAdd Date: Thu, 28 Nov 2024 10:42:47 +0000 Message-Id: <20241128104310.3452934-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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: 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: 1732790653438019100 Content-Type: text/plain; charset="utf-8" If the target sets default_nan_mode then we're always going to return the default NaN, and pickNaNMulAdd() no longer has any side effects. For consistency with pickNaN(), check for default_nan_mode before calling pickNaNMulAdd(). When we convert pickNaNMulAdd() to allow runtime selection of the NaN propagation rule, this means we won't have to make the targets which use default_nan_mode also set a propagation rule. Since RiscV always uses default_nan_mode, this allows us to remove its ifdef case from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- fpu/softfloat-parts.c.inc | 8 ++++++-- fpu/softfloat-specialize.c.inc | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index d63cd957a19..aac1f9cd28c 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -77,9 +77,13 @@ static FloatPartsN *partsN(pick_nan_muladd)(FloatPartsN = *a, FloatPartsN *b, float_raise(float_flag_invalid | float_flag_invalid_imz, s); } =20 - which =3D pickNaNMulAdd(a->cls, b->cls, c->cls, infzero, s); + if (s->default_nan_mode) { + which =3D 3; + } else { + which =3D pickNaNMulAdd(a->cls, b->cls, c->cls, infzero, s); + } =20 - if (s->default_nan_mode || which =3D=3D 3) { + if (which =3D=3D 3) { parts_default_nan(a, s); return a; } diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index c557c41b2af..81a67eb67b5 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -475,6 +475,13 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls, static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_= cls, bool infzero, float_status *status) { + /* + * We guarantee not to require the target to tell us how to + * pick a NaN if we're always returning the default NaN. + * But if we're not in default-NaN mode then the target must + * specify. + */ + assert(!status->default_nan_mode); #if defined(TARGET_ARM) /* For ARM, the (inf,zero,qnan) case sets InvalidOp and returns * the default NaN @@ -578,8 +585,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, } else { return 1; } -#elif defined(TARGET_RISCV) - return 3; /* default NaN */ #elif defined(TARGET_S390X) if (infzero) { return 3; --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790627; cv=none; d=zohomail.com; s=zohoarc; b=eSGszXa0Tk80EWfG07eN33X8kaWRZF/41Pm3UsdNkVr6pcqP71mDAjOCEvBsSK6zDtScF+uWOjCWtF8xSVQvYhzVfkvsyLcb5q0iq0OPbnH60yM/G7CQKQM1Ej1oIgtoVXAU045ZvRX6wAH4F6qmpVJUIJb2sLQ9qE1FJhKuPSY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790627; h=Content-Transfer-Encoding:Cc:Cc: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; bh=XbqQkBG4nS4k6Fnk766q2xcLuZrRdjETQUTauBBIIX8=; b=XaOU2JYHjCuNBFDIPziZv7OBIFhDjsa/03wosN+kDKyEQ9BDG/w92j6Qu9EcmO8wfKeWv9zemGTMh/nbI1Yx49q43UC/sxkD3+Jho9T2QDUSTwsRpv8Bma3Gps2YIXe4zWG7zgpimezSLdufcEDkXDfqSJOEzXjNJ/57TrS8hC8= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790627267439.07416790306775; Thu, 28 Nov 2024 02:43:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGbzY-0001zm-P5; Thu, 28 Nov 2024 05:43:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzW-0001xb-05 for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:22 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzR-0000R1-AP for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:21 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-382442b7d9aso511500f8f.1 for ; Thu, 28 Nov 2024 02:43:16 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790596; x=1733395396; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XbqQkBG4nS4k6Fnk766q2xcLuZrRdjETQUTauBBIIX8=; b=M1yfbr1zXpyfNG92Sx/MLFGCYb07FnHf8EKcNn9JcFMIy+kbegzBRhWdgubJ+ottX+ zzD8SOD1cOc+aVoaUHUNX7BFaly1XY2bqULNkgtcTf58PPshus9N96JW6W+/vY/4GLgZ U93NlGSwS9/YbNK3WfDayB3rrNGcVgWVFDR9bIUN9/c/NGXgJKFni1Jp7BqN06ZiV7u5 HssFwyDcZblUWytwvahZFJzkE75FzsA4mXr93NhEF+jdcFbMDNm1xxQTqtQ8zjdSFiEF x+/LYfjVsQT4s05FMqm1Gq7Az3QMReqwR+rP4cRRPgR6kCV4onOZY7Bde/YtS9Qi1wN7 U63A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790596; x=1733395396; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XbqQkBG4nS4k6Fnk766q2xcLuZrRdjETQUTauBBIIX8=; b=k/lbmCNB00vReHeBmMUyusGY4+qowyQglY8/XpOQyEXvoZ0dHNYDyXYQ5lp1Xu+1mq vBIlVE3w09Rdsn6wR56/ZpDo47yOQqxIUXogTjLG1XMbPEiAljLQ9EnJEfzFcLGdndWF qbTXQ/kqospyzvIYzAgNDbI66kEQvtwfuDuTtjsaGBw3E6ZrVXt+WiexYW4jQdJpilVD qwU+ThlX4zKS2NM9Abz1ZSRyyic/MQIApvCZuhpbBji/ZNJLavX8+kQ91/aVb5gS+wC2 2pUmLP9jo19CADVKf/zrKLbAf2vfJ9k+EJkm95XjOoPycA1ifCQtXnSKfgF6CnjpBl9M jr5Q== X-Gm-Message-State: AOJu0YyNF6h3MWCdfhfArzahUk5CqSBrKi7jBCAemaM4Xj1G934QJh4k B3wQWd3DfwYI5DSrfwlKGig1nfMqp6rZpDcj6MG1+FjC3V3yUuZu9tIhA2w8CUCkiR9ydIKlnxH x X-Gm-Gg: ASbGncttq3GeAaU4MSY4FDscdTHepQXiJnWToOucyuEKbP6M3ssa9mcwlVnoiom0cy8 mNeTif6fqsSuwoRGFsd3qqtM/TAATv6aowS4gbgF4j688StF5/QFQCrHhM3FUtXMqvscFUGT4aF sAWGDkBx5tFTMoEwkF3bX5m/Vb3x5KA7lpmxCjTtcs6lZpY2SkQi59NNvgKUhJrGOIxcPQGUFBr tP84z2ujW76sw5a20i2S1kyfIoirLCOYcToDQNUlUhmnxH2mYR/heo= X-Google-Smtp-Source: AGHT+IFd3mlPBDdVk3zjWvVp53gbvmNrA7mV68de8ZqL8Sneu4L6ggQoBbXs/tvpPx5knqDrUg0L6A== X-Received: by 2002:a5d:5f8f:0:b0:382:41ad:d8d1 with SMTP id ffacd0b85a97d-385c6ee21c7mr5998188f8f.53.1732790595577; Thu, 28 Nov 2024 02:43:15 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 03/25] softfloat: Allow runtime choice of inf * 0 + NaN result Date: Thu, 28 Nov 2024 10:42:48 +0000 Message-Id: <20241128104310.3452934-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790630168019100 Content-Type: text/plain; charset="utf-8" IEEE 758 does not define a fixed rule for what NaN to return in the case of a fused multiply-add of inf * 0 + NaN. Different architectures thus do different things: * some return the default NaN * some return the input NaN * Arm returns the default NaN if the input NaN is quiet, and the input NaN if it is signalling We want to make this logic be runtime selected rather than hardcoded into the binary, because: * this will let us have multiple targets in one QEMU binary * the Arm FEAT_AFP architectural feature includes letting the guest select a NaN propagation rule at runtime In this commit we add an enum for the propagation rule, the field in float_status, and the corresponding getters and setters. We change pickNaNMulAdd to honour this, but because all targets still leave this field at its default 0 value, the fallback logic will pick the rule type with the old ifdef ladder. Note that four architectures both use the muladd softfloat functions and did not have a branch of the ifdef ladder to specify their behaviour (and so were ending up with the "default" case, probably wrongly): i386, HPPA, SH4 and Tricore. SH4 and Tricore both set default_nan_mode, and so will never get into pickNaNMulAdd(). For HPPA and i386 we retain the same behaviour as the old default-case, which is to not ever return the default NaN. This might not be correct but it is not a behaviour change. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/fpu/softfloat-helpers.h | 11 ++++ include/fpu/softfloat-types.h | 23 +++++++++ fpu/softfloat-specialize.c.inc | 91 ++++++++++++++++++++++----------- 3 files changed, 95 insertions(+), 30 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helper= s.h index 453188de70b..0bf44dc6087 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -81,6 +81,12 @@ static inline void set_float_2nan_prop_rule(Float2NaNPro= pRule rule, status->float_2nan_prop_rule =3D rule; } =20 +static inline void set_float_infzeronan_rule(FloatInfZeroNaNRule rule, + float_status *status) +{ + status->float_infzeronan_rule =3D rule; +} + static inline void set_flush_to_zero(bool val, float_status *status) { status->flush_to_zero =3D val; @@ -137,6 +143,11 @@ static inline Float2NaNPropRule get_float_2nan_prop_ru= le(float_status *status) return status->float_2nan_prop_rule; } =20 +static inline FloatInfZeroNaNRule get_float_infzeronan_rule(float_status *= status) +{ + return status->float_infzeronan_rule; +} + static inline bool get_flush_to_zero(float_status *status) { return status->flush_to_zero; diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index 8f39691dfd0..27a1c96754d 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -207,6 +207,28 @@ typedef enum __attribute__((__packed__)) { float_2nan_prop_x87, } Float2NaNPropRule; =20 +/* + * Rule for result of fused multiply-add 0 * Inf + NaN. + * This must be a NaN, but implementations differ on whether this + * is the input NaN or the default NaN. + * + * You don't need to set this if default_nan_mode is enabled. + * When not in default-NaN mode, it is an error for the target + * not to set the rule in float_status if it uses muladd, and we + * will assert if we need to handle an input NaN and no rule was + * selected. + */ +typedef enum __attribute__((__packed__)) { + /* No propagation rule specified */ + float_infzeronan_none =3D 0, + /* Result is never the default NaN (so always the input NaN) */ + float_infzeronan_dnan_never =3D 0, + /* Result is always the default NaN */ + float_infzeronan_dnan_always, + /* Result is the default NaN if the input NaN is quiet */ + float_infzeronan_dnan_if_qnan, +} FloatInfZeroNaNRule; + /* * Floating Point Status. Individual architectures may maintain * several versions of float_status for different functions. The @@ -219,6 +241,7 @@ typedef struct float_status { FloatRoundMode float_rounding_mode; FloatX80RoundPrec floatx80_rounding_precision; Float2NaNPropRule float_2nan_prop_rule; + FloatInfZeroNaNRule float_infzeronan_rule; bool tininess_before_rounding; /* should denormalised results go to zero and set the inexact flag? */ bool flush_to_zero; diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 81a67eb67b5..f5b422e07b5 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -475,6 +475,8 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls, static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_= cls, bool infzero, float_status *status) { + FloatInfZeroNaNRule rule =3D status->float_infzeronan_rule; + /* * We guarantee not to require the target to tell us how to * pick a NaN if we're always returning the default NaN. @@ -482,14 +484,68 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass= b_cls, FloatClass c_cls, * specify. */ assert(!status->default_nan_mode); + + if (rule =3D=3D float_infzeronan_none) { + /* + * Temporarily fall back to ifdef ladder + */ #if defined(TARGET_ARM) - /* For ARM, the (inf,zero,qnan) case sets InvalidOp and returns - * the default NaN - */ - if (infzero && is_qnan(c_cls)) { - return 3; + /* + * For ARM, the (inf,zero,qnan) case returns the default NaN, + * but (inf,zero,snan) returns the input NaN. + */ + rule =3D float_infzeronan_dnan_if_qnan; +#elif defined(TARGET_MIPS) + if (snan_bit_is_one(status)) { + /* + * For MIPS systems that conform to IEEE754-1985, the (inf,zer= o,nan) + * case sets InvalidOp and returns the default NaN + */ + rule =3D float_infzeronan_dnan_always; + } else { + /* + * For MIPS systems that conform to IEEE754-2008, the (inf,zer= o,nan) + * case sets InvalidOp and returns the input value 'c' + */ + rule =3D float_infzeronan_dnan_never; + } +#elif defined(TARGET_PPC) || defined(TARGET_SPARC) || \ + defined(TARGET_XTENSA) || defined(TARGET_HPPA) || \ + defined(TARGET_I386) || defined(TARGET_LOONGARCH) + /* + * For LoongArch systems that conform to IEEE754-2008, the (inf,ze= ro,nan) + * case sets InvalidOp and returns the input value 'c' + */ + /* + * For PPC, the (inf,zero,qnan) case sets InvalidOp, but we prefer + * to return an input NaN if we have one (ie c) rather than genera= ting + * a default NaN + */ + rule =3D float_infzeronan_dnan_never; +#elif defined(TARGET_S390X) + rule =3D float_infzeronan_dnan_always; +#endif } =20 + if (infzero) { + /* + * Inf * 0 + NaN -- some implementations return the default NaN he= re, + * and some return the input NaN. + */ + switch (rule) { + case float_infzeronan_dnan_never: + return 2; + case float_infzeronan_dnan_always: + return 3; + case float_infzeronan_dnan_if_qnan: + return is_qnan(c_cls) ? 3 : 2; + default: + g_assert_not_reached(); + } + } + +#if defined(TARGET_ARM) + /* This looks different from the ARM ARM pseudocode, because the ARM A= RM * puts the operands to a fused mac operation (a*b)+c in the order c,a= ,b. */ @@ -508,13 +564,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, } #elif defined(TARGET_MIPS) if (snan_bit_is_one(status)) { - /* - * For MIPS systems that conform to IEEE754-1985, the (inf,zero,na= n) - * case sets InvalidOp and returns the default NaN - */ - if (infzero) { - return 3; - } /* Prefer sNaN over qNaN, in the a, b, c order. */ if (is_snan(a_cls)) { return 0; @@ -530,10 +579,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, return 2; } } else { - /* - * For MIPS systems that conform to IEEE754-2008, the (inf,zero,na= n) - * case sets InvalidOp and returns the input value 'c' - */ /* Prefer sNaN over qNaN, in the c, a, b order. */ if (is_snan(c_cls)) { return 2; @@ -550,11 +595,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, } } #elif defined(TARGET_LOONGARCH64) - /* - * For LoongArch systems that conform to IEEE754-2008, the (inf,zero,n= an) - * case sets InvalidOp and returns the input value 'c' - */ - /* Prefer sNaN over qNaN, in the c, a, b order. */ if (is_snan(c_cls)) { return 2; @@ -570,11 +610,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, return 1; } #elif defined(TARGET_PPC) - /* For PPC, the (inf,zero,qnan) case sets InvalidOp, but we prefer - * to return an input NaN if we have one (ie c) rather than generating - * a default NaN - */ - /* If fRA is a NaN return it; otherwise if fRB is a NaN return it; * otherwise return fRC. Note that muladd on PPC is (fRA * fRC) + frB */ @@ -586,10 +621,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, return 1; } #elif defined(TARGET_S390X) - if (infzero) { - return 3; - } - if (is_snan(a_cls)) { return 0; } else if (is_snan(b_cls)) { --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790683; cv=none; d=zohomail.com; s=zohoarc; b=RXGK5fUkoDBkuYeJIHF5//z4z+hG+McbQNGirMiy/iwNch12jVAA/grEPQBBAj98T0iS0wGgV2KxZYd0XPll3PDAImlhjYTIVsdwLvrN5MepO/zbzg6MHDcuBwVP/PbKFSkfIyjwm5b0Ks4AapkPyKwXcMKshGLWR62wLFtoU4Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790683; h=Content-Transfer-Encoding:Cc:Cc: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; bh=jI12Che8rR4gDrXI7XaPlHeXLQNnrp2Bpm/Wl6NH9ec=; b=U0x9J/py/zsLYFLaJvIk2FbOeJ1/fpoyEcv7S9gRJ73gHQja1/bYDMIMiTgenb73ckmN/2RjUyNgqlVvE4VuqlB8EQIM+KEXNsJioS7K1XiwiJWypjj1dAbBK6c4tKkmKMDCtiwGOYw8zZ6rSZhV16Ytbli6IyKNF5aceAxHgP4= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173279068319447.31671732353027; Thu, 28 Nov 2024 02:44:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc0J-0002RK-V2; Thu, 28 Nov 2024 05:44:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzX-0001yi-Ig for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:23 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzS-0000Rn-78 for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:22 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-434a2033562so5883135e9.1 for ; Thu, 28 Nov 2024 02:43:17 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790596; x=1733395396; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jI12Che8rR4gDrXI7XaPlHeXLQNnrp2Bpm/Wl6NH9ec=; b=nkNI/jGOcdtXU/t3irkXGhrb8F4xNZjmvsc0RhFGBAaQbDqG2heDynoTfV9qIBXW/r x0KD/BcJncH5cLap9TI0cQlR2k2YTf35fgbJS66gm2yYRdmpBGyDHXCosh46zBSWIO27 ArmoioehEfjO401LXeW1IJ4PYCzwf+GwCjC8ihWgl+zPLBoTFvZXmLDs6I41htbmmLEj rzScNuNQqnf2DLetg22Z2h2fAH08D2vi5EB2w8IpcYAifxgKm6BKGrGy+OW8xJuI27WJ 8/ZJNEDEY4RklcjDMeUQgXIDPSrbdIcizBIDaMPwCtgBAdhGDx0sjlMgvK+mpy+Jy8Ot 9NhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790596; x=1733395396; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jI12Che8rR4gDrXI7XaPlHeXLQNnrp2Bpm/Wl6NH9ec=; b=QQdkUO3891zM2lDqNPlbs65Df0NfoCg2Uy6kwOpSkD2uiugC36nYmHNtHi46Zibqwj DAbFnMq0FPoEt3vF8APFJTnPSUbXz57IdeCwLfejAr1/6HO4dCyo/q5Pl/CmGEiG3otU YBl94Bx5JkSXEepYFj1MPHJYhqpSj/JQJ9B3lsqXdceUIHMhp293wDFYE7923H6LNP8d tqOPKfy/ro9gNoJO6T1HgoUhvgyRtSSwEKn2mPrtYLaFuwWNv8NWQ+Cp/6bC5B5RTAse zIv0DAwU0XbbW3c8Xvb1Cx9FLX5Ks3Kb6eSTHcUUax4oQPRwSN5EgKnRqmrmLZplynXj Qd1Q== X-Gm-Message-State: AOJu0YwZPQcb6YOQvV11WnueAh3ief4++/VgXOoInsCDjp1m6+NrSg1V A45AWUWxwpwZ+p+5vWmIq3GPB7C357kn8M1YG8wjlmkw8PCQYzzPJxCe9kd+EyxpOmjsS++eAFe r X-Gm-Gg: ASbGncsENJnbEMMWrxndLm1kn3ebKiPO4JZN16PaUZc3WaEGc0n3/9NJ79eN63r/Png xZbcSEuT0BkV79gapQQZPOpj+EhOJut/oQC9LeDIj+kpzqZNzyKEH2m1yK4uml5YQ0P4MIP2p1N lUqIIvkLNetrij965rD7BtWxzV0a4IC4j5Y1Wrproyz5g3AIyYCnlnXitCMRa0Ouo41XrRq39Lf U0fDds1kgmyAwIz+LWawo4VNZpne1uYRnWKgyt9DscofjTtVlba8dw= X-Google-Smtp-Source: AGHT+IEg9PnTcT6BSRsSqrS8CdhAVEObZ4GIia4fpQ6/wBRhLPAJAaAuqSZKOxEWiKUIlV1NYlviHA== X-Received: by 2002:a05:6000:2d12:b0:382:3afd:1273 with SMTP id ffacd0b85a97d-385c6ec0b21mr4354997f8f.30.1732790596550; Thu, 28 Nov 2024 02:43:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 04/25] tests/fp: Explicitly set inf-zero-nan rule Date: Thu, 28 Nov 2024 10:42:49 +0000 Message-Id: <20241128104310.3452934-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790683530019100 Content-Type: text/plain; charset="utf-8" Explicitly set a rule in the softfloat tests for the inf-zero-nan muladd special case. In meson.build we put -DTARGET_ARM in fpcflags, and so we should select here the Arm rule of float_infzeronan_dnan_if_qnan. Reviewed-by: Richard Henderson --- tests/fp/fp-bench.c | 5 +++++ tests/fp/fp-test.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c index 75c07d5d1f1..fde64836194 100644 --- a/tests/fp/fp-bench.c +++ b/tests/fp/fp-bench.c @@ -488,7 +488,12 @@ static void run_bench(void) { bench_func_t f; =20 + /* + * These implementation-defined choices for various things IEEE + * doesn't specify match those used by the Arm architecture. + */ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &soft_status); + set_float_infzeronan_rule(float_infzeronan_dnan_if_qnan, &soft_status); =20 f =3D bench_funcs[operation][precision]; g_assert(f); diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c index 5f6f25c8821..251c278ede9 100644 --- a/tests/fp/fp-test.c +++ b/tests/fp/fp-test.c @@ -935,7 +935,12 @@ void run_test(void) { unsigned int i; =20 + /* + * These implementation-defined choices for various things IEEE + * doesn't specify match those used by the Arm architecture. + */ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &qsf); + set_float_infzeronan_rule(float_infzeronan_dnan_if_qnan, &qsf); =20 genCases_setLevel(test_level); verCases_maxErrorCount =3D n_max_errors; --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790678; cv=none; d=zohomail.com; s=zohoarc; b=FqqBHvRCuOjllePe9Va7uYavZrYIZFGaJVBe9CdSR7mN06IgZHz9AXPXjycvsLYH6yHpS6+Z3Ec6G0rGaUrLoSBi4FkYXtDoIeoQYq9eapCeXYHeikPaVKEzA1a6L2GC4U/KEHvUZA5Su50YKwXUc0jexe6RCJ26mL9HoOiUMK8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790678; h=Content-Transfer-Encoding:Cc:Cc: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; bh=4tTkIIhrcxBZurdxQEsXyUswGgpnjQ7q8C2Djt24mE4=; b=PPA346ohYas8zc0fCRh93Flqftunku1+eZCoTFwo6vh913iUBBlqS/29nLabjD6CF40OuiWfD1+69I8VXvRz3j3bST7Cp1bDlCsvos45KdEokpu04on28deD6UlflEvm9wKeF90SQJEDA+L0EjpQ6NQ0TmolnOfHeNh1BBKn0zA= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790678739489.8138611984933; Thu, 28 Nov 2024 02:44:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGbza-00021S-47; Thu, 28 Nov 2024 05:43:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzY-0001zR-DX for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:24 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzS-0000Si-Vj for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:23 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-434a1fe2b43so5874685e9.2 for ; Thu, 28 Nov 2024 02:43:18 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790597; x=1733395397; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4tTkIIhrcxBZurdxQEsXyUswGgpnjQ7q8C2Djt24mE4=; b=r9xj4aTE4ShualRlnld2+iMsZzYiXm2LI8n0CBjxgSoOzLaMS2jcyYMQPRu6rngEa2 dAwR+LeYK7/6PwmdIBuNvutUS1KlCuuzdodyeFww33hKJf4P8fN4dW5EH0q+PBWXlDLj d3VSYbeXyRuF4DlzEwWqVz9Bp2vsfvBTc012EqK01f2iay24ayWUt/Og/ViZdeQiaWq9 +bnWk3U4Uv9W/95ufPXR7GlIdj5z+zJVdrwtUpATDLSkptVBo3h+ritqLEOGpmipAQ8O Txs8DDvF1VKwFORbszyk69r94SjCKkSGllUVaJ7mhqVykVd21PYeKauqcJp/iYH5NiI0 0ojA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790597; x=1733395397; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4tTkIIhrcxBZurdxQEsXyUswGgpnjQ7q8C2Djt24mE4=; b=Y2YZ0NOSwWGiYCSGSwe+SSnjm1XMjbaqfnDBZjmFG30v+yzIZssIcnBvJ+8uiUu0wV TcbHc1awbdeMSumaivczgI9rx99DHWjGwwR8JOX17BmZ4TQVHRgD0Mge2mtAaYKw2zUY 4Rf21aIVW1wxp8cENgSbEYunbZ0ANae4JvKduR9QTvIrRcr870qPFZalnCuXrf1ULBew 2MusaRTp/0VxUwFdYDBYZ53RR8EhatNwwQx5GB6lcNFat0Y/1++4fIY+hMuouyQAfA8o 2IPPgpGPaqsdLIQpqmEXMlJHMNXwjC4zssD0d8Vm9BvsDjzNI/e/x9BsHgeSSPfdV8VB QcIw== X-Gm-Message-State: AOJu0YxqPS9zo+r2KclTFbuIs8x4kLNggfWLAo+YJCTNN7ttujjYj/Iv Pv8y22u27MBqhBHV4hKfzy4sfcdOWOksQtSvEj5CEH540GiXyd8UzpHglnC02dosIH5s8Y5+SkN + X-Gm-Gg: ASbGncvcXQR4goIlCIN92l986Vwc377byLySDxjSPNsJA2DNULGAmn5lnJGMCL9ofq5 zqp1FtWqvRqvyUiLFuo6zfTFy05P6EKWzocQgVNPKJgMH35xawY16ezpVJch5Jw0v7pwI1up/EJ z+ZYtsSJU13va9wzk96591jobI1FY7Iy0rpDHE9EeXZ35W8r5sytN+K5UCbZRE5qU/qd3LGn8GG 9Ta1D6DGlOQrPtKdsbH0dnRAs5So4rjcBANKcc9SYHvueK0BQgykzU= X-Google-Smtp-Source: AGHT+IG5lSeN2KFb6Yig+OEBeyIMwuYEw2rT4BgFuZynv+ZIVjSU7aBGEarxaDG3Yeq6RQ+0eWBgGw== X-Received: by 2002:a05:6000:2b0f:b0:382:4a75:57f4 with SMTP id ffacd0b85a97d-385c6ef38bdmr3968690f8f.56.1732790597461; Thu, 28 Nov 2024 02:43:17 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 05/25] target/arm: Set FloatInfZeroNaNRule explicitly Date: Thu, 28 Nov 2024 10:42:50 +0000 Message-Id: <20241128104310.3452934-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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: 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: 1732790679472019100 Content-Type: text/plain; charset="utf-8" Set the FloatInfZeroNaNRule explicitly for the Arm target, so we can remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/cpu.c | 3 +++ fpu/softfloat-specialize.c.inc | 8 +------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 6938161b954..ead39793985 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -173,11 +173,14 @@ void arm_register_el_change_hook(ARMCPU *cpu, ARMELCh= angeHookFn *hook, * * tininess-before-rounding * * 2-input NaN propagation prefers SNaN over QNaN, and then * operand A over operand B (see FPProcessNaNs() pseudocode) + * * 0 * Inf + NaN returns the default NaN if the input NaN is quiet, + * and the input NaN if it is signalling */ static void arm_set_default_fp_behaviours(float_status *s) { set_float_detect_tininess(float_tininess_before_rounding, s); set_float_2nan_prop_rule(float_2nan_prop_s_ab, s); + set_float_infzeronan_rule(float_infzeronan_dnan_if_qnan, s); } =20 static void cp_reg_reset(gpointer key, gpointer value, gpointer opaque) diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index f5b422e07b5..b3ffa54f368 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -489,13 +489,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, /* * Temporarily fall back to ifdef ladder */ -#if defined(TARGET_ARM) - /* - * For ARM, the (inf,zero,qnan) case returns the default NaN, - * but (inf,zero,snan) returns the input NaN. - */ - rule =3D float_infzeronan_dnan_if_qnan; -#elif defined(TARGET_MIPS) +#if defined(TARGET_MIPS) if (snan_bit_is_one(status)) { /* * For MIPS systems that conform to IEEE754-1985, the (inf,zer= o,nan) --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790960; cv=none; d=zohomail.com; s=zohoarc; b=dqlTxAZ+mN/aTICWxQ01txn5o0W6Tk/yo/DrxGvUuOy8lbvb7pKzcynqkfwFutyITDI9nF7x9TSk69detSSMRae0CfuhhI8NpcOAUKotqJVgx5DkECu6HANpu80sCo/UIQMIY1iLaPeJs0NNe1zo7BioOrx+u2bpDWxxL6OyDp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790960; h=Content-Transfer-Encoding:Cc:Cc: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; bh=CN209ow1u88/SvecQPZ/3IUJ9A/OS7lKONjS1X1zVa4=; b=ETAgLZHWMZ9HaX0xwRRVCwOqvy5x5NBwkNfJt2IUpmhdXLOqAiK7lka4H5GnAO6lFPEfputUZleruE25jXs+FqNR9AL7SzXsoVbuPyLhTl+ICyDo/BA2XpUjlYTrS4pwH7J009Y9gGSmLFmG4eS0FrbNM4xMil9witcJ+JSs1Sc= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790960104228.9559066104889; Thu, 28 Nov 2024 02:49:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc0U-0002gh-HE; Thu, 28 Nov 2024 05:44:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzY-00020U-TH for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:24 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450: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 1tGbzU-0000TH-1Y for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:24 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-434aafd68e9so6030135e9.0 for ; Thu, 28 Nov 2024 02:43:19 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790598; x=1733395398; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CN209ow1u88/SvecQPZ/3IUJ9A/OS7lKONjS1X1zVa4=; b=fCA8luC89qJZGogZcW5oTfOClX25gvuqauKBPLzikLROeF9ISmyVOm/Ia9TueGK0pQ kh2nHJ4b5PorfXDmp5hmXsXF7r1eEo9RQP/tfrcB9vig/vk/TdqDGBB02sDNA3AuoqJw g1xam1orGCz8s0Z8u8QO8lZ6mRazJTqGYosw+j1Q7nQGUZABy7GBn1KM1UJ1wluG6PGg YwchUZVYopFdM0e316Re+npIzveU3Qg0FIiRHeDH8VnyKv2zt3MSVbH+MUdYicfhCtgK SfZS1Mgux95mxovAxJTVOtDbTub0+KPo0rfnG0UFM0x/gbfiwPES+509j3ujFD1kK0VQ 08zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790598; x=1733395398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CN209ow1u88/SvecQPZ/3IUJ9A/OS7lKONjS1X1zVa4=; b=i1GT2JCdoNyakAog4kMoNgak5YGGIdSVPqo7q2rBJDdpkrUbQeMXv7YscrfiUgK+FM 4nzmgc2pKzkQThxAfKSWiCCgb1jR27gHp0NUHgv5rPoNZqFhWhmJOE8xHveihZvvS9bR x04oG/fL9HOWnq65TYnzrk209+8sJucvw3lrn1NSHiEiksOeo8wurBzIT+5jFy0C3jyE N6kerz1u9F3wDw0KYsSEN//8LtE+7TnMxfcmatlCE4CKwaGhGxtiiZEKZyD7+nGvFHZB i4r4jRk6Qd1JE9qmPTBC5+OciW11LWb48lz4al766+a7xneQQ6hRzSPKgsPqQeH/vFMU ytGw== X-Gm-Message-State: AOJu0YyGt6PWcbxQYZrmgYh5W2hqQBYG8eruWqc56mfBR6W+mBb2MMxy qEBRNU3SrEqZimAfpk4uS27FDObd8K2t1xZ2LUYzvTiIffJXcTAfCknyCiFquM2tJ5MpX//X6lN D X-Gm-Gg: ASbGncvv2iMBvlgIseukN1jN671tolfPjl0UEP08fYm5jHLf/T30+i1PQBy9+D4V9ey +9U/C8fp2fFNLTk82FZ/m1U6pPAdH1ui++nH7UjgGPZduvvTn0strrRcVxqKxlwZjtr0zDNcETx wWlhKvtQ29bbo51qGx8LNWjaGkP305BgUYKsPRgibdU/VBaZKQQgenIDrQaNfikdMguYhpSXdym utL8fC77yJ2Y5yypdFwh6HsTt7KxbfQhDMFfOvRT0cz59q8pH1kDrk= X-Google-Smtp-Source: AGHT+IEO1+yaqAG0WEQQ3aJywsZ4ugi2GG41LKAVgzk9zB7hp56n63EPXyCDGvevvW/FlBUvnmIY0A== X-Received: by 2002:a05:600c:3587:b0:434:9da3:602f with SMTP id 5b1f17b1804b1-434a9dc6765mr66825315e9.16.1732790598368; Thu, 28 Nov 2024 02:43:18 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 06/25] target/s390: Set FloatInfZeroNaNRule explicitly Date: Thu, 28 Nov 2024 10:42:51 +0000 Message-Id: <20241128104310.3452934-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790960702019100 Content-Type: text/plain; charset="utf-8" Set the FloatInfZeroNaNRule explicitly for s390, so we can remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/s390x/cpu.c | 2 ++ fpu/softfloat-specialize.c.inc | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 514c70f3010..d5941b5b9df 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -206,6 +206,8 @@ static void s390_cpu_reset_hold(Object *obj, ResetType = type) set_float_detect_tininess(float_tininess_before_rounding, &env->fpu_status); set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->fpu_status); + set_float_infzeronan_rule(float_infzeronan_dnan_always, + &env->fpu_status); /* fall through */ case RESET_TYPE_S390_CPU_NORMAL: env->psw.mask &=3D ~PSW_MASK_RI; diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index b3ffa54f368..db914ddbb1c 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -516,8 +516,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, * a default NaN */ rule =3D float_infzeronan_dnan_never; -#elif defined(TARGET_S390X) - rule =3D float_infzeronan_dnan_always; #endif } =20 --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790835; cv=none; d=zohomail.com; s=zohoarc; b=iyWbrLmJwpfcHKGm6ANJoq+R3d27mchUuew2dAiQ4B9UUJIKH0sVJZay+q+vohJmykfUySDpSYXPY/7aPxvu3PICY7qC/fzMVssIAIY3BfX3KJXghfqhLxIt42ZQCo+4g9GGnkmlDo2D18+DPTZ3B3hI046T3hn9+a0FN4uo8nM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790835; h=Content-Transfer-Encoding:Cc:Cc: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; bh=I7qNHcv2xsM6B0IoBDGG37yuVzj27RgfOCxf0ou+qD0=; b=YptAnZvMecMer6abAajXrNk9x754F7+CZNn1+G9QxwVqM3zUM7QVl9qCXw4dEAUdonqcj/CsAHdq3IdGBpXbkEfz1DuZENCQSc8KzWRUxJ33MW/PPbv/qbtNtz71XuVy2Fhmyu3i6dYlrW8Sn0nKqk81siS+OYwxn35EKi4KkWI= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790835861223.90190843488847; Thu, 28 Nov 2024 02:47:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc0d-0002xU-Sb; Thu, 28 Nov 2024 05:44:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbza-00022g-5j for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:29 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzU-0000Ts-Ma for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:25 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-382378f359dso519809f8f.1 for ; Thu, 28 Nov 2024 02:43:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790599; x=1733395399; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I7qNHcv2xsM6B0IoBDGG37yuVzj27RgfOCxf0ou+qD0=; b=LMIPGlVdDWoFBG6QZMacsGQdlb42uojfU+Eizt+z0ffF5jC5sa1e6OZNAFRFyTjta7 bVE1eLJckYdHPEFfd5yO9LAtChbkXLp3g7N9WUypeL4D5Xl0iTA7Hw0XOCGWijogSg3a nK8Ry6x8EcLOcOgjtqsjmPGOg9HAgf9PGa7trkNijiv5k3B8rVazK7kqqioAXR6O7O4C 0n65dKaOyN44uZRakTkihcGrDef7sQvPUtRcuNf+bYuAFpbb2jUDQb+WrHGpGlmbLCP1 KLvv/J/xJitKpUr2hwRZii+wHf665dh79ItiWf1VIccq3CBME0fUtszENfcR4TUoeLWA ZxJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790599; x=1733395399; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I7qNHcv2xsM6B0IoBDGG37yuVzj27RgfOCxf0ou+qD0=; b=s8sEkwBZvBfyZr6slD9jz3CCQPtbB90jE9wVstawQziDGIiyD7NNdpYQIWrrSqBpur VbtWEN5RA1ywj1yV1nJ30di4DNDIFBO7WG+atocCukkcmkZt2+LQYdC/WgmWIoo6MMpe S2mSY3WWxz/ATz6aTeOcmfaeP2TmqXtNjfFfi3BQoqbAlEvvq/ic9GZaHXHZDm0ghYvV be3mhEg0t5hllafLg8wVZ2ndbniGYsIbI1IZyR7OKvTXSdnMrhZ+nQ9pYmfbQn1YF79P zLtS5ZwekVFZ3Ht5/Y8ozt+kKNbHPSLjsGwU6w0bqEMrwAqNGi01jsB1gQO56SsWGnZG hftg== X-Gm-Message-State: AOJu0YxgRflVtZeT6cle/3POebfS8ulYdECqhQKASsVOQi+x9X91Iyef oF0un0wJbJ3mCbqtUWiwthIjzeqd+YwlBMkLA4FkhVIVweAbvvRRfQ+YrIB9i3aLVdU1l/BO3T3 Z X-Gm-Gg: ASbGncu6g73QcqNR+WBxyc0welQO3TA9MRfaLSkiGycr6+zOaCTf6dPywhCEA11Z7lK 27HNeZ9pcG/oG+ivNbCdg8xOwC2Y2l9kTina0X8I8NsmirPC0BpiE5QsWdrydbJTZvpLKgGroKS rsXbsSxrbuuoiZNlu6ZXiLb5/lJZZpVMVaA7Hyxd6VUEYlTDqEd8rMBaw6ErbQwISzD/1k4xMJs fQiBjQBJYxMrFKLYEIEzYjPIGh9w4n9myXCVVYHeySqB3y+OyUaJV0= X-Google-Smtp-Source: AGHT+IHySTOT4575kp/JGABI+mh2igzLQZ8XO2gvE//i7mGU/JyqYH/xnk9v4vZ460bseG5dsGZH0g== X-Received: by 2002:a5d:64e7:0:b0:382:49b7:cbc0 with SMTP id ffacd0b85a97d-385c6edc520mr5316469f8f.52.1732790599203; Thu, 28 Nov 2024 02:43:19 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 07/25] target/ppc: Set FloatInfZeroNaNRule explicitly Date: Thu, 28 Nov 2024 10:42:52 +0000 Message-Id: <20241128104310.3452934-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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: 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: 1732790836258019100 Content-Type: text/plain; charset="utf-8" Set the FloatInfZeroNaNRule explicitly for the PPC target, so we can remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/ppc/cpu_init.c | 7 +++++++ fpu/softfloat-specialize.c.inc | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index efcb80d1c25..f18908a643a 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7270,6 +7270,13 @@ static void ppc_cpu_reset_hold(Object *obj, ResetTyp= e type) */ set_float_2nan_prop_rule(float_2nan_prop_ab, &env->fp_status); set_float_2nan_prop_rule(float_2nan_prop_ab, &env->vec_status); + /* + * For PPC, the (inf,zero,qnan) case sets InvalidOp, but we prefer + * to return an input NaN if we have one (ie c) rather than generating + * a default NaN + */ + set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status= ); + set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->vec_statu= s); =20 for (i =3D 0; i < ARRAY_SIZE(env->spr_cb); i++) { ppc_spr_t *spr =3D &env->spr_cb[i]; diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index db914ddbb1c..2023b2bd632 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -503,18 +503,13 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass= b_cls, FloatClass c_cls, */ rule =3D float_infzeronan_dnan_never; } -#elif defined(TARGET_PPC) || defined(TARGET_SPARC) || \ +#elif defined(TARGET_SPARC) || \ defined(TARGET_XTENSA) || defined(TARGET_HPPA) || \ defined(TARGET_I386) || defined(TARGET_LOONGARCH) /* * For LoongArch systems that conform to IEEE754-2008, the (inf,ze= ro,nan) * case sets InvalidOp and returns the input value 'c' */ - /* - * For PPC, the (inf,zero,qnan) case sets InvalidOp, but we prefer - * to return an input NaN if we have one (ie c) rather than genera= ting - * a default NaN - */ rule =3D float_infzeronan_dnan_never; #endif } --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790987; cv=none; d=zohomail.com; s=zohoarc; b=PuUeJDjMb1HewxegJd0azIymqXHHjC8coP5SWm9IWim/YygSNzQrZoPlRmcJwbLWcaLKHDh0Eu/+zEF+WhOVh1nOcHmTs8laEfOaEsh70Rj9Dt2BUnJoOX9ZmEMq2+AR9ZkK9FXO0gKsILcaSVKLSfe0MFkWTXJYYLpvgXtZj8A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790987; h=Content-Transfer-Encoding:Cc:Cc: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; bh=YwvjGP9nM6OJvLHzJNmFilwr8r1rRnLYpGXxx9aO2ss=; b=cEf9CLCCU5dArWZkPqa+ASiwKVv74fT9WnY6GEsL/INapBYJwf++LgQzMMwYpPMgwcSpPhHUU+ftCNS5O1oZELRWe9GKgMAaAjUckiegu6MvGGh9gmreAjdYkfe2iNukLLuSou4D2lMxA/JCEiJ/1Cd5emuM6skXjJH+iL7iF5I= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173279098764220.75977979220852; Thu, 28 Nov 2024 02:49:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc0g-00037T-8J; Thu, 28 Nov 2024 05:44:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzc-000239-2n for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:29 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzV-0000UQ-Sc for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:27 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-434a099ba95so6031025e9.0 for ; Thu, 28 Nov 2024 02:43:21 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790600; x=1733395400; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YwvjGP9nM6OJvLHzJNmFilwr8r1rRnLYpGXxx9aO2ss=; b=bc7XbSw7JmslW5r7TtdXWYR2SfJ4nDiNkjnxEwrcn5LnbCtNc/pZW0QSXq16CEQ/8f 646c6CZpuBY5EcWE7AgfwY+7MgzH4roWngeCATm0OP1CgqRrjVSoB9DR23+79BK70Ny/ zFIoSOOLiETkxSuQtrO00u5nXALZXhv6ipNOwJTlkybQZu0rT3mKA8qfIfpU30oPbERD wVH1H7EfJI3uJoWqBjERIBAn1Rc+aI6MOxqfUE0SrnEJNmN/rSNBJlO6DcwvE0W0GMRX 1cTps8O7qy2UnydIPZIFiJzbmddoRs0aikVbEewyuvvzaA2HO5jTe7lPc3j9vxtTUaMK TJlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790600; x=1733395400; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YwvjGP9nM6OJvLHzJNmFilwr8r1rRnLYpGXxx9aO2ss=; b=ZpogHrLvLS1bsil1QpyPDogX+lAfNVU/qBLR1OH3VVt7VjS+03QF+x8VozoORlYFRa Fuzp9vaSNyTNMqb+D8A4KAD/3BEyPVemMOKHJNaOF0Jo7SO3uxtpf+v8L5zIoBJ64BxT ANpdsgBZ29KBfa36MUC5bOaGmyVGqt4BM78BJgDP9+UCCz9OTf7ZY278kpu8PKbigb3W o4C9PvLWnBXKy3jVO7SpactVE9wI7gFA0yE+RNAEbKdX5g5NWs0GDCgR1C+PPEWsBSQi 8mo/DZrUXVqpadPlBLe4zorjNHOeBYckYuiMAngjbaMlwQnqp4d2rbLbXeP8nvKBbsdT 0Alg== X-Gm-Message-State: AOJu0YwClo5rsiJV2KvCHcXvvqZ05a8GWFfxFT2ssUyqR0Dg85IzfFWq 9ewfkNBul3aI83gWn16dvWrz7be4bl2XA3TsdfkRffBVNh5WN66rUQf3twnN/+61jrZtu8A+zwn v X-Gm-Gg: ASbGncuQ7z9b7JYkAos/qOlGBcqcv6PqoK/Ghhs0HpCWjpwAN/pdZjAKsXHa162O5+U q85ghRfuFUbVKJ5vqfb4OTqk2ZNfmy4wb1/XMQ44tAnARpNoZTICkOd8qjH27OtCYdzKldooqEf Qgvrimf1y+6gErrqy0JSu0ywsT0UWGhaT66+HejSm3t93UHfVKIOYGqykoH/D8Laya73v0VssOz 4kLl6835H6X5lAeoaV/Q/LiPK5cZa8f59MyMn9GAyao0nI4OSUcGFA= X-Google-Smtp-Source: AGHT+IF8avi9FU8kPgaxxBYqDyIzAMA/ClbqF7FGpSE026N6UfXClh07JepyogBPwI7n2/nj2x37LA== X-Received: by 2002:a05:600c:474c:b0:431:1868:417f with SMTP id 5b1f17b1804b1-434a9dce659mr70149485e9.17.1732790600234; Thu, 28 Nov 2024 02:43:20 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 08/25] target/mips: Set FloatInfZeroNaNRule explicitly Date: Thu, 28 Nov 2024 10:42:53 +0000 Message-Id: <20241128104310.3452934-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790988990019100 Content-Type: text/plain; charset="utf-8" Set the FloatInfZeroNaNRule explicitly for the MIPS target, so we can remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/mips/fpu_helper.h | 9 +++++++++ target/mips/msa.c | 4 ++++ fpu/softfloat-specialize.c.inc | 16 +--------------- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/target/mips/fpu_helper.h b/target/mips/fpu_helper.h index 7c3c7897b45..be66f2f813a 100644 --- a/target/mips/fpu_helper.h +++ b/target/mips/fpu_helper.h @@ -28,6 +28,7 @@ static inline void restore_flush_mode(CPUMIPSState *env) static inline void restore_snan_bit_mode(CPUMIPSState *env) { bool nan2008 =3D env->active_fpu.fcr31 & (1 << FCR31_NAN2008); + FloatInfZeroNaNRule izn_rule; =20 /* * With nan2008, SNaNs are silenced in the usual way. @@ -35,6 +36,14 @@ static inline void restore_snan_bit_mode(CPUMIPSState *e= nv) */ set_snan_bit_is_one(!nan2008, &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) + * case sets InvalidOp and returns the default NaN. + * For MIPS systems that conform to IEEE754-2008, the (inf,zero,nan) + * case sets InvalidOp and returns the input value 'c'. + */ + izn_rule =3D nan2008 ? float_infzeronan_dnan_never : float_infzeronan_= dnan_always; + set_float_infzeronan_rule(izn_rule, &env->active_fpu.fp_status); } =20 static inline void restore_fp_status(CPUMIPSState *env) diff --git a/target/mips/msa.c b/target/mips/msa.c index 9dffc428f5c..cc152db27f9 100644 --- a/target/mips/msa.c +++ b/target/mips/msa.c @@ -74,4 +74,8 @@ void msa_reset(CPUMIPSState *env) =20 /* set proper signanling bit meaning ("1" means "quiet") */ set_snan_bit_is_one(0, &env->active_tc.msa_fp_status); + + /* Inf * 0 + NaN returns the input NaN */ + set_float_infzeronan_rule(float_infzeronan_dnan_never, + &env->active_tc.msa_fp_status); } diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 2023b2bd632..db9a466e05b 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -489,21 +489,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, /* * Temporarily fall back to ifdef ladder */ -#if defined(TARGET_MIPS) - if (snan_bit_is_one(status)) { - /* - * For MIPS systems that conform to IEEE754-1985, the (inf,zer= o,nan) - * case sets InvalidOp and returns the default NaN - */ - rule =3D float_infzeronan_dnan_always; - } else { - /* - * For MIPS systems that conform to IEEE754-2008, the (inf,zer= o,nan) - * case sets InvalidOp and returns the input value 'c' - */ - rule =3D float_infzeronan_dnan_never; - } -#elif defined(TARGET_SPARC) || \ +#if defined(TARGET_SPARC) || \ defined(TARGET_XTENSA) || defined(TARGET_HPPA) || \ defined(TARGET_I386) || defined(TARGET_LOONGARCH) /* --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732791052; cv=none; d=zohomail.com; s=zohoarc; b=CNJcaWL1VFu2LXcYznT5BiiDvCm6QNAnjgRTTYeNdnblNvluAcYvA8ew3kMYp+oVdt3E2pCrCHAIe/gi++vAmxpHZMFnzYcqkWisotv3oZberJg9vijOrptZs5GXXgzmr5K4UWDoaKftWoqWKgwi5dBlqb6Iram/jpep9YrTIXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732791052; h=Content-Transfer-Encoding:Cc:Cc: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; bh=oGeQkgWiOnpuuXWXZlTMDkuSTfoKIXOn3w/Ju141f2Q=; b=amAnybAT9opvQ//AvXjHvKPBOik/dlBzxyKNJoyA3SqzysC/dtc5rDHmJJIPbYwWPGmxiBvm3BoBlxuV/bwz7iWMlcF6Lr2on2lWEYiFTmih1eRyyhPB8uy4Shz9u+wItzTxqF7+PWawywyXjOimGr/5YYBrkotxHpD6z5hJpHY= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732791052256699.3802259444614; Thu, 28 Nov 2024 02:50:52 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc0q-0003kj-MS; Thu, 28 Nov 2024 05:44:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzc-000237-28 for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:29 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzW-0000VF-MQ for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:27 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-434a752140eso5706185e9.3 for ; Thu, 28 Nov 2024 02:43:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790601; x=1733395401; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oGeQkgWiOnpuuXWXZlTMDkuSTfoKIXOn3w/Ju141f2Q=; b=lZToagLg5Od8ckp1LAzBnxpaEWFSdxY+wwfHHJEQS+SCx9G8G5xkEPjdgc1GYB3Nr9 Inv3wkT31m/pzuJH0CUCNNl584pKj9m1yl5Lan6ywzWydrpcoJc1pZajgfv5g9J7ZQAg LwkZosi4S814Gy2sIS6m2EJhUFLwNhZt8eSt2acxef/N2OaYePneA9Ki3xKDD/0e0DcX jK12FtzFQdjRtFqVNh5lKL3/IBkkgc4MPDQMrP0eCQ4u0+25aWz+OIjPD2BorZOnFDgu x2rcwpVWgB+YNz53BubNPN1opU1lnt7Urf6AMTY1gz97jN25q3y9hRkKTOM8doW3YcY1 V+nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790601; x=1733395401; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oGeQkgWiOnpuuXWXZlTMDkuSTfoKIXOn3w/Ju141f2Q=; b=SRTXXPppDo+1a8OIzOYmm5kDBX2b2wUQTDahcqofMOEhV5qmIuaTaPG8C7ldyYj35+ muFXOpHUqbfjJn4D915wQyq8jHJiezWo8kzB38zZtdYKtQHPvhv6X9JJX9BAyBQSmxRz UwhpIwJlkTioJeMP3j74T5zvHjS1fL31dumm8aLNdPkOr6VMn2FXOsvFFta9alHgvnD1 JPsyU6zUXxMlMKQ3LAbN4WMOvdEFrXBNco68vyV196Va1U5RmMkMzfXbMgHHDkcTqWeU 8/Q+hdEf6pmYtlz2aiFKPK9A+vP10wDLKlsrTgbTvZwkEsK9umVMIQfrHYnxFlcFGmtm fSKg== X-Gm-Message-State: AOJu0YxWuJf78inNe6ESPcVHUj6CwYhXm2BsUlhQlZzFuiUN/6D1k7HJ wEkJJXL41U7y6Cicbw4XTur3ZFsV3bU+FrPZpP12LVtj6GgNDBHaQWqHEwDiTlUAC7FQtiP4seY 2 X-Gm-Gg: ASbGnctOR0Rxf+mjWpVXiPGWpqW9e/fxGaE8h6+mO8lQC8eaTymPhsCBNIWb/aDLgpu PWGwt5uO5uq26V9yw7grJ0jpzhXmP6v0xVntqH5E1rPVupVWPCUtCs+wRE+azWhWXlOR5YhdYi8 HeQCCeVdXOi+1iW3iixOU9rZYpq8UUcu1EiLCZSp2WsLcDn177l93yXd07ubEESoUsJxOETl+pt +vY4H2zWEDouPGiDM3QkUl9mlti/ZSOuQVBp9c0s+RI498uleE3QHk= X-Google-Smtp-Source: AGHT+IGjPCC8FhcTdAsDhnejmdWY3ApnB/Rlz4vhTiLGyw/FgA4UJIVI5PC65VDBKzcbWkvKFR0hsA== X-Received: by 2002:adf:e199:0:b0:382:134d:65e0 with SMTP id ffacd0b85a97d-385c6edc41dmr5806320f8f.56.1732790601162; Thu, 28 Nov 2024 02:43:21 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 09/25] target/sparc: Set FloatInfZeroNaNRule explicitly Date: Thu, 28 Nov 2024 10:42:54 +0000 Message-Id: <20241128104310.3452934-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x335.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: 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: 1732791053151019100 Content-Type: text/plain; charset="utf-8" Set the FloatInfZeroNaNRule explicitly for the SPARC target, so we can remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/sparc/cpu.c | 2 ++ fpu/softfloat-specialize.c.inc | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index dd7af86de73..61f2d3fbf23 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -814,6 +814,8 @@ static void sparc_cpu_realizefn(DeviceState *dev, Error= **errp) * the CPU state struct so it won't get zeroed on reset. */ set_float_2nan_prop_rule(float_2nan_prop_s_ba, &env->fp_status); + /* For inf * 0 + NaN, return the input NaN */ + set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status= ); =20 cpu_exec_realizefn(cs, &local_err); if (local_err !=3D NULL) { diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index db9a466e05b..7e57e85348b 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -489,8 +489,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, /* * Temporarily fall back to ifdef ladder */ -#if defined(TARGET_SPARC) || \ - defined(TARGET_XTENSA) || defined(TARGET_HPPA) || \ +#if defined(TARGET_XTENSA) || defined(TARGET_HPPA) || \ defined(TARGET_I386) || defined(TARGET_LOONGARCH) /* * For LoongArch systems that conform to IEEE754-2008, the (inf,ze= ro,nan) --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790972; cv=none; d=zohomail.com; s=zohoarc; b=eECFyIoLH2l3BHdHxYZCUkhYZXOlonar+EM4SpFumYs7FbVFkIWzWH/UxrUDUCIo/9+6h3Z8BznAelrPcfjTZ37HeJVxBf2Jf9krlI+9W2OAAGIDanMeLtlHlPii0hjOmEeGYDrTGtWu+vNtUFdgr5V+WIhTeKKTrEZH+junPNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790972; h=Content-Transfer-Encoding:Cc:Cc: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; bh=5Xo5Wy1Oob5f6vaToYcDecYPVf+U4Qw0T3qC57WwruI=; b=f5Lo084iTeGhJHdvp7aptD8IRsqKdAuYzvdQrqhSfsk5c5o2zUwubYZonWGG/L3UqEpprVVnF9aMxv6/A6BJOgxCzUv6evgUT6EUr6aUsh04TOFPSFVT+cq6bxU679UGmelnVdfA9heyjlAhsHyF+lbVVeo/Z7VmyP8m+jhHsR0= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790972464291.6863826797985; Thu, 28 Nov 2024 02:49:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc0g-00039S-Id; Thu, 28 Nov 2024 05:44:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzd-00023P-S7 for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:31 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzY-0000Vs-9i for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:29 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3825a721ae5so422569f8f.1 for ; Thu, 28 Nov 2024 02:43:23 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790602; x=1733395402; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5Xo5Wy1Oob5f6vaToYcDecYPVf+U4Qw0T3qC57WwruI=; b=Nc0exO5CcK0xhlJS5GQsHiePdPyGAvqMFIN5ofovibiY/falTMXd3f7b00K93gRsX8 vrnURcg5pbS1czGhdlZhktGwvOp8OdzIOdvm3jesdj7yzvzmChYbE+EmrehEhEFGoB/D z13IMLzIx0GDgXMX/y+N8MRy6/MoiAVDg4/2/diF4Kw1SoxrYyRabGVwcDLagSdGB7aR kluFCVDuwYzACvOO/h2bXYZCTMoILj8ai6lW9HrXp7i4LWoWS7QunWlcJXbGqhoH5Sfu gNVbD5rt5Fjm32IWpZMyasuanQtnp/1EO0T2jva7Q2Goe4AuTkB0LLZRNjpK+1Uch4Yq id5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790602; x=1733395402; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5Xo5Wy1Oob5f6vaToYcDecYPVf+U4Qw0T3qC57WwruI=; b=HhfvYWIsdpXJPfOLd24ljyMi7MHPMiQqLXmWnODSttzSUcjCWTR3WX3euyDtuXZWeJ 46Ynp5Ld4vzutU8Kav1PX/RYh4xcZzLcr6rtT6AYovRWafYaozHnXXQywA7I88rrrmyl GSFEeonTB/BrLzBlvYjqVqdX9t/oneqB8z2uMVZ+t1DqSDOT+2E7tM9+UZH3T1jECTB2 JecoX0FeNHrOMnMVOXyZOO1BTTtI8rLZ5mN5kobU9NNaGRMqDlgGoI4geStlCpgQZoIr 6YN/Muu61zJ6sdJc5KG0TqX9vvVwsnxg4E/drVu/cnDR01Rn6y6UvYlYNrGwdE2fr4o6 3s6A== X-Gm-Message-State: AOJu0Yz2ksG0Qfprdj8+s5XWm5KttcLCzCbSclh6yg8nDGnUG5xigVt3 59gpPME/LqetEZUY1P9tuB4gt55eQGYmnWdwjcUSbdDCvZUjubqjRGUZ5hxtK5qDKvVTISkzQTW k X-Gm-Gg: ASbGncu0kOhG0V2zedOgsSs/mwrD7fnm6Gi44FAUUTI17+Bu1uZXmH4jfcLSaizXmzs ql/fjC9tJpquEOoTY5wnLRJYUfZgavm91OXpAQsLxl+N78dbl8Om+PbkqfOG/YK4br0D9TJUujy IZhnvoFJ/PU24ZXVAJkyTL2t/KzOBJKDZz7EfUu7ad3rnjVJQuk5q+wr8eyYZfHzqtsBmyjXE7J bKKWU4ZUyXHBL3oP4ExF/NUPahbEIcS3Yn4u6TcqZBlXUg34HFa0yQ= X-Google-Smtp-Source: AGHT+IE0L4AkhdeezeQ/JD+j+p6w163oimx4niPfIoKvMFa1FON378FyJti0jZc6IH0q84O2KRaDnQ== X-Received: by 2002:a05:6000:2cd:b0:382:3210:a965 with SMTP id ffacd0b85a97d-385cbda22bfmr2394884f8f.24.1732790602080; Thu, 28 Nov 2024 02:43:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 10/25] target/xtensa: Set FloatInfZeroNaNRule explicitly Date: Thu, 28 Nov 2024 10:42:55 +0000 Message-Id: <20241128104310.3452934-11-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790972769019100 Content-Type: text/plain; charset="utf-8" Set the FloatInfZeroNaNRule explicitly for the xtensa target, so we can remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/xtensa/cpu.c | 2 ++ fpu/softfloat-specialize.c.inc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 6f9039abaee..3163b758235 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -133,6 +133,8 @@ static void xtensa_cpu_reset_hold(Object *obj, ResetTyp= e type) reset_mmu(env); cs->halted =3D env->runstall; #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); xtensa_use_first_nan(env, !dfpu); } diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 7e57e85348b..3062d19402d 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -489,7 +489,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, /* * Temporarily fall back to ifdef ladder */ -#if defined(TARGET_XTENSA) || defined(TARGET_HPPA) || \ +#if defined(TARGET_HPPA) || \ defined(TARGET_I386) || defined(TARGET_LOONGARCH) /* * For LoongArch systems that conform to IEEE754-2008, the (inf,ze= ro,nan) --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790835; cv=none; d=zohomail.com; s=zohoarc; b=deh2sYilCLiojw85zAnOxWDTkir6lM3wnVBXNF/cEnyCXPmkh5yH+ytXlQYn++dL76szV9FF40UnXLYkghjSUv2wpelRqkQzszhVyhq8w184qpLyPzJvMeX56fbh1dxWykCOLWuWxyumYfboV0vgnbT4Q6s4BMkiiQANhNCdQsI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790835; h=Content-Transfer-Encoding:Cc:Cc: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; bh=ek+hZskUnfXDQCh1OptQZbXmCqnBmww89XjzyzcdKGw=; b=WfpHdkSoltYu1LO4tBrgtFikdUKa6/jyXLra7qtFXfsEK4r/zH80Q1mLR7RW1KRpl3mTQVSaZX/vLYkVtBsHvtng6dAsz1PwpSkEASjSwcxUEG4XMSVQDHsqAHVzmeQrvxqZrDnpeE6UXGNj3cdeAP/YHYgy+vPgBe2FRgqhzQ4= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790835831215.0326115922237; Thu, 28 Nov 2024 02:47:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc0k-0003TP-3E; Thu, 28 Nov 2024 05:44:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzf-00023e-Kz for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:31 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzY-0000WQ-JV for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:29 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3825c05cc90so323125f8f.1 for ; Thu, 28 Nov 2024 02:43:24 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790603; x=1733395403; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ek+hZskUnfXDQCh1OptQZbXmCqnBmww89XjzyzcdKGw=; b=PJFES68e+hKIX0WOB/SIQaC/3sL4ImVqkL4BtBCVltz/9ksinmtlHXoiXVBDo4VdDB EDhERaSN4vMZulVye+OL/uJIB3h6bIgOaDEbTtVO4LI5hyNMSm0eg5KGlbbSyBSLC5DY maec1NEdzRMVYfBcWQ0BzjlsjJXg5yoD8VHelEEGET1+sfQk9gP+FZsY8cFfBC5IVM/7 xv1xUYWmjur5RpjYQtt3Wpe59Tf8aFHNpJ+6b96lpwkyw+CJpC2UgMZOnnNIwbfqLHzE ItRaMXCN5puFeuPx2Ow2ZVLfXx3U5GiDDT21pSclfT/C4kWLXPM23leHVFrvDeTLkTXd QY8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790603; x=1733395403; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ek+hZskUnfXDQCh1OptQZbXmCqnBmww89XjzyzcdKGw=; b=Am3HRfwA3LtAGr6gDkRSNc+Un5iYTpiDsFHOSYX7C7z1HbqKW+gBgbjwcaO1MXc4Ax UsYLKOY8WgmPH/sXLK+WEdmL9bEZXAM/iUWhJ+dAnGb1xsBwwqp7r2YPyysI703aXMO6 JwdYg7iU+1VgoQQwnh7psOIqaEixi72V3oyIGHR3k1lOKAkIvNId9Gs1zs44iY2IoqM3 TYQWA3v5gyAc/6v2Mk8rHoZ+NKBUDUrnwpmoS1jZ11+zoQDd57Ygp/g6RqJw7RDsh3ZD KPLy+TD9AaLnnOXmOByDyu7JDmTnAezXHz8yeznFWagxIfCxXYGt5lwYN8EOqwObKaDL SX9g== X-Gm-Message-State: AOJu0Yz0Cs4gUpCc0qX89bNodXCq/e3dEOx7Csm0uXqUStg0sqtS9qcf JzDL0EBk90gN0VcIOdW1IHx8oJIsYjAC5vrmrPDMjiWmXHOmRHV0PvuPuzQ/SAPZOx2GY6jLHvp + X-Gm-Gg: ASbGncvA5xpsk3zYp2Jgeg9MsMl9Rg6HzNSE/0S5q+TGNVcnc0dUpXuGDYjF31RpZ72 3/RDTWa2IA9m77szFL6ca8YdjUdWfXRtC4qZDac0jSKxrEQuYXVUMdK2unMzi0/VF6HBihl41/Q cUnP1eHMX19TR4ZBfg4ke5AfZ6pwRZWav/h4pZMCOZXWa/GcAtOZTfmVx2R9AuiYTwqhxF2Mam3 pxsN6rxcmQKNyoZWOrASyy3rk58/zLD7i4GUVxMJg44+MtDsq2kR4M= X-Google-Smtp-Source: AGHT+IEWAjOXb832xAkLwjb7/2TdWl3Q97ZUPXna3sU1PdKXSkDkT7jvbqX0c3gLPnpl2nRfuHRrow== X-Received: by 2002:a05:6000:1846:b0:382:4d6e:9f3f with SMTP id ffacd0b85a97d-385c6ec0b9dmr5403598f8f.34.1732790602935; Thu, 28 Nov 2024 02:43:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 11/25] target/x86: Set FloatInfZeroNaNRule explicitly Date: Thu, 28 Nov 2024 10:42:56 +0000 Message-Id: <20241128104310.3452934-12-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.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: 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: 1732790836247019100 Content-Type: text/plain; charset="utf-8" Set the FloatInfZeroNaNRule explicitly for the x86 target. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 7 +++++++ fpu/softfloat-specialize.c.inc | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 53b49bb2977..e9de084a96d 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -173,6 +173,13 @@ void cpu_init_fp_statuses(CPUX86State *env) */ set_float_2nan_prop_rule(float_2nan_prop_x87, &env->mmx_status); set_float_2nan_prop_rule(float_2nan_prop_x87, &env->sse_status); + /* + * Only SSE has multiply-add instructions. + * TODO: this might be wrong, as we never implemented any x86-specific + * handling for the NaN case for multiply-add. This needs to be checked + * against the manual. + */ + set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->sse_statu= s); } =20 static inline uint8_t save_exception_flags(CPUX86State *env) diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 3062d19402d..ad4f7096d09 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -490,7 +490,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, * Temporarily fall back to ifdef ladder */ #if defined(TARGET_HPPA) || \ - defined(TARGET_I386) || defined(TARGET_LOONGARCH) + defined(TARGET_LOONGARCH) /* * For LoongArch systems that conform to IEEE754-2008, the (inf,ze= ro,nan) * case sets InvalidOp and returns the input value 'c' --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790777; cv=none; d=zohomail.com; s=zohoarc; b=Z/iG5DS0/ogP7ggn4whDsoL3NXP+HXv5hZ7SaRtmMkUQTRIbpNSknGTTQP0Xxk9XNNM3lEZaZ7oJgNIzJR8sXrx66923CvkzrUD3WK/yAINRJuAq5vV0cq9hdShBQVQcsWaMr8GWXfKZI9aHqWPFQY7qtVqKzClDzlY4mRXFQrw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790777; h=Content-Transfer-Encoding:Cc:Cc: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; bh=iZVybYeuTrOgtrqao8PQeLVJYcnLhthP9z/tircoyS0=; b=invKkDVxQBUu0yWavObGrYOTKRnhGcNkdLL/c9Lay0zdugWdfXU/4KLd9QbEpyd3KGkJAKwB3obTiM4aDr3cxSL0622MT8/V6va6t6kZ8t5zRUIAjU5/sjsoorqFDMj4kbc2cB3ROt8d8CRu0iThxQoOnJ4dKp0wh6WACV5t5BE= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790777866605.0779882910747; Thu, 28 Nov 2024 02:46:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc1D-00046U-Sr; Thu, 28 Nov 2024 05:45:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzf-00025n-UU for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:33 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzZ-0000Wx-NM for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:31 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-434a2f3bae4so6049135e9.3 for ; Thu, 28 Nov 2024 02:43:24 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790604; x=1733395404; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iZVybYeuTrOgtrqao8PQeLVJYcnLhthP9z/tircoyS0=; b=znbQ/eo/lGQaWy3KjAaxMBQITD52czgQrWjKNMpDVPPUdH7cuN+UiE40mMdwl08atH NUZi1HJScs0var6b/9NDqwQ1VODwTSqIwSrohocysjxupERSm0j2MKHqMKCL/1HsntSq YUK3NzHP4VQWosla6RnMZwg54NgI+V3l4cR+iGp4P8I/nzhGzLFIoX6XCxtuJMAycagv eUph0xm10V41P2MZgHMJaVvzPX6CDqYMjDNwvGD86yn0huEJYEyIopfai33UO66TluzE iQGYN46BReBchn4x5/kOUTntta2giD4tKcAlC7QNmBoi/9iGTjSLrvP6piFOPSe5dApJ QARA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790604; x=1733395404; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iZVybYeuTrOgtrqao8PQeLVJYcnLhthP9z/tircoyS0=; b=dvfK4M3QUeEUzhW+08hRmbSMpEGZrUGYpxZpMvK7Sbkd7IUUmvcjFq3PTj4D1jdbxd 63GeiuLzzMXZ66OJSv/BY0NmKMqqhH9dTNmn8Hz3RnIM2Vkiv3f6bTZPdejMyijDkKiX fndTKr9TVi3PM1oaMiOT7X2OOiDy3rbqiXJS9xlFpZB30d2OEJmvIRl70v7hHLYp7P6b /jjL8/AGkJYZ0h9xJn2Rt6cY7W3vXOSxzFF9itjwlGs3DdLFAfoLutwrErtF5YqcHkW2 AsRuJi+cIDaLQgA0kh+4PWMz1arE2VbuqSSW943MMIAFLmwgtFJTM7VKE97uM1OEtBOc JlDA== X-Gm-Message-State: AOJu0Yy+U709OFDN7qin8vw0mY2tjqLjo2vZ2qiWE8w++GwBWOwmZTxw 7pynjm9Ol8U4LNAMKnrJoOoTf0CFIkHc9G+Bl3Nl1fajVA7vxH20rJYcYOS8T2K1igqoipzwJ16 6 X-Gm-Gg: ASbGncuZLsw0ZFA3vFrUrtRkWruO1qo3PII3n3ECQlSS/NvwwJkH1uVGn0hGAjZoWb0 wsXaSdhNop4COD6Qw6LVn5YZoDGF0okDqiq4wn+CC/DzSYzg9ft5n9m5J3LgGxjc0tcYeX6v/W2 A7vzs+gYqhvehIJQyzjbsC+mKZOQ1RWgRoB6DyALlQOG8ibAt1XygNdF6CKJXKWsHwTTzZly9cv A1cgjVBqQte6ksD9edbATWhhjhNmfsfkpNvvA0NM9ICSByOvwOZ61Q= X-Google-Smtp-Source: AGHT+IGCTKRozhkWgjwMEGkUuizRTcex3BoClUrzEHGN3q3D3nUN2r90Xtnbg5I926y0Oe4UhmEuAQ== X-Received: by 2002:a05:6000:4819:b0:382:464e:1ab4 with SMTP id ffacd0b85a97d-385c6eb850bmr6283508f8f.3.1732790603802; Thu, 28 Nov 2024 02:43:23 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 12/25] target/loongarch: Set FloatInfZeroNaNRule explicitly Date: Thu, 28 Nov 2024 10:42:57 +0000 Message-Id: <20241128104310.3452934-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790779930019100 Content-Type: text/plain; charset="utf-8" Set the FloatInfZeroNaNRule explicitly for the loongarch target. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/loongarch/tcg/fpu_helper.c | 5 +++++ fpu/softfloat-specialize.c.inc | 7 +------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/loongarch/tcg/fpu_helper.c b/target/loongarch/tcg/fpu_h= elper.c index 21bc3b04a96..6a2c4b5b1db 100644 --- a/target/loongarch/tcg/fpu_helper.c +++ b/target/loongarch/tcg/fpu_helper.c @@ -32,6 +32,11 @@ void restore_fp_status(CPULoongArchState *env) &env->fp_status); set_flush_to_zero(0, &env->fp_status); set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->fp_status); + /* + * For LoongArch systems that conform to IEEE754-2008, the (inf,zero,n= an) + * case sets InvalidOp and returns the input value 'c' + */ + set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status= ); } =20 int ieee_ex_to_loongarch(int xcpt) diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index ad4f7096d09..05dec2fcb4c 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -489,12 +489,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, /* * Temporarily fall back to ifdef ladder */ -#if defined(TARGET_HPPA) || \ - defined(TARGET_LOONGARCH) - /* - * For LoongArch systems that conform to IEEE754-2008, the (inf,ze= ro,nan) - * case sets InvalidOp and returns the input value 'c' - */ +#if defined(TARGET_HPPA) rule =3D float_infzeronan_dnan_never; #endif } --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790979; cv=none; d=zohomail.com; s=zohoarc; b=bwhCIIV3YFUs2cMHDMr3UdEq9Usx37bnU1z9mHSKIcV4NVM38SqePcFirLA5U+bnxD2uJpMySsIaeqr6f2YjKr1RB8JS6PiTVhbODGmBZfcwjWsv9/lri4f8oQjkXXILv3OlLaBVQ4nXJm7iba2JfcjPbQDTtFyinDQpGvaCBHE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790979; h=Content-Transfer-Encoding:Cc:Cc: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; bh=hyYEZNn0XnxoTIdyelbgzeOaKzs7K1fWizjpa6l6dh0=; b=H7LyS7eujGI5ehM7UcoecLkMEa0sNtKDhz1Efg6hB+A9zeJTP5dKCVYFEGyz+6/oeDztmHBec+t8gVYBwjCeY8tkxK8m1MshteFGWj7+tQvhxcOrOzW7EgS+2Ku1fiOrnuSBQro5xKariqbyC9jGpLa8eEI7Rt4kvyUW51dKiPw= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790979414521.0236394160792; Thu, 28 Nov 2024 02:49:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc2G-0005XM-VF; Thu, 28 Nov 2024 05:46:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzj-00027U-9r for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:39 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzb-0000Yu-PB for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:32 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-382296631f1so596653f8f.3 for ; Thu, 28 Nov 2024 02:43:25 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790604; x=1733395404; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hyYEZNn0XnxoTIdyelbgzeOaKzs7K1fWizjpa6l6dh0=; b=LSUEZ68btM0PfQErI+T4vC2nMtuo4MqcsucP7nVlTNXyy92h/VKsG4ivSA4NXBzExx iUSpmHtOps0ZflLr6QPm2QknHq87Ql/MdHQ39XbKI6HdQlvYR8TFuGtzqzaP7hAJS8cF Yy2us6fGvY7oaoulb4Pn6ZaBzbO3BPOafCXOEpfiwf6YdnUEIStEjRwa4Sz0NRkwBEPb ivkWvtSyZg/HqasRlkmjK5A3o/vHiMmPXPch/TYRSH/P2nydjY1ucuTrXLCFiQcMwbJN SV0IO9Yd/Io9wbOeQ2Ll+UItgU0fuXxST1sLPCYTwluVRCp7W/1IY2hAIQhyUcmVKYLH 4PBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790604; x=1733395404; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hyYEZNn0XnxoTIdyelbgzeOaKzs7K1fWizjpa6l6dh0=; b=ghXF1rYrxAM1OmbE4GzK0WJwZzHGmEak5sSXrZftOzxQ6qkJ8iEzqjDK+cnaotN7GI 0TphHgEvOerQ6c+VoHvY/RBpLGAD+uXDeixLHNhDXSTE6bpnUELn97l2S86KLVkn0Zan zEu94XRHO2P14T5wCnAiXBJS7g0xJfybI+Xx182Ab84wGNth3qEZiftnNyo7glzMHqVI 6vh72dHKLv+CD1iJ9pWuZ2Y1FU8jang4aEip4lqaOAWwNTszr1s3gigI1WQYjfvP+yoF qmrDIPdTLAqUNXeqSyLTjqZn5UPbnV5lMJvD29q11IUqPNnX1pHN9fUrT8UJcoixS34L g43A== X-Gm-Message-State: AOJu0YzuPRhuq2CIudMdfueZV/t0HwKV0tQFTOeIozzHTZzhkSZh3igG ajEE6ZZCRRsB6BjaNN/XdTwr5UhTsFxETkptTkwbljt4WN3A6yBDAwoXRnfRFVGHX+fqd7aI/5D H X-Gm-Gg: ASbGncvoIBz7K1yezjRxfkkuF1+o+0/cT+I88eCfkR2Yd2dwCFbCBqs1j3F1Y8H6FWz ONFvc1xW7hsqMi2yfedt9k87kukXuVumP/ggZPRmx9TsIrKbA1Tb8S/luCSHdIbdmx1jcX+f7Ax J8Dk1x+3mEaEdrf2BWVR+JTg9iT0jsdBPh/H1yHG24211afk5uExq4kYLBTH6J4gQcB7FjjW6Ne tMqCN2kbXgCFR8hG1F0A2YAmOUdmshOL7wrJSxGjL1d7YmVw1R/vB8= X-Google-Smtp-Source: AGHT+IGbzy7EzKb4dzUEAavEzzJsSYKrO6t+vXSJ9MO8ux6hcDinUpScoS9ZCNZkY9iXna2ctNwC7A== X-Received: by 2002:a05:6000:2c8:b0:382:4792:a48e with SMTP id ffacd0b85a97d-385c6ef39b2mr5795236f8f.48.1732790604581; Thu, 28 Nov 2024 02:43:24 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 13/25] target/hppa: Set FloatInfZeroNaNRule explicitly Date: Thu, 28 Nov 2024 10:42:58 +0000 Message-Id: <20241128104310.3452934-14-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790980893019100 Content-Type: text/plain; charset="utf-8" Set the FloatInfZeroNaNRule explicitly for the HPPA target, so we can remove the ifdef from pickNaNMulAdd(). As this is the last target to be converted to explicitly setting the rule, we can remove the fallback code in pickNaNMulAdd() entirely. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/hppa/fpu_helper.c | 2 ++ fpu/softfloat-specialize.c.inc | 13 +------------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/target/hppa/fpu_helper.c b/target/hppa/fpu_helper.c index 0e44074ba82..393cae33bf9 100644 --- a/target/hppa/fpu_helper.c +++ b/target/hppa/fpu_helper.c @@ -55,6 +55,8 @@ void HELPER(loaded_fr0)(CPUHPPAState *env) * HPPA does note implement a CPU reset method at all... */ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->fp_status); + /* For inf * 0 + NaN, return the input NaN */ + set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status= ); } =20 void cpu_hppa_loaded_fr0(CPUHPPAState *env) diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 05dec2fcb4c..3e4ec938b25 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -475,8 +475,6 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls, static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_= cls, bool infzero, float_status *status) { - FloatInfZeroNaNRule rule =3D status->float_infzeronan_rule; - /* * We guarantee not to require the target to tell us how to * pick a NaN if we're always returning the default NaN. @@ -485,21 +483,12 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass= b_cls, FloatClass c_cls, */ assert(!status->default_nan_mode); =20 - if (rule =3D=3D float_infzeronan_none) { - /* - * Temporarily fall back to ifdef ladder - */ -#if defined(TARGET_HPPA) - rule =3D float_infzeronan_dnan_never; -#endif - } - if (infzero) { /* * Inf * 0 + NaN -- some implementations return the default NaN he= re, * and some return the input NaN. */ - switch (rule) { + switch (status->float_infzeronan_rule) { case float_infzeronan_dnan_never: return 2; case float_infzeronan_dnan_always: --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790968; cv=none; d=zohomail.com; s=zohoarc; b=Jj594bZatJQbRp5nti+hsxHOttbVE8/REJD7QRB9ffkfGlAzmkYU36EA6zUvun3JwsqEhfIG1TKzL/pYqM3RGjFMVyp7CZo56Y1Ky2DmJbuymEiuBNxN+RP9fvhMITSdk32DEzGLtmeUGz2bB6HSyo4Rz7yhbOj/MEPhwqGtWpg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790968; h=Content-Transfer-Encoding:Cc:Cc: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; bh=BAfGDHXWne3fztjzcjDJwPhcKYYDiakCa5ET2Yl4WTw=; b=S5vfi8VM/K16Rwt0XzXn+jrJKUtRLiZT3rJ8H4cXrjDciFECuaRM01L17FTf9HmG+yLVvffXcSVgTZsOZ8hWEf4p7iDlaNvwaml3jyenklXX6rPwAuB58Ncw0wK7k3BGIaBE8ndSs9niNeey8aYFK8cjxJ/u4IbOexhbQm3D13I= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790968907177.1090969344998; Thu, 28 Nov 2024 02:49:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc1F-0004GO-Dy; Thu, 28 Nov 2024 05:45:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzj-00027W-9p for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:39 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzb-0000a7-Or for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:33 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-434a14d6bf4so5938205e9.1 for ; Thu, 28 Nov 2024 02:43:26 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790605; x=1733395405; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BAfGDHXWne3fztjzcjDJwPhcKYYDiakCa5ET2Yl4WTw=; b=VrRPoMb/jO4y6fBlYQRPZPo81u/2lIz0K3phwQyQAiKSVeKiuihjj8/sO4st4B1FKP 9GBUXd0pECVk+LWackB2YmgxQD5g58PdDqvUpU7cp2kzywGi8GGjV/SB+mugLxgsEphz WcZLLmfXsOGh0Cpj6izajD72EWMVa6g1h89zjCBHzJJKCUS47FmOcZ0lCYVnHzaYQ6Ws L3C0eEnwKgDtVjf19gAQhQCiIDAaT1ZqiddHPdKRcT1uiIA9GJnPutgMhn60wBFEHneC ndAXUY00T3LRsndF002YgDTaQroFu84e3Z+EsJ3aJmqwiklI1m58TT2Mt4821zgwn968 0JdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790605; x=1733395405; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BAfGDHXWne3fztjzcjDJwPhcKYYDiakCa5ET2Yl4WTw=; b=HzOSeSpIP9SFTZU44BNBnNxJer/lFItNrVpVJNg7IYe4VPWDDl2bH0aIQjvkhqoLkC j+DB0QSF9ytCB/RCeQ4llgAQH6Auyc1HvQB06PVcAUXkmFuB7LynaxD3ci4HtEhvpz/D oJet9w/TeOJrodF0x5vlZbUGQWdj0kSoasoMfFnMKQaFA2182GVthqy28von/M1jlvnf N9dnyqJG72WJ3FdAXp7IivCKwUOa1EyQo9MlG6lTuG8ouVr/5nQuWdJfqhqa37yH4tfl a0zwlTuUvqydQSQ68cmXdkzIOf+VacEsjdt5YjVMbjf7WAPWszfz9OgVg0tkZM40F1VD mrCg== X-Gm-Message-State: AOJu0YzuSLiJTPRsLqYaHXHg2qA8ZSpVd20aSiQu4hq19RhIEiNJ1v/Z xjyeO8WHWcP5N1bkMlm6aKYVi7h++v58pYvOaG44esbJOoF/IIMuuR466egjzsD5DXRzcfpi/Xg M X-Gm-Gg: ASbGncs/5m+YcSg4IUL365hdEJ16zIq3zraldKpdstxTJXEDd7FtLZBtvEJN9GF2kTu w9KHgixM7U/oenwxV+scKeUEi8kSVJzfdTVgpvWGd6eN+TZLbFMheufDaH1N8niMQUdUFrf/NjV x583UbZ7yq2S8Y13Zf6ZP1BSljg0NzUAxhpRfPl6p9Soy+6QdQIAQKoRgrsoB/IMOWEbxQSBdwO KoqofH8tmBKFUuTCquo6JLHz9qSSjmXpbrM8Jgmck+hGomK0rjsVmA= X-Google-Smtp-Source: AGHT+IF9NBOcitC4nIP+QcER1/u30JABGG9B8fbDoXJRqPKqrPkYIpnhfRfjvnQEOI1z2Tf/I2u4sg== X-Received: by 2002:a5d:6487:0:b0:382:5030:7b94 with SMTP id ffacd0b85a97d-385c6eb8f37mr4826560f8f.13.1732790605524; Thu, 28 Nov 2024 02:43:25 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 14/25] softfloat: Allow runtime choice of NaN propagation for muladd Date: Thu, 28 Nov 2024 10:42:59 +0000 Message-Id: <20241128104310.3452934-15-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790970926019100 Content-Type: text/plain; charset="utf-8" IEEE 758 does not define a fixed rule for which NaN to pick as the result if both operands of a 3-operand fused multiply-add operation are NaNs. As a result different architectures have ended up with different rules for propagating NaNs. QEMU currently hardcodes the NaN propagation logic into the binary because pickNaNMulAdd() has an ifdef ladder for different targets. We want to make the propagation rule instead be selectable at runtime, because: * this will let us have multiple targets in one QEMU binary * the Arm FEAT_AFP architectural feature includes letting the guest select a NaN propagation rule at runtime In this commit we add an enum for the propagation rule, the field in float_status, and the corresponding getters and setters. We change pickNaNMulAdd to honour this, but because all targets still leave this field at its default 0 value, the fallback logic will pick the rule type with the old ifdef ladder. It's valid not to set a propagation rule if default_nan_mode is enabled, because in that case there's no need to pick a NaN; all the callers of pickNaNMulAdd() catch this case and skip calling it. Signed-off-by: Peter Maydell --- include/fpu/softfloat-helpers.h | 11 +++ include/fpu/softfloat-types.h | 37 ++++++++ fpu/softfloat-specialize.c.inc | 160 +++++++++++++------------------- 3 files changed, 112 insertions(+), 96 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helper= s.h index 0bf44dc6087..cf06b4e16bf 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -81,6 +81,12 @@ static inline void set_float_2nan_prop_rule(Float2NaNPro= pRule rule, status->float_2nan_prop_rule =3D rule; } =20 +static inline void set_float_3nan_prop_rule(Float3NaNPropRule rule, + float_status *status) +{ + status->float_3nan_prop_rule =3D rule; +} + static inline void set_float_infzeronan_rule(FloatInfZeroNaNRule rule, float_status *status) { @@ -143,6 +149,11 @@ static inline Float2NaNPropRule get_float_2nan_prop_ru= le(float_status *status) return status->float_2nan_prop_rule; } =20 +static inline Float3NaNPropRule get_float_3nan_prop_rule(float_status *sta= tus) +{ + return status->float_3nan_prop_rule; +} + static inline FloatInfZeroNaNRule get_float_infzeronan_rule(float_status *= status) { return status->float_infzeronan_rule; diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index 27a1c96754d..79220f8c67f 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -207,6 +207,42 @@ typedef enum __attribute__((__packed__)) { float_2nan_prop_x87, } Float2NaNPropRule; =20 +/* + * 3-input NaN propagation rule, for fused multiply-add. Individual + * architectures have different rules for which input NaN is + * propagated to the output when there is more than one NaN on the + * input. + * + * If default_nan_mode is enabled then it is valid not to set a NaN + * propagation rule, because the softfloat code guarantees not to try + * to pick a NaN to propagate in default NaN mode. When not in + * default-NaN mode, it is an error for the target not to set the rule + * in float_status if it uses a muladd, and we will assert if we need + * to handle an input NaN and no rule was selected. + * + * For QEMU, the multiply-add operation is A * B + C. + * + * NB: we don't list all 12 possibilities here or implement them + * in pickNaNMulAdd; if your architecture needs one of the missing + * combinations you should add it. + */ +typedef enum __attribute__((__packed__)) { + /* No propagation rule specified */ + float_3nan_prop_none =3D 0, + /* Prefer SNaN over QNaN, then operand A over B over C */ + float_3nan_prop_s_abc, + /* Prefer SNaN over QNaN, then operand C over A over B */ + float_3nan_prop_s_cab, + /* Prefer SNaN over QNaN, then operand C over B over A */ + float_3nan_prop_s_cba, + /* Prefer A over B over C regardless of SNaN vs QNaN */ + float_3nan_prop_abc, + /* Prefer A over C over B regardless of SNaN vs QNaN */ + float_3nan_prop_acb, + /* Prefer C over B over A regardless of SNaN vs QNaN */ + float_3nan_prop_cba, +} Float3NaNPropRule; + /* * Rule for result of fused multiply-add 0 * Inf + NaN. * This must be a NaN, but implementations differ on whether this @@ -241,6 +277,7 @@ typedef struct float_status { FloatRoundMode float_rounding_mode; FloatX80RoundPrec floatx80_rounding_precision; Float2NaNPropRule float_2nan_prop_rule; + Float3NaNPropRule float_3nan_prop_rule; FloatInfZeroNaNRule float_infzeronan_rule; bool tininess_before_rounding; /* should denormalised results go to zero and set the inexact flag? */ diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 3e4ec938b25..d7c0c90ea65 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -475,6 +475,7 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls, static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_= cls, bool infzero, float_status *status) { + Float3NaNPropRule rule =3D status->float_3nan_prop_rule; /* * We guarantee not to require the target to tell us how to * pick a NaN if we're always returning the default NaN. @@ -500,27 +501,44 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass= b_cls, FloatClass c_cls, } } =20 + if (rule =3D=3D float_3nan_prop_none) { #if defined(TARGET_ARM) - - /* This looks different from the ARM ARM pseudocode, because the ARM A= RM - * puts the operands to a fused mac operation (a*b)+c in the order c,a= ,b. - */ - if (is_snan(c_cls)) { - return 2; - } else if (is_snan(a_cls)) { - return 0; - } else if (is_snan(b_cls)) { - return 1; - } else if (is_qnan(c_cls)) { - return 2; - } else if (is_qnan(a_cls)) { - return 0; - } else { - return 1; - } + /* + * This looks different from the ARM ARM pseudocode, because the A= RM ARM + * puts the operands to a fused mac operation (a*b)+c in the order= c,a,b + */ + rule =3D float_3nan_prop_s_cab; #elif defined(TARGET_MIPS) - if (snan_bit_is_one(status)) { - /* Prefer sNaN over qNaN, in the a, b, c order. */ + if (snan_bit_is_one(status)) { + rule =3D float_3nan_prop_s_abc; + } else { + rule =3D float_3nan_prop_s_cab; + } +#elif defined(TARGET_LOONGARCH64) + rule =3D float_3nan_prop_s_cab; +#elif defined(TARGET_PPC) + /* + * If fRA is a NaN return it; otherwise if fRB is a NaN return it; + * otherwise return fRC. Note that muladd on PPC is (fRA * fRC) + = frB + */ + rule =3D float_3nan_prop_acb; +#elif defined(TARGET_S390X) + rule =3D float_3nan_prop_s_abc; +#elif defined(TARGET_SPARC) + rule =3D float_3nan_prop_s_cba; +#elif defined(TARGET_XTENSA) + if (status->use_first_nan) { + rule =3D float_3nan_prop_abc; + } else { + rule =3D float_3nan_prop_cba; + } +#else + rule =3D float_3nan_prop_abc; +#endif + } + + switch (rule) { + case float_3nan_prop_s_abc: if (is_snan(a_cls)) { return 0; } else if (is_snan(b_cls)) { @@ -534,8 +552,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, } else { return 2; } - } else { - /* Prefer sNaN over qNaN, in the c, a, b order. */ + case float_3nan_prop_s_cab: if (is_snan(c_cls)) { return 2; } else if (is_snan(a_cls)) { @@ -549,68 +566,21 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass= b_cls, FloatClass c_cls, } else { return 1; } - } -#elif defined(TARGET_LOONGARCH64) - /* Prefer sNaN over qNaN, in the c, a, b order. */ - if (is_snan(c_cls)) { - return 2; - } else if (is_snan(a_cls)) { - return 0; - } else if (is_snan(b_cls)) { - return 1; - } else if (is_qnan(c_cls)) { - return 2; - } else if (is_qnan(a_cls)) { - return 0; - } else { - return 1; - } -#elif defined(TARGET_PPC) - /* If fRA is a NaN return it; otherwise if fRB is a NaN return it; - * otherwise return fRC. Note that muladd on PPC is (fRA * fRC) + frB - */ - if (is_nan(a_cls)) { - return 0; - } else if (is_nan(c_cls)) { - return 2; - } else { - return 1; - } -#elif defined(TARGET_S390X) - if (is_snan(a_cls)) { - return 0; - } else if (is_snan(b_cls)) { - return 1; - } else if (is_snan(c_cls)) { - return 2; - } else if (is_qnan(a_cls)) { - return 0; - } else if (is_qnan(b_cls)) { - return 1; - } else { - return 2; - } -#elif defined(TARGET_SPARC) - /* Prefer SNaN over QNaN, order C, B, A. */ - if (is_snan(c_cls)) { - return 2; - } else if (is_snan(b_cls)) { - return 1; - } else if (is_snan(a_cls)) { - return 0; - } else if (is_qnan(c_cls)) { - return 2; - } else if (is_qnan(b_cls)) { - return 1; - } else { - return 0; - } -#elif defined(TARGET_XTENSA) - /* - * For Xtensa, the (inf,zero,nan) case sets InvalidOp and returns - * an input NaN if we have one (ie c). - */ - if (status->use_first_nan) { + case float_3nan_prop_s_cba: + if (is_snan(c_cls)) { + return 2; + } else if (is_snan(b_cls)) { + return 1; + } else if (is_snan(a_cls)) { + return 0; + } else if (is_qnan(c_cls)) { + return 2; + } else if (is_qnan(b_cls)) { + return 1; + } else { + return 0; + } + case float_3nan_prop_abc: if (is_nan(a_cls)) { return 0; } else if (is_nan(b_cls)) { @@ -618,7 +588,15 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, } else { return 2; } - } else { + case float_3nan_prop_acb: + if (is_nan(a_cls)) { + return 0; + } else if (is_nan(c_cls)) { + return 2; + } else { + return 1; + } + case float_3nan_prop_cba: if (is_nan(c_cls)) { return 2; } else if (is_nan(b_cls)) { @@ -626,19 +604,9 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, } else { return 0; } + default: + g_assert_not_reached(); } -#else - /* A default implementation: prefer a to b to c. - * This is unlikely to actually match any real implementation. - */ - if (is_nan(a_cls)) { - return 0; - } else if (is_nan(b_cls)) { - return 1; - } else { - return 2; - } -#endif } =20 /*------------------------------------------------------------------------= ---- --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790966; cv=none; d=zohomail.com; s=zohoarc; b=GOaPBCW2spP+C9H6qSWR5I7YSOZR1i+VcOQr/b7l2Jrb9oqAu1v2ab4g2jcjfAATuVnvlh4gJmGqKfHiDmFjN2zo/mmFxgviIhvSxayqyE5pxthLbgN3OVhZ418oDgbERqYdMYeBvo/Cr2X2SmUQ8s4+30pstCWcRGZU+BudYSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790966; h=Content-Transfer-Encoding:Cc:Cc: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; bh=QSKy4hpjmDanw2YkU8Msj9vNT9iFFxMr9XhYnZJtyOY=; b=TYkuJk7GnIoGBfXGy76dTq8pihzR9Oqg9s/uZzJ+EwuMpu+DLi1TUwILYqyRzCwu2D9S3M7pME0pRKBQ6y1zV1aHS5sX3cEGW+s8xw3omrsHD+6XOlyhN/FZb4WUpqUkB771g85JzlS/Km5uhd+dZZvc+zbgIgCin0B4oky604c= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790966942153.38163793450371; Thu, 28 Nov 2024 02:49:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc1a-0004vr-KR; Thu, 28 Nov 2024 05:45:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzj-00027T-AS for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:39 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzb-0000cf-SA for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:33 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-434a752140eso5706945e9.3 for ; Thu, 28 Nov 2024 02:43:27 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790606; x=1733395406; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QSKy4hpjmDanw2YkU8Msj9vNT9iFFxMr9XhYnZJtyOY=; b=pJVqARvBxhBksRpOt2hfm6pQ+r3TYzk79rmjdWMoqJnX/0R6R9REYs+CJnRwzsgviS CWFlEsxqr93zoKh81dgb0k7Sowl/EDAtVJDvgglZMET6ERJuD4rZ77erzg+M4k+WV7NN oWMQ6nrxOGbt1/iOwiqO9UcVG5izQopiuoZE8N2mv4fCltMvezp4RvwjKDvhNUXUbnu7 PzbTBSr/CYx87nkSx4MaB6Qy03CzUv79C1Yx8oe9sdC/Ro2s9iBFkSt1LUVQJ8h5hS61 jzBEWZWEnM8IdS1cNQoXjsH/YucmeNmq1p/z6zqDmW0lZ9LA7iIO/e1085fFMQTTKNL6 0P4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790606; x=1733395406; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QSKy4hpjmDanw2YkU8Msj9vNT9iFFxMr9XhYnZJtyOY=; b=oMdJT9clKXAZA84vbbjE6dpCJ68Mo5hSngSU/aPeGlXKzZxaHgbMMGERPwaWBC4DfV ViaIMqTQ+MoRN5zut+WdwPZ4kXQJ822kuaOwQUiC8dV+jdnwohXphUHQq340kMJBYDvR 0q0HJ9+NdwYnPfXD594N5oI6bjbumxPjnnFXYly6fUYUAhUY/LvLLCpS0zHxdl1DJzrw kTjbdqCgUV12QuKUFCkoLyNppZ/PVurzspdd0pieqW4eBLTxN1fIVOkfOV+1gqxEiEhu 8nX0QDXzBRrZnp5Gr2Lq1hXHFpQx2eDCX3C0zTNFHFmQZJbIWq260Lk+3U5M3E4BP4z7 vs6g== X-Gm-Message-State: AOJu0Yy//CnCptpp6+/PG+97OkJROV2rvX81iVg6vcWpyBzZHN8bkWkC LWMKwDRDPFD/qRwSO7+4TfsIVfnD14fxHhJUvXiHyQhwiiKtHKv2wX4LB3gR1awwbE45CMy12Wm O X-Gm-Gg: ASbGncvTxMO+ZF7nQxVaC15suOGg+d8rK4sTfSXVu3N3krTQGo5B+pZDLDawkjA2/Tu Z5qB5ERJvlHAXaTFLHJoGKJjkvswlGYALU8kYQxyadqs//uk7xvsZnuhAr9Fje7c9vT6Sd0+qWt hVJ9Z4h4NdoJ6R5ozU+u7deu3eNfaWq9AdrgJ/bp4goIN5CIP/H+ZbIX9N3KzNGZb2B4btWj6F9 J4mRJUcVJrx75/OXi2iJxk4LlvlkrnQENWrGDFQQQdcUkb7nwklYqY= X-Google-Smtp-Source: AGHT+IFPYgLS/9mtFeOgG8MTJy0ecGQ8tHYcoQ6j4T4JFNFBCu+Lus0yiAtaYo6HX1Dg78AUM8LyQw== X-Received: by 2002:a5d:59ab:0:b0:382:42d7:eedc with SMTP id ffacd0b85a97d-385c6cca8dfmr5318903f8f.5.1732790606376; Thu, 28 Nov 2024 02:43:26 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 15/25] tests/fp: Explicitly set 3-NaN propagation rule Date: Thu, 28 Nov 2024 10:43:00 +0000 Message-Id: <20241128104310.3452934-16-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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: 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: 1732790968898019100 Content-Type: text/plain; charset="utf-8" Explicitly set a rule in the softfloat tests for propagating NaNs in the muladd case. In meson.build we put -DTARGET_ARM in fpcflags, and so we should select here the Arm rule of float_3nan_prop_s_cab. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- tests/fp/fp-bench.c | 1 + tests/fp/fp-test.c | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c index fde64836194..39d80c9038f 100644 --- a/tests/fp/fp-bench.c +++ b/tests/fp/fp-bench.c @@ -493,6 +493,7 @@ static void run_bench(void) * doesn't specify match those used by the Arm architecture. */ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &soft_status); + set_float_3nan_prop_rule(float_3nan_prop_s_cab, &soft_status); set_float_infzeronan_rule(float_infzeronan_dnan_if_qnan, &soft_status); =20 f =3D bench_funcs[operation][precision]; diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c index 251c278ede9..f290d523ab1 100644 --- a/tests/fp/fp-test.c +++ b/tests/fp/fp-test.c @@ -940,6 +940,7 @@ void run_test(void) * doesn't specify match those used by the Arm architecture. */ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &qsf); + set_float_3nan_prop_rule(float_3nan_prop_s_cab, &qsf); set_float_infzeronan_rule(float_infzeronan_dnan_if_qnan, &qsf); =20 genCases_setLevel(test_level); --=20 2.34.1 From nobody Thu Dec 26 10:34:23 2024 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=1732790937; cv=none; d=zohomail.com; s=zohoarc; b=D7Xud+g/aKzmy54qCgQP9OvG0eYoktf/IIQLlam5z6H6P543MCnZOoo/Q8PzKV/4gySEO1oBIXn7LosT8PTQp7Ja2UfE9DoUi/2cdFG6yidbh3BELWqbMruSD5XbGGLtNBhTZiGcD93Ne0mHl0ag6var85D8krr8ryiEgpZB1nI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790937; h=Content-Transfer-Encoding:Cc:Cc: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; bh=bWS/GNsFs6Pu4pBOarLJaqHWrc7CmHsdY5ILX0uFeec=; b=V1IxYDrmukhoQ3j3au/K0tin720flMdHaL/uKCZ2g20LF9AaBM1AFbBmtL2g8IbfUXkG3wAmzSDDEhnFMSaOocj1BJ1+YKez6lFmNF2unjhGMU7AesH95Knzg73rDeZ8CMAGa/SgyHw/NMW3J5wuGkLiOBNHM75k4HQnCPPwuGU= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17327909378561002.9975658795903; Thu, 28 Nov 2024 02:48:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc0k-0003Yj-UN; Thu, 28 Nov 2024 05:44:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzu-0002AQ-RU for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:49 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzc-0000dH-WD for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:37 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-43497839b80so3819875e9.2 for ; Thu, 28 Nov 2024 02:43:28 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790607; x=1733395407; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bWS/GNsFs6Pu4pBOarLJaqHWrc7CmHsdY5ILX0uFeec=; b=qSlcYqIdLutkhsSMfs+9qzz3lUqqPcL0bxd3YAvW5EVxOJk+oGOEme538Sz1PArV8G aE10a27kBDZmS3pP8tLfXsjPM7rBCQMR7jdEFpiooUBYfLVXnXWDlFURrkz6LXrsts9w 3n1vU5snljTxDxRd4UgV65x/SfZLMDJQE9iqNr0A2oJUJZ+rZddoXmHV18iaqiZOyVdG wUWkGQmkPIlbWqVFcALJOlBCFjSd03YalXw5Qod7Jsnz27o2wSNkFP/62Kkn4lCULRvG fcNtanW4haGyXUYpmiAAWoSQoBmDSOJgHRJOpUAwQb5XU8OjVlcPNgpH7PdDNflsAQaQ tzqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790607; x=1733395407; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bWS/GNsFs6Pu4pBOarLJaqHWrc7CmHsdY5ILX0uFeec=; b=pXc80NWlT0M4d8Nm06Bm0fyvWtsoNE9z124y3Xhc9UqICi+GAhLudDPod4gSr7tSe/ vAA128S9/mhbHL9723qLcROTmyeuoGg1WjwdFSQkiHPYh8+gmDWIpjYzHK4kDAQopXsO rizxnjTLaHlsQdw5u3Ubp8GkFLAha0EnKBgUh4kj6zelTJ7frTFosKah+ZFn1Sk1QmPT PNJov+c3CQ2eEu+Z7CM0Bq3e/+7WtERXK1PiAGI37+0WhOHQIM8Sta89iiIlMkyAUBSw eGDO4JrYQUikLx39jPJY004WcA+sSujwpqE7otmSesywjvbZ1AUSiyAOtLFbwCEUTvYF Mpiw== X-Gm-Message-State: AOJu0YzufOMQeT2RvTRk5Ot9lLIgv4SKi0zdejUsvdZu2hJ8IposHRmA ZNwbYK8cRwXA6DfZmleYcIk4z7YAgx7rsyfbPTsDBbFJmd0cg718hHKEYDKajdnpIiXX3cs8kXZ N X-Gm-Gg: ASbGncurU+N6uy9gaiMY+jFekyBSJy5US/WILCW4TAUPJlCBfNuU3vhtcE324cEr0qr 9u48fBVf2+bhjDvvbDA8FSVhEdBpulsisKrMEezpvktAyYz8p3kCJNTYRm+sSRU5iVX+edelyWe cu1MwLj4ghWfRbvVbiPK+9P7tOmWLWs9ghzgexzX6iBOpIS39bkDVssIx6VURukl66Jw9uDVuEJ cKmI+hS4oDd3Oa31oRN03eHV6qNG57L19JhzGmWWh5z8z38VSZRKyc= X-Google-Smtp-Source: AGHT+IGyNWzgLyZWnKL8/dUfy9pyTYenNBT+T45tCtsyt5xK6UxFlG0jFs6wCg5GyXMMCyWimSPO1g== X-Received: by 2002:a05:6000:1fad:b0:382:4b83:d4c0 with SMTP id ffacd0b85a97d-385c6eb7aacmr5799987f8f.3.1732790607241; Thu, 28 Nov 2024 02:43:27 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 16/25] target/arm: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:01 +0000 Message-Id: <20241128104310.3452934-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790938655019100 Content-Type: text/plain; charset="utf-8" Set the Float3NaNPropRule explicitly for Arm, and remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/cpu.c | 5 +++++ fpu/softfloat-specialize.c.inc | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index ead39793985..c81f6df3fca 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -173,6 +173,10 @@ void arm_register_el_change_hook(ARMCPU *cpu, ARMELCha= ngeHookFn *hook, * * tininess-before-rounding * * 2-input NaN propagation prefers SNaN over QNaN, and then * operand A over operand B (see FPProcessNaNs() pseudocode) + * * 3-input NaN propagation prefers SNaN over QNaN, and then + * operand C over A over B (see FPProcessNaNs3() pseudocode, + * but note that for QEMU muladd is a * b + c, whereas for + * the pseudocode function the arguments are in the order c, a, b. * * 0 * Inf + NaN returns the default NaN if the input NaN is quiet, * and the input NaN if it is signalling */ @@ -180,6 +184,7 @@ static void arm_set_default_fp_behaviours(float_status = *s) { set_float_detect_tininess(float_tininess_before_rounding, s); set_float_2nan_prop_rule(float_2nan_prop_s_ab, s); + set_float_3nan_prop_rule(float_3nan_prop_s_cab, s); set_float_infzeronan_rule(float_infzeronan_dnan_if_qnan, s); } =20 diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index d7c0c90ea65..9b5243c9529 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -502,13 +502,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, } =20 if (rule =3D=3D float_3nan_prop_none) { -#if defined(TARGET_ARM) - /* - * This looks different from the ARM ARM pseudocode, because the A= RM ARM - * puts the operands to a fused mac operation (a*b)+c in the order= c,a,b - */ - rule =3D float_3nan_prop_s_cab; -#elif defined(TARGET_MIPS) +#if defined(TARGET_MIPS) if (snan_bit_is_one(status)) { rule =3D float_3nan_prop_s_abc; } else { --=20 2.34.1 From nobody Thu Dec 26 10:34:24 2024 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=1732790960; cv=none; d=zohomail.com; s=zohoarc; b=HmXYi6Rp8vb1m6woA0mkdK5VR+uVZnE3AGwaFSec93wcesGT0QZN6n3+00ZLjb97H5t7iVSd9zOomqDhbQRna/AV1L50CylqkC4t0af6mslj/rU4r9YwNRnbN2DkHEG7puO6bjD6mDuovfxpfyXDIkj2W3Mvy6fQh1W86hMUWpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790960; h=Content-Transfer-Encoding:Cc:Cc: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; bh=x4JtTEJWuqktTR0K+Db+JfgEPXYfhnr/W1wwAJOuIfc=; b=INgsCR8Ss1AtHKS+3Q5zeAEiR/zxPl39D2xJoVsw75nl9mO0WAyNdA1ZOzIU2QNcNq0NO4bPUIf+I9gTP35WiBv8xlprbGvxrkbpjcQ/zR8OZFaa4RGbeVSeBc6dHgtMl0L5JfrEp/QjVWEJAZnsbFETAct9JQ0pO6Oqw7qtNHE= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790960681276.5426799752232; Thu, 28 Nov 2024 02:49:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc0g-0003Ao-LV; Thu, 28 Nov 2024 05:44:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzu-0002BZ-SO for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:49 -0500 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzf-0000eS-Hz for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:39 -0500 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-53df7f6a133so318150e87.3 for ; Thu, 28 Nov 2024 02:43:29 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790608; x=1733395408; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=x4JtTEJWuqktTR0K+Db+JfgEPXYfhnr/W1wwAJOuIfc=; b=vTrQdMwMQlyCy4CfLnN+OY6HJ5KqnUs3wS5HuxGhdxARs3AtinxKIHgIKl/DCkOJhV 5+JAjaljN4v4yiGx3Suyj8HoKVB2PflR73jygF5gj7whsIhdw9LgtimuL0DIazsbk47v f9j8EV4Et4+g/rPp3SfR8wShMJjX4WSk5GR8mgu6X/aOE0rOSZaAUedRgaj++uId0cui ruGrwRLdnmwDshNOEGWffhqtkxZLo+7Nyus/YenHrRfEZ2CuKrYBbp07IudJnmdniTty LlIl3BugBGQxdUIAOexZePwdEFdDsiQf53OArZUw0h0lCIuwGxVl4pYdjRzICjGGCLXr EW8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790608; x=1733395408; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=x4JtTEJWuqktTR0K+Db+JfgEPXYfhnr/W1wwAJOuIfc=; b=eehbSZk3blp9Uvh5MJS/8IYCd6ncIMhtlZaRIJ695BDccWxia0VxHH9iX/FXZM/WG/ YVPGsdRWYbgy8r3zcHlpGxwr7avQ1QzguLgxb1cIZge8EZdar2SloMshS+eV2NT/Vets J7JAKH1iL7rkqa2OGvRN77VlKokri5JkGT7QCijDAc0HbLsQBYKszP6fAYDUdp8VTYF3 /ADB3raKCyCe416U/mkBAVYN8GnwkL629sPfCU6+6u4UKQP4RaMLzHoIw5ATmtUN/QrQ NoSqc0jq1vXV/BVNOsiuKYHgydpLZo9AfO4eO9jtuAWW/qgef1fzTGhozt0neZ4NUJXJ Er3g== X-Gm-Message-State: AOJu0YwFcufII80izOHQVL2+JYLAM6F/u/mavKJtoUuzauCYnFa6h1B2 Vlrq5D+8Y2wObhsk5anXMbgcDsAeGXPq8Q818theggXYd9QYqKiNhRt7khXqJJVh3thH/afVd6L + X-Gm-Gg: ASbGnctJ2wAwNPxb8xgqZR9kPG8Pwx/zVdQZ/FLtid2qPsMDcfCIJUe8YC9D8a2Vrtl O9FUKlhKAenkdrwyFxqyakLVs2h3PB+azw2my6h5/F1/37CVp9nscZ/i6bnXnKX5xnSOTlLN9Xy dDXCld/K4saBGh50QdG9j8FQqHOidwLIl0c03f+3W6SA4vVtoNN/eQAIy6OZbzVDmJCectx1gGi rcFNtHkoC6PjIxmHibaZxxJsiBufQlImMh6/ANORd+a1Gio8zBeIC4= X-Google-Smtp-Source: AGHT+IFznEpI3626Zge6MstJ38Rvz+FlulNzVErYAdeWNT7kyvFMFVQK7nEiiNlSohoHqRH1nB9MVw== X-Received: by 2002:a05:6512:1115:b0:53d:ecce:361f with SMTP id 2adb3069b0e04-53df00d9e74mr3968213e87.30.1732790608301; Thu, 28 Nov 2024 02:43:28 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 17/25] target/loongarch: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:02 +0000 Message-Id: <20241128104310.3452934-18-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x12d.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790962730019100 Content-Type: text/plain; charset="utf-8" Set the Float3NaNPropRule explicitly for loongarch, and remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/loongarch/tcg/fpu_helper.c | 1 + fpu/softfloat-specialize.c.inc | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/target/loongarch/tcg/fpu_helper.c b/target/loongarch/tcg/fpu_h= elper.c index 6a2c4b5b1db..37a48599366 100644 --- a/target/loongarch/tcg/fpu_helper.c +++ b/target/loongarch/tcg/fpu_helper.c @@ -37,6 +37,7 @@ void restore_fp_status(CPULoongArchState *env) * case sets InvalidOp and returns the input value 'c' */ set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status= ); + set_float_3nan_prop_rule(float_3nan_prop_s_cab, &env->fp_status); } =20 int ieee_ex_to_loongarch(int xcpt) diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 9b5243c9529..32edb493776 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -508,8 +508,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, } else { rule =3D float_3nan_prop_s_cab; } -#elif defined(TARGET_LOONGARCH64) - rule =3D float_3nan_prop_s_cab; #elif defined(TARGET_PPC) /* * If fRA is a NaN return it; otherwise if fRB is a NaN return it; --=20 2.34.1 From nobody Thu Dec 26 10:34:24 2024 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=1732791072; cv=none; d=zohomail.com; s=zohoarc; b=HxzeAktOFXPbjLujClZ+NKrtOyapyFW/+e5zx8H8y/cTVoxhzzvmrxCNR8MIaBxWN/B0gdoFpvN7lycLoSdWCQR2xnYku2cTTOFqbunNMQh+VGORJyFNvhfmSJWk5Jk1PgDt4lps2S8bvDp2rcS7wMam7hnhb+TET/cs0dDHhQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732791072; h=Content-Transfer-Encoding:Cc:Cc: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; bh=xHFYmwmnqcmAvgEMbarhecchly8CdIQ7oYTdDVFhVcI=; b=VfVthDL5izZR05A6rA/3fbFC4pROboE8toHrNXpINY2FXei91tRVDtU47pZMbAsvxI0+Lnet5P+fk6mHOpXIdYApX+4tzvh4LsthMKl4COD4PXyF5hYASJQP+WA30QkNFJ8zAh8MYhKVooSxzy4ik+92t+WN9Drg/pz+SDUZBRY= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173279107263327.944369295023762; Thu, 28 Nov 2024 02:51:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc2g-0006V3-CK; Thu, 28 Nov 2024 05:46:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzu-0002A7-PN for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:49 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzk-0000gd-2B for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:42 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-434aa222d96so7431095e9.0 for ; Thu, 28 Nov 2024 02:43:34 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790613; x=1733395413; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xHFYmwmnqcmAvgEMbarhecchly8CdIQ7oYTdDVFhVcI=; b=YbXEve57aOvZ5W0ozEJ/bACYhxz5jmq0Mmj31yAJH1ZrdC5dy3zRt34/YfN+u3RxQl 8gcZRDCr/I/1VFdGpyrDcS+Hzla2o5VhVZEFrDDksoShP7PdTj3SedFlyKiuyzw7nY96 Rq/19HnG8CNHpE+qH4X14+CrGILwacRLhGPa0lAW9aM3QMHMmoxw5ajKKGStiMEzWAEN QXrEtivva1wOIGAgg6+dZFWxu+P+jG3wXxGamW8N4cnYxWTnaoXJb0cP7kO9aPIsgOQf 8SP69dAWXoOIj4/EteK5Bt6SFuDQch2I2fzxT4uZBJ7hyBF7Muqx+ypT7ly0SCRl7GSt UcHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790613; x=1733395413; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xHFYmwmnqcmAvgEMbarhecchly8CdIQ7oYTdDVFhVcI=; b=FJgM/GfXHJm1TxGj+TLbhR6pMOSZBVhONVmMOVzjtsi9uso1kPhNQaWIDsVhrBOh94 8KHKHWR8xWpe1kXjIQR5WRR5XOn0x3h2eRgIUrGTh5EGLqCRJgBUWoKokDKRurw2U3c3 h7lDO+bWehDyCH0zxSiRTPu+qnGcorhyJYQnoSwYOdEQ5P2KxQuXkRYwR7hggVdmEJSr PwnUspT9WCGCItYXSWKUQJJPxye2lWAyofS6vMh7Xtt58UgMsZ5f6vxfnM9IV24KnK37 o0J5k7jMexr6P0GnORBmtHKrFpRBYwuG55xrd9FNaPHqxhK2r0jaaGY4HAIgMwS6VK1u HWyw== X-Gm-Message-State: AOJu0YzRZn+Oor3xGbkJCs9TJV3yw2pM+kw19TBEOQErJoUkfe1Oq/iV TYlzipTYT1OcTEA6UYSzhYiIyvWsrBg5J/19FnduNDteRq6WyEaIrY+BAOXsju+rkElQM/pJrTD i X-Gm-Gg: ASbGnctB7uJVcGiNC2YA2h5/fudt87MzjFXsKAk+bYZP9DVt3D/Jcn1N9ahWzwfAgQZ fb09/O73sg5ZduAAkkG+gk1UXuntltCH45p1B09+/P1lHDyuxxs2YWdUkw2nLIpV57q2Dxvy9IO JgMQDn8U0sXwmvvnmB/jRVjhEW6pn32WuaFi+ZH56LoZuowxZbILKqRUoVsF4LFK4LsUuaHQGwD VIBgesulKlrujbntc1xv0kKipd3vLv/avakgbib8EI+r3Qt990PSWk= X-Google-Smtp-Source: AGHT+IHD8Eop3Sl1nLVu2mVi+S7Bbn0D0QOlNKeDuqEmug+IgUvyzvvZweODFgWcNmvnV9fee/YCpg== X-Received: by 2002:a05:6000:1449:b0:37d:4376:6e1d with SMTP id ffacd0b85a97d-385c6ed97f5mr6117943f8f.41.1732790609207; Thu, 28 Nov 2024 02:43:29 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 18/25] target/ppc: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:03 +0000 Message-Id: <20241128104310.3452934-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732791073248019100 Content-Type: text/plain; charset="utf-8" Set the Float3NaNPropRule explicitly for PPC, and remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/ppc/cpu_init.c | 8 ++++++++ fpu/softfloat-specialize.c.inc | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index f18908a643a..eb9d7b13701 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7270,6 +7270,14 @@ static void ppc_cpu_reset_hold(Object *obj, ResetTyp= e type) */ set_float_2nan_prop_rule(float_2nan_prop_ab, &env->fp_status); set_float_2nan_prop_rule(float_2nan_prop_ab, &env->vec_status); + /* + * NaN propagation for fused multiply-add: + * if fRA is a NaN return it; otherwise if fRB is a NaN return it; + * otherwise return fRC. Note that muladd on PPC is (fRA * fRC) + frB + * whereas QEMU labels the operands as (a * b) + c. + */ + set_float_3nan_prop_rule(float_3nan_prop_acb, &env->fp_status); + set_float_3nan_prop_rule(float_3nan_prop_acb, &env->vec_status); /* * For PPC, the (inf,zero,qnan) case sets InvalidOp, but we prefer * to return an input NaN if we have one (ie c) rather than generating diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 32edb493776..d89ef62b38a 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -508,12 +508,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, } else { rule =3D float_3nan_prop_s_cab; } -#elif defined(TARGET_PPC) - /* - * If fRA is a NaN return it; otherwise if fRB is a NaN return it; - * otherwise return fRC. Note that muladd on PPC is (fRA * fRC) + = frB - */ - rule =3D float_3nan_prop_acb; #elif defined(TARGET_S390X) rule =3D float_3nan_prop_s_abc; #elif defined(TARGET_SPARC) --=20 2.34.1 From nobody Thu Dec 26 10:34:24 2024 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=1732790967; cv=none; d=zohomail.com; s=zohoarc; b=nIU4JVWTPNdat8XL9zzGFSUUovaeH6hm8FWcJ6d6i3I9IwOZapuHqMRqE1XDluwyCBgjmOGKjcphfejHHFGM8AYNqRPloYsYK2/Y/QfnqDKSVKYD9X1gr0EynYSa6wks2FadK2PmeHWPAij7Cq1ukdBoERQyzuFgH2SswBfWa+E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790967; h=Content-Transfer-Encoding:Cc:Cc: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; bh=gk3Ta1kp4SadfMQYiQE9XBmUhbOJYxUOTQDRYm9Ciy8=; b=O2++13tesMLJM9wqhJk2yR2s2jtjpRm66heQmD0LsPL1f9zCf2DV7YHk6jcZ1RyrRhkym0J7ziItJx7CdRITNra+JQUts2dn1IKet/QfJgkGsS7ybogMVj5sLS8Pm/9rNNHP0a13UcYwyzGkXDv8KAlU9+5PAMGS2ERVcW/eBPk= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790967376981.7075616154697; Thu, 28 Nov 2024 02:49:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc1E-0004Ax-EZ; Thu, 28 Nov 2024 05:45:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzu-0002A8-SM for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:49 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzi-0000gE-5a for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:40 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43494a20379so5975305e9.0 for ; Thu, 28 Nov 2024 02:43:33 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790612; x=1733395412; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gk3Ta1kp4SadfMQYiQE9XBmUhbOJYxUOTQDRYm9Ciy8=; b=T9hnbPgJ56KqqUqex55Bj9RTfsNTWrFZfvyCe8tzzP5WS1Cw1Mz4zaimVGq+uTP9Hd oOCe1NcZZgN8HVVpKBwmZnSvx0DvFuQcZn5uuDTbzTSOP1iKxdZRway+0yIhHeyymxVr 1bgcAyilNQgmRg+5e3p8HsNQxJ1mk21FL2fze6ugLFVh4cqk9QtTEb7gmLujCyH8Ve0Q ARaxR0IRsAL1ySl+HCO+IHqJOAxPlzAzRwb93dnwnpSVs9Yc8qc3Cz1DrVURb0M+qp0A kp3v4FeV4p75fVTnUqp78own/ur9JBoyB1SeOvBRG+n7/6lr/VdDOMGJrELcbrwDxEUU ZTdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790612; x=1733395412; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gk3Ta1kp4SadfMQYiQE9XBmUhbOJYxUOTQDRYm9Ciy8=; b=KyQugxgacDO2jTlNkkg5e+ACuig8t6CQOzoVMFXkkxYqsp8JtPhJF24N4X8km9oWAQ 1dfJzAI0zDFBnEAJaI5YpdXYZW4IvgjbQlIedNVSC6HeBN9mXti0NVGYHOH4HdXFJvm9 epPhKvFUo4cczT4sKTP3Ijn1GIkgw5JpPrA2bk51Ypr2He4QLXq28wqWm7xSKwsR3+WI ju0xAhZ/JCQeey5txvcKPLd03fwuVnbjFyJGDkL/b/Jhf+/edkjpPdguRxnQX+FQ6fUA YPVHu8JiurUIfZhp4e9mT7dgG3uFPL4tKvGRXg10m2qtXEBSNgGPsuORpEEVhhIhhQUQ qSRQ== X-Gm-Message-State: AOJu0Yx2A8rOOaE49q/kLFzar2FgJpCElXkfaSy2s8m7jB7LnNkEmj+u FJ92tnsu+1KZXe+2OY2eWYmorn7fk6osXLTxtOVMdnsyNR3UfQsjEHE5PbWVECdfkDvnSll2PaE B X-Gm-Gg: ASbGncsP+u9W75CosNblBzlDsh5hvVPViY6sqfEWH8z8gTbOQUihvuu37vVqF9FEnNO xtyodkx0pqh+e8PGXpch+r8WSZcCkalstCn5rHY7v9mC+nGd3A6EGfFjfBxtrVvB6NaT0INFhdt iLhDgnXYspx3cIAfjc5Q+CM3Csm6E2Bh0jkDPb2Pr3k6W3PbW7lunO3ljmXVLcympRb08+xDjeK NhdPkgkcdIKmNSHBnrWdtVz7Cc0oHKdRstbCgf3MR1PagHsUgF+S98= X-Google-Smtp-Source: AGHT+IHf21opook/IKPYpyUU/oWLnaC969kFG9ZVqJdEGuQQfFX8DSROTP8X+3Z/bd3pBl5u/uc4aw== X-Received: by 2002:a05:6000:2cc:b0:382:498a:9cec with SMTP id ffacd0b85a97d-385c6ebb90cmr5852564f8f.13.1732790612660; Thu, 28 Nov 2024 02:43:32 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 19/25] target/s390x: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:04 +0000 Message-Id: <20241128104310.3452934-20-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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: 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: 1732790968896019100 Content-Type: text/plain; charset="utf-8" Set the Float3NaNPropRule explicitly for s390x, and remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/s390x/cpu.c | 1 + fpu/softfloat-specialize.c.inc | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index d5941b5b9df..e74055bad79 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -206,6 +206,7 @@ static void s390_cpu_reset_hold(Object *obj, ResetType = type) set_float_detect_tininess(float_tininess_before_rounding, &env->fpu_status); set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->fpu_status); + set_float_3nan_prop_rule(float_3nan_prop_s_abc, &env->fpu_status); set_float_infzeronan_rule(float_infzeronan_dnan_always, &env->fpu_status); /* fall through */ diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index d89ef62b38a..31b23ddb9bb 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -508,8 +508,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, } else { rule =3D float_3nan_prop_s_cab; } -#elif defined(TARGET_S390X) - rule =3D float_3nan_prop_s_abc; #elif defined(TARGET_SPARC) rule =3D float_3nan_prop_s_cba; #elif defined(TARGET_XTENSA) --=20 2.34.1 From nobody Thu Dec 26 10:34:24 2024 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=1732790979; cv=none; d=zohomail.com; s=zohoarc; b=cx9u+72C96mP2CcUCXuZgaqA7GcSikgl9n5UZJ1xIemaesVV4ZXddtNpPPVIayw+uq6vYfx98lH0JLSiSIe+IP0O2pcl09QK5B6aOab6X6PJ9V/VRRMXAGkClDInGZRAAdLb+D9bNfkb5zLYpm/AvamwxIrRWPGq+hujqo6sixE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790979; h=Content-Transfer-Encoding:Cc:Cc: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; bh=M59b1YXia+t10MRDfuwOiG0kBN1H5nWvD2y8aDo+yb4=; b=S0EM8sizvZ1id9WxNzY2lE1Wu8WDaJGG75lcIBOm0pBfLdCgVbDHRlJ2xb9A/lX7zvbrmF58g6Fwv/8djX7/QGPxILDyubT27ynpZcoQ2QqEjYcTPU1mBCQOwh7lux9Q1aYXg3HKb/yxPF6lclXKLeCu/9TWT2Cpbyj3kdj3IEw= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790979879782.2222335731652; Thu, 28 Nov 2024 02:49:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc2m-0007Ft-RK; Thu, 28 Nov 2024 05:46:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGc01-0002Eq-Qy for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:44:00 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzu-0000hD-QQ for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:51 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3822ba3cdbcso462952f8f.0 for ; Thu, 28 Nov 2024 02:43:34 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790613; x=1733395413; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M59b1YXia+t10MRDfuwOiG0kBN1H5nWvD2y8aDo+yb4=; b=LRsfQH2qLXzucM+4vtMquZLThHXOnKlyp1rVEbPjCVWumtNlHq5LiQE6V7fFVzOnKh MH6Cfsxeq/pkC0D+SIuZH9BzMfnxHFsrjOZRB95OPNG5KZshxUtnjQe7L/oLR0KbKOMG nnQOWdEVppz1rxM/M2sUQ4KOaSs2TbNBRuyALU5bK07zArXLx5/pydnnIzlJ4+p8Ganh qKt6aGkhH5mTB8ihaTs1g+fNRag/vfnPWJUbi6aeazmfBFBq7N4cAbXuJVMC5iqsn2rI 6oeOv8venAUiypzn5+MqJAWl4hInFO5nYvtMzDKZsFNhqaqb3GoIdg+jEmnc0TYYfBrp 5tKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790613; x=1733395413; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M59b1YXia+t10MRDfuwOiG0kBN1H5nWvD2y8aDo+yb4=; b=c7EVi77uk2YpgIn9pzKihtAeJR4DIOf+wNSC2bUhvDFVJhYAn6+Vm5mXJa3+6JRa52 D01PjkhruqVmzH5HFgi0PSTMbrpmEHaMgprdoIxVu6GkOTcoQAFR1bEQAwgrkkhsUYE1 /e3j9nbSYJ1kQBwkMjrd3HCn4J601c2EgVXmvwsfmJCe2CgNVOwKbgM11mFExSfswFoc tiHd6n6NBrIx4bi2JP1lnxvYPOhP+d+5bYDT16QLHq5AzE99vj+F2mkPAxkeONqmagHZ 5zPueDBZTVmZt92Rz4rpdyl4UmEdwlOOG93jU/xQQJHUVBhX2x+xaEzlQV6TdPKqzuIE 781g== X-Gm-Message-State: AOJu0Yzb0y9yEqjZ6ftqzt1fttMy5vnyhlm1QFONvQMXRUVXGCq/qnWM wwxM5upTubmUesLZfLixp1DTMfnAIg6pazOAC+tObQI3xz3oE41w8irGzHRgpnUHGgRq0DGolcm 1 X-Gm-Gg: ASbGncsiqwSOIUblmkpq4uVczKpKfA70HazIk+lNaMyud416sUHppph6XcZd4o5F7R4 fFXHPOQo2HREx5x7VAwnl2sIblBcyTLNAxy4Y7XymBIaqzlXi1KE6DckQ1w/+DSzO0AzqYCDp0t 1YO0yQBuoA2Ej2YatTlWExO7xVRwRjaGpRXTy2xVashi4O0dBQwxdf8IU0pTzckT0g1yd/sLtWV iQQL4mnzVwJgER92p0duoRiU7Y2xazE5obwynwl0RADgQDlHw+rZD0= X-Google-Smtp-Source: AGHT+IFDBYQ0p8AMJvWcntf+/F6gf5Yuv4QaJlDohlcfyApXLCO7EQn6BfhYVR4vXEVLllhC1tMn/Q== X-Received: by 2002:a05:6000:2d84:b0:382:5206:8b84 with SMTP id ffacd0b85a97d-385c6ebd177mr4215378f8f.14.1732790613468; Thu, 28 Nov 2024 02:43:33 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 20/25] target/sparc: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:05 +0000 Message-Id: <20241128104310.3452934-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42a.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790980821019100 Content-Type: text/plain; charset="utf-8" Set the Float3NaNPropRule explicitly for SPARC, and remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/sparc/cpu.c | 2 ++ fpu/softfloat-specialize.c.inc | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 61f2d3fbf23..0f2997a85e6 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -814,6 +814,8 @@ static void sparc_cpu_realizefn(DeviceState *dev, Error= **errp) * the CPU state struct so it won't get zeroed on reset. */ set_float_2nan_prop_rule(float_2nan_prop_s_ba, &env->fp_status); + /* For fused-multiply add, prefer SNaN over QNaN, then C->B->A */ + set_float_3nan_prop_rule(float_3nan_prop_s_cba, &env->fp_status); /* For inf * 0 + NaN, return the input NaN */ set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status= ); =20 diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 31b23ddb9bb..565790b1834 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -508,8 +508,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b= _cls, FloatClass c_cls, } else { rule =3D float_3nan_prop_s_cab; } -#elif defined(TARGET_SPARC) - rule =3D float_3nan_prop_s_cba; #elif defined(TARGET_XTENSA) if (status->use_first_nan) { rule =3D float_3nan_prop_abc; --=20 2.34.1 From nobody Thu Dec 26 10:34:24 2024 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=1732790723; cv=none; d=zohomail.com; s=zohoarc; b=FqpRhFGMKUG1bxQYrZqK/JeTB0FPdY4AXKE+K6xMaphIolLQQgDmThmae23dKbEyICFShz+CsDvipmrSs1RUBATTZ9otDpXTRR4PqHBlCH0wqiynjnikLzcSVDNP97G86FORuxY5M3GmVvzOx8j//oQdlZ2xb6yCYxhBT5kBwYg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790723; h=Content-Transfer-Encoding:Cc:Cc: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; bh=2TrVJRkkr5D+N0aBUkmYJt1MSRdpl5FRuyVmIZ66utw=; b=LtNx9q8+cwj5yiNQMUK/lf3n5CjBRbp2f3oFteDDwr50hQvw4G79ZFjUbN/xMJ7VSWpkxI9Kmx3uBdfKa5rCSR8wopBcJrjB6Hq08v5m99ptyvN1wzWfvBwxeoqovNskjUpdIJx4cKknHpYGNXtIzAv9RWrU4l3EanDU1gAt0CE= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790723387634.4621000217234; Thu, 28 Nov 2024 02:45:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc1D-00048t-VE; Thu, 28 Nov 2024 05:45:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGc01-0002Ev-Ut for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:44:00 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzu-0000i1-Ma for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:50 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-382423f4082so508488f8f.3 for ; Thu, 28 Nov 2024 02:43:35 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790614; x=1733395414; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2TrVJRkkr5D+N0aBUkmYJt1MSRdpl5FRuyVmIZ66utw=; b=aFqv7/QcygN3bY0RWqQhVGeEi48O/RVQkVp5yNM03o9nBoVaKyBOaxDk/0eymw7ZVU eegs/6tDlwYnfHnImjtmpuJ1Si91JSUp8xfeUMowqqVaL1hy25X9hcb4Pe6ZTxFP684N dJE//60qw95ncsMRiTuGRFzCZTMkfRjj83BH7whILqHbBXuqk9ZaziNoynv9o5gYy92g 2izRLjjuwajKTO49mJjATDg/CPf4/lno+wLz7W5w+I6yJ5YSwZ63IVUcbopfZ2SgoM+C PF8d44IoEBgrJKwzFYLq6O0YDa94Xy83To/4LnJa/a6RFxSpQgKpbFedyTgMnaTJ8jzG 1URQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790614; x=1733395414; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2TrVJRkkr5D+N0aBUkmYJt1MSRdpl5FRuyVmIZ66utw=; b=C2Tp6XTzznAwyl9nuhzU48h9EkSApbQkdZJSGJIJ05rgT1vYZph9EYUwRJgb4j6gpi 4thfGE2RPG9lDpFublRO/S0q6Y8QBsLgnTnGHDOU+qUZRbkOjECd0CJ9wgAXj2bA8FfT XnjQxK9M2QlOoDaxtvHOL8285UfJgBpM+qaByI9qpSJEz/Vqij0xq47LvV+4qjlta6yC cG1X+b1C5+aiCBnYtP4uqI7IZD10y4f3BRWSeIlYO/8zC3isN8XKk4TGWCjy7GHQSAuj icEfZLRN6Dh+CN2+pimQEWxpzIt0Fft+0fsvGCKG0aUSEeXD08vGMxLVfmBSxt9CeYiI vFHw== X-Gm-Message-State: AOJu0YzCUMHWT9eIk4qIRn+GSy/kYiBLBfkC3mRtMPPJOgN3ffEvz6Ij jWrGqKaRacrsgXzKH2czJx2ZETvSQ+rCyhTEin/X6fQPQqsuvbT1hK9Ypf7281W2mvm4moIV/v6 a X-Gm-Gg: ASbGncvNlvzjJrHNr5fizOywtD3MUhtIChz/Dk0aMV7CiSQmAMEpdR1bmAJ9hX4aFZN Q8678UiBOtREEAFXwBDwnPlxnPOtkuwMph6zF2lNumuU5LRVB22G3g/GJgWCohyjAuj0BS7ntF9 ue0qSKPB5PaOTiXr/e22UH0MDw+tg+WKKOYN7dvhDhgggUd018QwBHLdnZ6x8QSknAIJZapCcU7 3FKyMnf3fMUrMz4ksD5V03gE3geRRO819ou3Inywubgv4KO1AHU8sI= X-Google-Smtp-Source: AGHT+IEbfVCLYtPqt/qOPnH2qT981nHuA4VnsdG2pgMYEFf5EZYOEna96GoFM7XW2C+4P/qqEtZwEA== X-Received: by 2002:a5d:47cb:0:b0:382:22c6:7bcb with SMTP id ffacd0b85a97d-385c6eb4c32mr6479070f8f.3.1732790614335; Thu, 28 Nov 2024 02:43:34 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 21/25] target/mips: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:06 +0000 Message-Id: <20241128104310.3452934-22-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790723669019100 Content-Type: text/plain; charset="utf-8" Set the Float3NaNPropRule explicitly for Arm, and remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/mips/fpu_helper.h | 4 ++++ target/mips/msa.c | 3 +++ fpu/softfloat-specialize.c.inc | 8 +------- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/target/mips/fpu_helper.h b/target/mips/fpu_helper.h index be66f2f813a..8ca0ca7ea39 100644 --- a/target/mips/fpu_helper.h +++ b/target/mips/fpu_helper.h @@ -29,6 +29,7 @@ static inline void restore_snan_bit_mode(CPUMIPSState *en= v) { bool nan2008 =3D env->active_fpu.fcr31 & (1 << FCR31_NAN2008); FloatInfZeroNaNRule izn_rule; + Float3NaNPropRule nan3_rule; =20 /* * With nan2008, SNaNs are silenced in the usual way. @@ -44,6 +45,9 @@ static inline void restore_snan_bit_mode(CPUMIPSState *en= v) */ izn_rule =3D nan2008 ? float_infzeronan_dnan_never : float_infzeronan_= dnan_always; set_float_infzeronan_rule(izn_rule, &env->active_fpu.fp_status); + nan3_rule =3D nan2008 ? float_3nan_prop_s_cab : float_3nan_prop_s_abc; + set_float_3nan_prop_rule(nan3_rule, &env->active_fpu.fp_status); + } =20 static inline void restore_fp_status(CPUMIPSState *env) diff --git a/target/mips/msa.c b/target/mips/msa.c index cc152db27f9..93a9a87d76d 100644 --- a/target/mips/msa.c +++ b/target/mips/msa.c @@ -66,6 +66,9 @@ void msa_reset(CPUMIPSState *env) set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->active_tc.msa_fp_status); =20 + set_float_3nan_prop_rule(float_3nan_prop_s_cab, + &env->active_tc.msa_fp_status); + /* clear float_status exception flags */ set_float_exception_flags(0, &env->active_tc.msa_fp_status); =20 diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 565790b1834..2d029de7baa 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -502,13 +502,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, } =20 if (rule =3D=3D float_3nan_prop_none) { -#if defined(TARGET_MIPS) - if (snan_bit_is_one(status)) { - rule =3D float_3nan_prop_s_abc; - } else { - rule =3D float_3nan_prop_s_cab; - } -#elif defined(TARGET_XTENSA) +#if defined(TARGET_XTENSA) if (status->use_first_nan) { rule =3D float_3nan_prop_abc; } else { --=20 2.34.1 From nobody Thu Dec 26 10:34:24 2024 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=1732790863; cv=none; d=zohomail.com; s=zohoarc; b=SIdC4KGo/vsQSOEfEesZ0787+1SkaX2VIFx9xIrYl1183MZaIXOT+btydWk3YwY6O3VtALwvB/QxtI6AFDJRY7vonLSBkhggxIZMNcVys0e+1f46F0LWQ8QdmLFY1dRIzlBB9YNaDn/G+BUvhOcVGdbPaKlmK3VMfeRC27GBDOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790863; h=Content-Transfer-Encoding:Cc:Cc: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; bh=F2oqqTya9ndnAhX2EgcTjocy//tVGNyIvLMPGaZkvBQ=; b=SgdGLgtEihAyDW7OhjCRpKnYarhwsJh2/r0e/68r9QZvfopfJCy9K3dXPcQwiGKUWAttRotU6QDpe+AeMX9M3MvdmBhpDw69lQEJZekof4l3UrHGvWJcOiWhZRVBzUJ9MZ5748pNfm9pRkWHaNFu45jbXQbfi/vK2qd4Ln2t4N0= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173279086309070.52044132618664; Thu, 28 Nov 2024 02:47:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc2J-0005k5-7y; Thu, 28 Nov 2024 05:46:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzv-0002Bv-27 for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:49 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzq-0000kE-3O for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:46 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-37ed3bd6114so459294f8f.2 for ; Thu, 28 Nov 2024 02:43:36 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790615; x=1733395415; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F2oqqTya9ndnAhX2EgcTjocy//tVGNyIvLMPGaZkvBQ=; b=Jvat3IMy63elzVQvxQg3R/uS6uERdC4dz2oCiMLqXnVg4oATbRXxl7+prfry4GJOAs 3rnlCwsJ8Kcc6LD/wGPvE9ucDD4AfZ03YEy3DzFbDmtsiLjYcZFKHbvBCgP6oKl3tBUA anKNTF5UsE24iMmFBBC9mPMUs6Nyaxk4SqnOrrsR91onr6yfVNLoV3Jl4akVLfhNz22S S/hx2hM+PZFfTJdGMyeJD5dHNIkvkrlIZJU5MqYas3/RcAq812vGOPJuFnJRgHIQ9MKV asi7Slw30+NCdUTEd7ZczaW00f+rteMKZHwRYn7ykNxcMO7XoGV5VhZbbPpQQRXrGE2Z ZrjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790615; x=1733395415; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F2oqqTya9ndnAhX2EgcTjocy//tVGNyIvLMPGaZkvBQ=; b=uZ1+hbhxoSqbgqvzg5/6lNFlasebDVi/VVGx8HLuY+E3Mcf23/xHv+fMMK88XD7lFK K1i/Hb9hXLcDzBlUzCnc3FZI1Vck+xZBgcYerl5PgwBXpjGu3eSuWhZm8BdPETvDpOJ0 1/z4DfYoTyJMw/Zzdt2p2EbobDz55yamk9ePxyaCR2YS0QW6PNdXTGmj+MJyHMSVLC5Z BuSLqDCcK5jCHZZzClGDSUlODZBxrAFijuVX6BnW38bECYMhzgd2WncLOT2oQzQXTv+T hrD1KvjHH4n6bw+q2E+SAjeo/jk+cugGs0gVzrtxCHJT9xE9mkj2SNhTyFE4SKELIz6B KmzA== X-Gm-Message-State: AOJu0Yz5F9qobeAEaIv1dRpV+f9feBpuxhppv5PfyVnR2tPJiUAfRH3e m6Tr3R9ow5yRxJS486ADaS7D2F1bLfpMUHId1mBP/DbHFFZQbq8E6qmwU2LbophKFGQtYScSVne e X-Gm-Gg: ASbGncuGF0FnIFaBUuzul4QsG04XZDCeGspm8Mqezt8qbZLrWFtjGXb81bsVLKX+cVv 7eIJGVsLzF9NpeUDRt/gxISn+yIqkG4tzur57sYUUTqWiGHJWtyeBQ3OjLdAzRb7hrW7I1Bq0sV KhyvCmeXKL/AFOf3YGbH2HB3wmZgVQUOdmV4ep0sUvX1lg54ynlI+qcELX9X/TdQw+5Jt4Cr3yn WbuYMTz1mfYCoKIt+zX2IJKSHYDyIRJtHcp8RzMDFWA9Xunh6qzxO4= X-Google-Smtp-Source: AGHT+IEo+dfcu/Vo4YpEDMGS2gBKZqqG6BX3v7Ouawokf1TkgNmuIfcGW6fjcLGWf4H3GpgGyJk+WQ== X-Received: by 2002:a05:6000:4708:b0:37d:4fe9:b6a4 with SMTP id ffacd0b85a97d-385c6edc3f2mr5257871f8f.50.1732790615204; Thu, 28 Nov 2024 02:43:35 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 22/25] target/xtensa: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:07 +0000 Message-Id: <20241128104310.3452934-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.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: 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: 1732790864468019100 Content-Type: text/plain; charset="utf-8" Set the Float3NaNPropRule explicitly for xtensa, and remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/xtensa/fpu_helper.c | 2 ++ fpu/softfloat-specialize.c.inc | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/target/xtensa/fpu_helper.c b/target/xtensa/fpu_helper.c index f2d212d05df..4b1b021d824 100644 --- a/target/xtensa/fpu_helper.c +++ b/target/xtensa/fpu_helper.c @@ -62,6 +62,8 @@ void xtensa_use_first_nan(CPUXtensaState *env, bool use_f= irst) set_use_first_nan(use_first, &env->fp_status); set_float_2nan_prop_rule(use_first ? float_2nan_prop_ab : float_2nan_p= rop_ba, &env->fp_status); + set_float_3nan_prop_rule(use_first ? float_3nan_prop_abc : float_3nan_= prop_cba, + &env->fp_status); } =20 void HELPER(wur_fpu2k_fcr)(CPUXtensaState *env, uint32_t v) diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 2d029de7baa..60de68012e1 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -502,15 +502,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, } =20 if (rule =3D=3D float_3nan_prop_none) { -#if defined(TARGET_XTENSA) - if (status->use_first_nan) { - rule =3D float_3nan_prop_abc; - } else { - rule =3D float_3nan_prop_cba; - } -#else rule =3D float_3nan_prop_abc; -#endif } =20 switch (rule) { --=20 2.34.1 From nobody Thu Dec 26 10:34:24 2024 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=1732790969; cv=none; d=zohomail.com; s=zohoarc; b=cjCli/yQFdZeLrEqjFx3c1mjGp0iyaTD3/pGRA8wSIu+azrvlXfVLp168eLha6qhZZlEJK0tfKgs7dzRmPknHmWRjF8UU/Ssoq7oObta4oAeTh97WmJpwlvkhZ8tKLs7LEaDogde7Niv07ENv5j8Hl65XBt/fUQpetcmVCawC5E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790969; h=Content-Transfer-Encoding:Cc:Cc: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; bh=eT1LXyat6VBXQfbf2ZEeygMBWdK2hSiibfIDvIYaJow=; b=YjmE1HQTKFTRUscbji/ADmq0VXpk6GeuobIqEoEVZHtniNzzZeIfFU+o3qJAt5oJVxRkHsMNBbRdyR4JHc9xnuX5NTqO3is5oIH3yo9qG8d6LNG0TYiQM+DpZr5RtsoUf560XxS5GYnW/xpKIE1TSAssDFcS+NLK0Dyv8jV2rTY= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790969375623.8029740169657; Thu, 28 Nov 2024 02:49:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc1F-0004Gs-QJ; Thu, 28 Nov 2024 05:45:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGbzy-0002Dh-0f for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:53 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzt-0000kp-TF for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:49 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-37ed3bd6114so459307f8f.2 for ; Thu, 28 Nov 2024 02:43:37 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790616; x=1733395416; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eT1LXyat6VBXQfbf2ZEeygMBWdK2hSiibfIDvIYaJow=; b=RFOheQh3IPIf1l6+sAnVIhgWWt5ytJNUcTsEATaRCV2gcMr/Xf7bDCujQ3kUOEfgp+ gnCf5lVjy0JNsaXlau0vtW1lXQ6FqtYhs4e0XDg8HJGet6BUu+VJfXAx7MI9s2NIZOpb ewy3bAR6VtZ5DLoxHprhxz+9mliIcQEbXO/LS8FA9dFCJWTQZjs01PbIT7dJx/ALi1oh G8UWo5bAf+ZF3pKLrAyiZGESnxrV5sxU8NRZnRM11BAptIWjKRtgtbgoRsOD98C3HpNz L08h/Bitzh8r97w/7ETEa38D/vN3KyiWoOMUPmZjvX4SoM5tkF2I065rQkoxg5S6ErsA I2Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790616; x=1733395416; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eT1LXyat6VBXQfbf2ZEeygMBWdK2hSiibfIDvIYaJow=; b=Qzs0cNDqTme89muuBIFPwtrTZshVkLe0WXd4Kz659GeTWnmqA1lPOPOuuxgHTp/uzl joIAoxptWgwtZ22XKzJ9fcULLLpNaOZAUiSFVrgP8vMp7UaOksebuINv2COOAIWl8don G9szCeoIDBrdA95PotS+w9qOl5up4rugwxeJf0Z4n1AXTBX3qlSMlqyn/DeDHoojnM1a V+KiWS9XdiANhX74ksMykszLr2fls6plvBWTPTpDlusTlbM22KKKMW80Y4EFTHVTeOZ3 5geySrbs24t3eerfjVsVmbmDfyiPBHY23AYRjKWtG5oQduDZ/QLIQArE3L/fXwj3ZoaW osZg== X-Gm-Message-State: AOJu0Yz5jGQOze1BCrKy5jjRrroI+m4PoNrb7C4pw11zL2sb6hERCBlT Eso+vUWxvxAbWgUOpXD2zqKnRUR4SKJTjLb2KPCd+s2Ts3nhsVBn5MP+HHR1HflCKkQvel75yf2 m X-Gm-Gg: ASbGncv6sbHSgkCH2EY19puLk2VFn10qLpkMZdoVUQDwhXcu/mVu1pArYzWEP2QuzlZ vh4DBQJKGikRbtRWjyHl052KjcpPEmeTMcpgV5FWCsNbjewPphyrC7kVnF5GwZaFMXgvtVDBBPm pTpVQoqUYy/xuYP+OHYiKoYPLkTxUt/Qn2P+mKvy6+HxkYqFy6WIf/oeVkBCJSqsxWhs9bKORVU +dIlJv8ihYwhIQthuvUs36xjyA4ADAdjda7o7XIeel5F6H9q3RZ7Xw= X-Google-Smtp-Source: AGHT+IFoK756JycdHDegIr7eJmXs59U3bbQb3x/KF12D+QOk4s7BgtVPWqKjS3obexchOJx8/9gF/A== X-Received: by 2002:a05:6000:18a7:b0:382:4dad:3887 with SMTP id ffacd0b85a97d-385c6cca8eamr6108106f8f.3.1732790616027; Thu, 28 Nov 2024 02:43:36 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 23/25] target/i386: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:08 +0000 Message-Id: <20241128104310.3452934-24-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x434.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: 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: 1732790970776019100 Content-Type: text/plain; charset="utf-8" Set the Float3NaNPropRule explicitly for i386. We had no i386-specific behaviour in the old ifdef ladder, so we were using the default "prefer a then b then c" fallback. This is very likely wrong for i386, but in this refactoring we don't want to make a behaviour change, so we leave a TODO note. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index e9de084a96d..b62719dead1 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -180,6 +180,8 @@ void cpu_init_fp_statuses(CPUX86State *env) * against the manual. */ set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->sse_statu= s); + /* Similarly the NaN propagation rule is likely wrong. */ + set_float_3nan_prop_rule(float_3nan_prop_abc, &env->sse_status); } =20 static inline uint8_t save_exception_flags(CPUX86State *env) --=20 2.34.1 From nobody Thu Dec 26 10:34:24 2024 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=1732791046; cv=none; d=zohomail.com; s=zohoarc; b=W9A6URXyYaC/skf8a6CGlvCjLUfZL1/R9bBuqpttrCM2hrrx5/YsZ543Xp/HFIgL6o52tbiRgzQrGicvyOwoRHH5yOwd/btCyRcEJFTyr4UN12F+G/+wUayw+Kt9NxJeed+sh3yrwm3VdENwwzwmnbqiTRCSojvw6fy6vgsDT0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732791046; h=Content-Transfer-Encoding:Cc:Cc: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; bh=SDBKL9MPqps6ny2XrO2kAvFlwZGolk654R0X02D8xvM=; b=B5N7IiVDwtYtmw8QoXp6n/GNZ4xXFv6RCEsyOF7LmQw081RRmgExIkMnRXGQ0T7xvD21VRbSz23Tk3QdKtCZQmxkSV18m1ULE9GL8sAoh/Iovacdte1xGfZNXvtX5fJKPhN+jh/CjhWutWUhx8VOoDH+uYXlyGuwIADDhggJjaM= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732791046934539.9976890901032; Thu, 28 Nov 2024 02:50:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc3C-0008St-2w; Thu, 28 Nov 2024 05:47:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGc01-0002Et-T0 for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:58 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzu-0000lA-N8 for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:50 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-434aabd688fso3813885e9.3 for ; Thu, 28 Nov 2024 02:43:37 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790617; x=1733395417; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SDBKL9MPqps6ny2XrO2kAvFlwZGolk654R0X02D8xvM=; b=Z8w6dXZekoU8/3XVSkKAY2rgGwM9fT7DgfoMzZDQ7l21xreEGz2OH1HGoQiC3sjhBf RhQ5Yb8XnB7g+KsM1BHX0g2p003M5NhQA4Cr3V9RcCzMa0NeFdxR6pg90wIvB+vEOxfp 1BQH/LRZ3UXAqlURzjZTy8fuT9cOsxHqr0/OKY61n8hFBCkX+VN+7Yk5Ydgi4746KpQF jbGWN2awCtydFV50BYEfULtvXsdhvtMj/mu3gpPYB1+++DG5Qcr0QJQW1KluSC3bSde8 +yYkGF6o3tzEVvejPJCJlConeJFJwdqT8QgtSeo9e6UbWfEXFrqrzeD98TbtiMTNd+Xz gvKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790617; x=1733395417; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SDBKL9MPqps6ny2XrO2kAvFlwZGolk654R0X02D8xvM=; b=Q0Yt5X9Epc/Hp+Ual6iblgQv4mNzT2LPCeDBA5H1dvBr+ody1QUciJvRIhQy0qwlDf 98oNzzAo57mECRfB63bmjN6VANNyp4z0ntGZXQUGkT17Cz6k+KP3aiLgKMBPHin+zhJt 2gIFqn9DspLZdbT42DD1ezKvoySJFjm6ZQFlgeFexRBatE2wDr/5I61ERZIk6hnJ8hEV SWr9YcKJAd+u62egx+B10kBl7XdAIL3TzvSAddJZI4wHvif0qru8N5HUNjpaVwQPlY53 D48W0Fx7ZQlu06CijJtuV7n5P6FClsnWqRLgBCRTEKPKCBAHvLIb0300uDILRVK4Xpvr W3NQ== X-Gm-Message-State: AOJu0YyQ8aMIWdQF7slzMAGfY8B93CwD6w9zdLtm2GIrwC/4ZXpb5JCA 8H6xdEZz1a1fNKovcFG8AfOfNm9Z6cJpp9LBxbVZ4mLSJCliZXWnyYx2I0ZZgeyA3VpNEDbKy+c e X-Gm-Gg: ASbGncvuupZhk+mI59OU4ED58BH5dfu6ogLzIN5lKzkuE9kE9rfR8TD9sXzCRElkv6W hfhOWrniEGpCA0XhCMtbUqTzV30/aMp+Ajk6g/ssgzY9HhLGIDdJFOaithgzsxDtAxmgIUyqzdG 005XdCR5Eu46cE9wdupFU8sYpDdCokUoM/0R3TOgM46CiNxY9IQh4jMzHSapE4uC4PKpDWTHbiy HnLv73srX1+/IjQZ1eq5l4t35h7u+VkzJTrDa+Num1Y1anyqGWeGrY= X-Google-Smtp-Source: AGHT+IFPUDNHsVTbne3PyCSxDI1YCIQ5wGD0dfm48aH21lq3U8smxfK2qRR3l6+GuMUuCsLhh7mANA== X-Received: by 2002:a05:6000:1545:b0:382:450c:2601 with SMTP id ffacd0b85a97d-385c6ebba39mr5425612f8f.24.1732790616845; Thu, 28 Nov 2024 02:43:36 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 24/25] target/hppa: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:09 +0000 Message-Id: <20241128104310.3452934-25-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732791049154019100 Content-Type: text/plain; charset="utf-8" Set the Float3NaNPropRule explicitly for HPPA, and remove the ifdef from pickNaNMulAdd(). HPPA is the only target that was using the default branch of the ifdef ladder (other targets either do not use muladd or set default_nan_mode), so we can remove the ifdef fallback entirely now (allowing the "rule not set" case to fall into the default of the switch statement and assert). We add a TODO note that the HPPA rule is probably wrong; this is not a behavioural change for this refactoring. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/hppa/fpu_helper.c | 8 ++++++++ fpu/softfloat-specialize.c.inc | 7 +------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/target/hppa/fpu_helper.c b/target/hppa/fpu_helper.c index 393cae33bf9..69c4ce37835 100644 --- a/target/hppa/fpu_helper.c +++ b/target/hppa/fpu_helper.c @@ -55,6 +55,14 @@ void HELPER(loaded_fr0)(CPUHPPAState *env) * HPPA does note implement a CPU reset method at all... */ set_float_2nan_prop_rule(float_2nan_prop_s_ab, &env->fp_status); + /* + * TODO: The HPPA architecture reference only documents its NaN + * propagation rule for 2-operand operations. Testing on real hardware + * might be necessary to confirm whether this order for muladd is corr= ect. + * Not preferring the SNaN is almost certainly incorrect as it diverges + * from the documented rules for 2-operand operations. + */ + set_float_3nan_prop_rule(float_3nan_prop_abc, &env->fp_status); /* For inf * 0 + NaN, return the input NaN */ set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status= ); } diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 60de68012e1..353b524d2de 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -475,7 +475,6 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls, static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_= cls, bool infzero, float_status *status) { - Float3NaNPropRule rule =3D status->float_3nan_prop_rule; /* * We guarantee not to require the target to tell us how to * pick a NaN if we're always returning the default NaN. @@ -501,11 +500,7 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass = b_cls, FloatClass c_cls, } } =20 - if (rule =3D=3D float_3nan_prop_none) { - rule =3D float_3nan_prop_abc; - } - - switch (rule) { + switch (status->float_3nan_prop_rule) { case float_3nan_prop_s_abc: if (is_snan(a_cls)) { return 0; --=20 2.34.1 From nobody Thu Dec 26 10:34:24 2024 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=1732790967; cv=none; d=zohomail.com; s=zohoarc; b=CJv23zGpUO5OUXjqmzfRB9qwUw3nA0+Xinv2T/ubDQT6iV5jr+rMXeXrIPdNDjSRMExZDuFhjHXG2Xxn5uF7x9yvd0ELew73ZKtB16fjrPeg/eBuMYhLbG9O4hboe0KWw4DmTF/34vEdtWseJrzwz8a6WBMRUlrYiE2BinByJqY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732790967; h=Content-Transfer-Encoding:Cc:Cc: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; bh=Zfa3WE0hEeXkZktlw3Eszp/UyNtqhw8PzXG1xyTaEO4=; b=Gdgbmp7Dvrudi18MttSGT23gkLMY1IlEznLxHTYllzRsZFCcaj7S8XZblWzXpCi7k4F/D34EdDVvab0LDnfshBkOb0iR6IwQM+nmUW4ykNg8VOCY7xml5+X1bwMf0zToXjxZcM3OPOECU5hPZB0eNfhYqlblrlThwrM/IBfuoeE= 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 lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732790967316270.28444029221885; Thu, 28 Nov 2024 02:49:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGc32-0007kO-If; Thu, 28 Nov 2024 05:47:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tGc01-0002Ew-VI for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:58 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzu-0000lO-PR for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:50 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-434a0fd9778so6064475e9.0 for ; Thu, 28 Nov 2024 02:43:38 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790618; x=1733395418; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Zfa3WE0hEeXkZktlw3Eszp/UyNtqhw8PzXG1xyTaEO4=; b=oqntGWrbUm9WHtxzp+8LOwkGNa8RbeB98PixlPUozsUYFkWWzsK9LxLa43gA2gSVAQ sLG0RzcJS1wvMAvxP4eoXG5N3S+NAdCzspAXLfpKey4h9/y9/lUnzM7hPsO+RloAA3pt EI+UgHRJKpEYvUhnR+J3JzlCXSW4MM4Cm6KmO71jtmw1tCYnmUqi+raWIP13lyYITkoH sGoysmz7irkDEMmYx/J8/DPn0XEEEfpBQTQHgvzDHu8UIuQ3AUaEMYuCsHBXulaLvggP mNNYWQUuEI8MAiQ5e4Ok6mnAAnnWKV7Jo0cDuNw6sXIyNPU4GLBeOjtyArbuoGMQiD0M koRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790618; x=1733395418; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zfa3WE0hEeXkZktlw3Eszp/UyNtqhw8PzXG1xyTaEO4=; b=hdK+LMmED2UKNAGdKolRn5LucaXZMALjBSswL1ViYE949l680aLVHcfcgD7Yqy4lT+ L6LY5jwA33Kik1dPfm4k/Z0gpY0omd3K2ztoPSNs2WVtKgDPKDWrDT0MgbqvNY4RYtGO Nh27zIcENkG5EClaeOzbYk6EWileACW49/obwX7j88ZTSkluty9epjRxy13BVB5rUrga FGXKyFKZZ0Cwo6oTEtibMuDvTC019TAxw7xzZ5w4XX2ZAJk7WntoHccpexpqmC4XCY7X ZJblhHw/qhV+PfocX1thNOkLu0EwG3W/LLI4KU8GhM3zFsCW6mkmaebfsit0W1eIYqs1 AnaA== X-Gm-Message-State: AOJu0Yw6eZVUB2vwiGsSV21NlxJhamzUfWjVHbMq+kTud8ixhdywXxEl onCwlR/teLunhvKlbCFjmxeRzAh9OD9NwECB8WxWmLefpLrCbn9Mogksxh8Uee4XiBSLq3r4QR2 I X-Gm-Gg: ASbGncuyoJXHZPbQArl1EbQDCF7Wjcus3cwRP02BkyP7563OQ6TRdtpx5fzKtHH3b9A B2Lx0iNvTrVSDsX2iaEkUhMpF4Qmi+6ixajmmNRChxKNK2CVWtztMLVg/PHrZdLEiUC/J6KkEVz iCu0fobNbR8wTILN3h+f9gDJgHqPUeq13skkepKS82s9E/T8ygepWJG5m5uq8zQFvXSr9aQFhwT mKj7AFYIfERNjXaQQ+gPHxesnel8cJ863QanUo7eyE90jz6q2vkYzc= X-Google-Smtp-Source: AGHT+IEkBsbVJvsOrZdU/bWIWX4Mwf9E2dHz/HQ9DDr+QVOG3OEjoakFnX8ebUp0N0dtsxDmzVj6gw== X-Received: by 2002:a05:600c:1e2a:b0:434:a8ef:442f with SMTP id 5b1f17b1804b1-434a9e0b47amr51873015e9.32.1732790617727; Thu, 28 Nov 2024 02:43:37 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 25/25] fpu: Remove use_first_nan field from float_status Date: Thu, 28 Nov 2024 10:43:10 +0000 Message-Id: <20241128104310.3452934-26-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@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=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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: 1732790968919019100 Content-Type: text/plain; charset="utf-8" The use_first_nan field in float_status was an xtensa-specific way to select at runtime from two different NaN propagation rules. Now that xtensa is using the target-agnostic NaN propagation rule selection that we've just added, we can remove use_first_nan, because there is no longer any code that reads it. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- include/fpu/softfloat-helpers.h | 5 ----- include/fpu/softfloat-types.h | 1 - target/xtensa/fpu_helper.c | 1 - 3 files changed, 7 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helper= s.h index cf06b4e16bf..10a6763532c 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -113,11 +113,6 @@ static inline void set_snan_bit_is_one(bool val, float= _status *status) status->snan_bit_is_one =3D val; } =20 -static inline void set_use_first_nan(bool val, float_status *status) -{ - status->use_first_nan =3D val; -} - static inline void set_no_signaling_nans(bool val, float_status *status) { status->no_signaling_nans =3D val; diff --git a/include/fpu/softfloat-types.h b/include/fpu/softfloat-types.h index 79220f8c67f..e2db92c72fa 100644 --- a/include/fpu/softfloat-types.h +++ b/include/fpu/softfloat-types.h @@ -291,7 +291,6 @@ typedef struct float_status { * softfloat-specialize.inc.c) */ bool snan_bit_is_one; - bool use_first_nan; bool no_signaling_nans; /* should overflowed results subtract re_bias to its exponent? */ bool rebias_overflow; diff --git a/target/xtensa/fpu_helper.c b/target/xtensa/fpu_helper.c index 4b1b021d824..53fc7cfd2af 100644 --- a/target/xtensa/fpu_helper.c +++ b/target/xtensa/fpu_helper.c @@ -59,7 +59,6 @@ static const struct { =20 void xtensa_use_first_nan(CPUXtensaState *env, bool use_first) { - set_use_first_nan(use_first, &env->fp_status); set_float_2nan_prop_rule(use_first ? float_2nan_prop_ab : float_2nan_p= rop_ba, &env->fp_status); set_float_3nan_prop_rule(use_first ? float_3nan_prop_abc : float_3nan_= prop_cba, --=20 2.34.1