From patchwork Tue Nov 5 11:19:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 840771 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp285542wry; Tue, 5 Nov 2024 03:21:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV9ZLYx4YgSI5yPcwxEZ+EZThxw/BXZi86wIz5709wrPWuOkYivafGKhCoEM51goynuTIUcAA==@linaro.org X-Google-Smtp-Source: AGHT+IH9uHx9OyDTAxO9A+DRrIIDp0IGmNVeK3v+OzR7utHoCy9Fn6N8xpM1naMDp9iy/QAi7+AY X-Received: by 2002:ac8:5d47:0:b0:460:ab1b:a16d with SMTP id d75a77b69052e-461717000bbmr384396851cf.27.1730805704562; Tue, 05 Nov 2024 03:21:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730805704; cv=none; d=google.com; s=arc-20240605; b=K6BetHvMhdsY8U+gxBUMvGw7RxXq0cepRwBjjPDipuxlrIKv7muvj86MhpoajtvyJ7 6CvycCfZW4Fw9AA8pyrqlmXBxy7D6NgAlKIVZiUnNAUi64bF5tqiVSKgjjP8FBFX09yD 0AyRZODvrgWe7EXiYit/uZaJVMGEtqa9XH5QNQhwEyUKOUSKXxbeRJTPjwK53/eolQQM NFgIUTwrdnIUjecFkoIHpvwm16wxHFkzIXjwrLgSMmYooRxY9IOTI799v2BoU9XCe8Ez ihwUNQp7PNOqb7W6yGOHK51iACnukSQrnaHfxEFf7ELEvpMRrlKE/qSIkegrIpc1vtrk OWlw== 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:to:from :dkim-signature; bh=gAa7nG8JV8MJXxE6NvLX8mZwE6oSHiLMecKFbVo5vN8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=kXJBWpROQJAPd1v/bfEb7wjjoBFBf1ugz1inflqqvX1ucRzFRzgwjz7q0ekecjQ37v ltGwwHwypG2brP3XvMfXbwRgQl1ddcQjs96z2FkdLv+7kHgsNN83yBTusNBo36dITF21 wG8T4e7Y+N4E7ip5aysEl+XdiM1b+uYy4f+OVm8wlBccrveFxiExr9LutSpenZchx3Ck b84jpq1dKfeCY1jokbfjT8Y2CPluRCSoZSAk9YSKTlSEqZkVbNYzOC56N+YUwVj3Gyak 4PA0BTUo9sP9ISw3tjfElucFEb3TinBQscIwL69CFdX57XBHSA4WMMItx/A58s99VEpW sy/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mDfpy8dq; 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-462ad0b4705si130511621cf.22.2024.11.05.03.21.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 03:21:44 -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=mDfpy8dq; 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 1t8HbK-0004Va-4N; Tue, 05 Nov 2024 06:19:58 -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 1t8HbH-0004UA-Dj for qemu-devel@nongnu.org; Tue, 05 Nov 2024 06:19:55 -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 1t8Hb7-00075V-1o for qemu-devel@nongnu.org; Tue, 05 Nov 2024 06:19:55 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43167ff0f91so47252225e9.1 for ; Tue, 05 Nov 2024 03:19:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730805582; x=1731410382; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=gAa7nG8JV8MJXxE6NvLX8mZwE6oSHiLMecKFbVo5vN8=; b=mDfpy8dqOX5pF47aDLTTstM4YdSQ3aNKJ0V1Ybe8oZ7yciAW7eC9KkCiWTDJZ20h6o mmZ/q5lGkiwkXIn+keq/0lZcbt1FKYTPADdJP5cjG5n5VkC/ow7brjRZJ6gUe5CziZ1B /5zjtWdmHJodEAVCx5LNv341pq0jWBG+gaU2MZU4JEN5Ur9mm+RyHzVSUIhBj+haEHnX 42myPRqBOKv4gOgGkf63BWdhWy5OP5px9D77OkcHuQD8Dn1pzZtNmLJTwfoApU6Sp9BX VHn9asWPBN/LVYheZabpQ5hemKeRJpJaMQYh1VIO6NBF00Ii/8oJYW7fTeWnx5NAPSoq 0i8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730805582; x=1731410382; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gAa7nG8JV8MJXxE6NvLX8mZwE6oSHiLMecKFbVo5vN8=; b=P2b60Xd7GzI/E3S2M4v4JGgLmA8SUgEh+yfjZDugOSGJqYDzH+owwAIXzWJlbhRwrP MvSc5g7LDQFynY3ZLKEcfdHuQ51CWEt1GzecEANBOgluQDJc5RX2hl1m6luSZPqy6gVt FNw3/VsdFhI/mQah0rubafSS/bBjCYss8VB+4Yfg2R3SAGJ8rgLuN/6I/2Sx+J/wZMov HF1dfts1KZRobMeTR35QRYkNDJacuNEwatAZIvF61PyFD+/4fRldwgrEhWmz0C8Nd/Fj jvZqhrf1/im90MqtbOeaSyto6Kjq5POU0MxnRjCvsbUSApgPIodA0MWIgex7nTbbHS1r j8tQ== X-Gm-Message-State: AOJu0YwkiqxMjJtNsM7hP2jkTmVIEmBJnlYe5XQPA1vt+jXuOBvnz7F/ DggOQuo0T63XhQ8mds/Io7R979YB8onDzhzEvSbVCOi67od5lvM2IBkTbbrm7PgYdxhE1yxAAxL v X-Received: by 2002:a05:600c:190f:b0:431:6153:a246 with SMTP id 5b1f17b1804b1-4327b6fd999mr166925635e9.13.1730805582193; Tue, 05 Nov 2024 03:19:42 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432a3688813sm16354555e9.1.2024.11.05.03.19.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 03:19:41 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 08/31] target/ppc: Explicitly set 2-NaN propagation rule Date: Tue, 5 Nov 2024 11:19:12 +0000 Message-Id: <20241105111935.2747034-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105111935.2747034-1-peter.maydell@linaro.org> References: <20241105111935.2747034-1-peter.maydell@linaro.org> MIME-Version: 1.0 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=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 2-NaN propagation rule explicitly in env->fp_status and env->vec_status. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241025141254.2141506-9-peter.maydell@linaro.org --- target/ppc/cpu_init.c | 8 ++++++++ fpu/softfloat-specialize.c.inc | 10 ++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 23881d09e9f..5c9dcd1f857 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7326,6 +7326,14 @@ static void ppc_cpu_reset_hold(Object *obj, ResetType type) /* tininess for underflow is detected before rounding */ set_float_detect_tininess(float_tininess_before_rounding, &env->fp_status); + /* + * PowerPC propagation rules: + * 1. A if it sNaN or qNaN + * 2. B if it sNaN or qNaN + * A signaling NaN is always silenced before returning it. + */ + 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 (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) { ppc_spr_t *spr = &env->spr_cb[i]; diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index a0c740e544d..8e3124c11a6 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -404,15 +404,9 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls, || defined(TARGET_RISCV) || defined(TARGET_SH4) \ || defined(TARGET_TRICORE) || defined(TARGET_ARM) || defined(TARGET_MIPS) \ || defined(TARGET_LOONGARCH64) || defined(TARGET_HPPA) \ - || defined(TARGET_S390X) + || defined(TARGET_S390X) || defined(TARGET_PPC) g_assert_not_reached(); -#elif defined(TARGET_PPC) || defined(TARGET_M68K) - /* - * PowerPC propagation rules: - * 1. A if it sNaN or qNaN - * 2. B if it sNaN or qNaN - * A signaling NaN is always silenced before returning it. - */ +#elif defined(TARGET_M68K) /* * M68000 FAMILY PROGRAMMER'S REFERENCE MANUAL * 3.4 FLOATING-POINT INSTRUCTION DETAILS