From patchwork Mon Dec 2 13:13:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 846614 Delivered-To: patch@linaro.org Received: by 2002:a5d:4cd0:0:b0:385:e875:8a9e with SMTP id c16csp1205195wrt; Mon, 2 Dec 2024 05:28:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW2BmuMrFY+ltZWr2amG/qes0iX0QwriHNBxCAllgfDcbJXMDDPa/NApWVYWzC45eJ+l9MiwA==@linaro.org X-Google-Smtp-Source: AGHT+IE90yb4B1wJapTlqUhlhdDLg2atJsnn9qEVMu2/f5Yi/lzUZ0il6UuMza+QTrM/DTU6RhGN X-Received: by 2002:ac8:7e86:0:b0:463:59f2:1835 with SMTP id d75a77b69052e-466b366855bmr268760081cf.54.1733146110303; Mon, 02 Dec 2024 05:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733146110; cv=none; d=google.com; s=arc-20240605; b=QVFcmrJShDytz76LINB2cHPyCkFcuz+5P03vPOX0TEJcvBffbty1P2aiQlmKM8k1+2 ZoDC/XJV5WJweARIieIg1ASJgWGko635vpRNZa36aqHcPKu7SeLvVZNt0ETPwyuLm4fc u/aUJFajuCk68JHZKA/NbkOEwcN0kgvK0Ft6urf/Bv2Z67pe+xCHPeWdXERdIzPHTFDK 9aZ/OJs8bR65mWXA86Mn8ghgF4s1Pua+qif6VXX/dq82XTnuCovFkF0EF+YahB/IncKw AUemoY0QG058NzoCVRkE4qETvzDlLSGdf6B9YjzLZs4AZdg50ztAmX6tvYFXMoMm/lSH boig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hfWcIGFElRwNWX99Qr3KLu7RlocWXtaK9gnVDhRhWYA=; fh=QgE9QYJDVj//6C0QJWGeEM+qaFVaxwMel1ZWqkEy6K0=; b=PGl3QuEen76Y+k/Lik/uXnZ881IYzrH5lKlqXC+YaHHSmzD1kroTs4UiOrwRUuv4/V RVg9fur9ZuPCqw+v01BOCi3HX848TatvxOGo2wNYkbwecj0hD7FWu/ruVig5g8M/Y2Vg P+x2S3z8FqGDfawoGyAzgxDJhT5oylmXDq6i8HNI+1yhtI2oPbm1sLHNau0CjyTMgEYY qIUSEF3KN6O3PqXQ6s+jBDp6s1NAL+jzrgHS9VqCyHQ9XRcMN9KHy9tgba8Et02a3q63 JsODMdLxty+JUQM2LawAuXvnGZ2YaEvB4x0SWvzIVnyqztkUT07H5h3FOucgw1TuWvPx E4SA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rYQ36UQv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-466c4258231si116095971cf.603.2024.12.02.05.28.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Dec 2024 05:28:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rYQ36UQv; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tI6Sh-0006eH-7C; Mon, 02 Dec 2024 08:27:40 -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 1tI6GV-0002Ht-5K for qemu-devel@nongnu.org; Mon, 02 Dec 2024 08:15:07 -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 1tI6GL-0003DH-Dy for qemu-devel@nongnu.org; Mon, 02 Dec 2024 08:15:01 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385e27c75f4so1479620f8f.2 for ; Mon, 02 Dec 2024 05:14:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733145251; x=1733750051; 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=hfWcIGFElRwNWX99Qr3KLu7RlocWXtaK9gnVDhRhWYA=; b=rYQ36UQvq20BFoIwyg6hoYkYGV8DeYO09OMqwHm8ugzvZa+nEmEIBID3q/LizzDC/w 4gd/zq2lCO0KOfhCDU0cc0F1GTHbL4kemj877E8buveriIBx6wfyFd+HJrBkIt26KWC9 O4LVUwDblY9DH446hR9UnHbKMmjrFXpX65whF9DimMD5kFErOUjDd/3REnTvrzuyg6i1 M4SJjUWn4IwP44HQ+pTeLtyIvwbKjxSqDD5BCYPipW8L5ldYobnhbQS0+ooEzPK16ZGP eVfksAbkapwhlkIE/wq+pFaQqBWOvb3CMUUcDUES9VumGyuq/3sjCcV3WYU3cZc5ugVX aoNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733145251; x=1733750051; 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=hfWcIGFElRwNWX99Qr3KLu7RlocWXtaK9gnVDhRhWYA=; b=g3wOjQ0a+qPWv6aO35/02+8+TxCQz9nILylKw1PHVZA66/SpfIx42ipBWHM6wDXPMl GLDdWQPWeCW6UJ7gJ6EPuTx145lNeSbbcctx7MuWKaPFlCVH4ezroOnINQ6NMpOPQ0Xy NCBcsgQ5LqbCsnc6XOg78EZhun2menNq0BBBITPi6q/A/uLVO1BJceZZTYxJTx7jif0b 1E5obqZNnH5csrVy68vwvYmnqZ4vGVsuKl6w4akbvLr5ZWO96vksSfegkfOfR6lZ4k1p FgyTsd6rDvvGWeG9rZizNbUjnmkG5dEG+EtzkLYY6pLBgAIul/WBHUoV82Y1+Pzhv60y YfAA== X-Gm-Message-State: AOJu0Yy2KvUJbIyNAK3X9Pj4F0rAkao1kDwjobDmuSK+BnI0KwyGLOES f/lDOXVSIrQ/QRROx3oe1oQrN6P6PU257Jefu5ZXhjvtJhozdPJYEujveSPnE05UfP9dHScsUgV 0 X-Gm-Gg: ASbGncuek4A+gOBgaRBjeRjgUGZ0mjsjiWNKciHgHL1IpH4aG91R597JMX/uKMsOFek gvPNDsCCvDLkY1Nsrxkl5mnMQEV5TTvyr49kYS3ZQ+uTUVjGkLPHcXUZKX+2B1dCgbBjdS5jot5 JVw3ShCx/X40AXxf53ZmISAfBpFKgKCkj4mMfRY3V5nRQInKXZ5NPZcqoVNzvWflMsJovgZjOnN J7mNoVkRR4OJNZpWmTmn/WI1lTbLkpzFCDWzI5MlEIeBJDTm8cywYU= X-Received: by 2002:a5d:6485:0:b0:385:e176:4420 with SMTP id ffacd0b85a97d-385e1764637mr9309692f8f.10.1733145251088; Mon, 02 Dec 2024 05:14:11 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385dea1e4ebsm10160157f8f.1.2024.12.02.05.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 05:14:10 -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_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?utf-8?q?Philippe_Mathieu-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 v2 for-10.0 12/54] target/loongarch: Set FloatInfZeroNaNRule explicitly Date: Mon, 2 Dec 2024 13:13:05 +0000 Message-Id: <20241202131347.498124-13-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241202131347.498124-1-peter.maydell@linaro.org> References: <20241202131347.498124-1-peter.maydell@linaro.org> MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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_helper.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,nan) + * case sets InvalidOp and returns the input value 'c' + */ + set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->fp_status); } 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,zero,nan) - * case sets InvalidOp and returns the input value 'c' - */ +#if defined(TARGET_HPPA) rule = float_infzeronan_dnan_never; #endif }