From patchwork Tue Nov 5 11:19:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 840774 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1ace:b0:37d:45d0:187 with SMTP id i14csp285709wry; Tue, 5 Nov 2024 03:22:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUUHHqcOgG+Ua/Sw+YqFNWLbQlkbSCdiOWWSBJ2KXdrv1dVv+YYv7/UATM2Q7Bfuh3eJao5ew==@linaro.org X-Google-Smtp-Source: AGHT+IFr6qPVbv5yOEMaAZVZsalCQlEZjlrPQlrb0o117oTyO2wzTw84XiX5viK3s+OIgTB8g2Cb X-Received: by 2002:ac8:7fd0:0:b0:460:af80:ceb9 with SMTP id d75a77b69052e-462ab23ec4dmr272303231cf.4.1730805729567; Tue, 05 Nov 2024 03:22:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730805729; cv=none; d=google.com; s=arc-20240605; b=V/zZd8+R6zF8cW9SWyBag0U9SS3al+nUBiNATI3mRyfVLuc0s0zGNgY845cWWJiKLB KPR6juuDk75Mnj1rjiR4M1MgWutG8+Q2RBmRVLuKqt6zqEAKOv/my8K6NcEXmlThMINy Z4lQByPerQO3VKv9yauUtkafKMUhq5aUQuMAP4cJi0iPMvuQJ2BlmvKws+eMkGgKVGrp 6KSKiBe8m6sn1s7EfiQVG5P7FXxI9GBGvvTa582xuahLGbziTUtdqUnZZNQrxlu5Wca4 Sxs3csgV5CacVc5RQ96KRKYw1VTbUVnCENxAcsgUTAtue4u/7cIDTxg5d0xNzjRuvitg KTmw== 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=G3DkeEcruqixMHeVvkc/55DZL7+DSMMcCtNLajeMDec=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=j8u4nmnztQSn0WZ7Zy3z4NoF4B9GcsvigFYVyUushhVbdXgMXxXnTlHf5bJht+XLg0 kgJu02P34naeZolGLInOS3XSJ+rrN+H+aR3dbU09QvMXdQ4kYsB4QA33FA3OBFNFX1Ir GI7J2UfG1vM26JOMTVXXPW4zAAhNNBFQGI6kSbBtW3jZTecDmJnVRuitsI9blktf9Yya aR3IByLpSgBm6XqZhHhikVneg2aoa93VLEpAP/9ACs2AwE6ugPn88VWgro09KxAto3hk jMkl29UKahDRxHq0pismx2C7CYdUmQnvQIg7h1Io8X+hZZtuHrJsHoe+0Ixvhvve1dSz CYiA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cn7tNfaB; 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-462ad241af8si139809781cf.569.2024.11.05.03.22.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 03:22:09 -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=cn7tNfaB; 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 1t8HbH-0004UC-Pj; Tue, 05 Nov 2024 06:19:55 -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 1t8HbG-0004Td-62 for qemu-devel@nongnu.org; Tue, 05 Nov 2024 06:19:54 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8HbA-00076M-A2 for qemu-devel@nongnu.org; Tue, 05 Nov 2024 06:19:53 -0500 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-539fe76e802so6123715e87.1 for ; Tue, 05 Nov 2024 03:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730805585; x=1731410385; 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=G3DkeEcruqixMHeVvkc/55DZL7+DSMMcCtNLajeMDec=; b=cn7tNfaB+GSUNWVy2JFVvlVp3JZRB4Rd/2UKoI4NaFD8yiQSaCwyg5fn6Kszk5kjDX fVuzG52F1qoAMyFwqyZjcsXE+m+3vZEit4gANqCyvjbNkW3y6xv+sEOm+ZeDBy6YbnkA 5gPic+LwL3/0UK9NzeW37uAZRu2pIiEBbpya3Oh4RPLMYDnexpXMVxbw6h6U/qkVAGmA HC5uuAMTcinabL6VKtFMcxA3awXG0SBouZ9EY8MRo5Rw6HYpGP4NGYMEpeXwOtzBcVHN thFPEtEk52DY68Uj9PryIbFxA8ygDxYW9QiW6evZEtsWye6P4QrolEIXu2ayTqrf0YR8 HK+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730805585; x=1731410385; 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=G3DkeEcruqixMHeVvkc/55DZL7+DSMMcCtNLajeMDec=; b=C7vdLfAKSzmlqeiSM4QsL9N4wwC41xGdRSSvRJp4TdS6Hu5msbvVJatU/sXtJUeAQs AAMajbxu5/m72bt7JgaIl+fNipmdYoNKqtfYj8gvPMky4NxnoOWQvEE//7Bl84eWgyf8 UIjyCRxkV16omcauWw3fssrr1wd/PxfrJSGEZ/QdyApfEG90tHIbz6Yhvi+WnP7Fzyby WwJoARw7guaxO40ztxvlr6G/9z/Ezvq+HwUS5D+Ugcjw8u+N9JxEIyRGcDwt5qPiafoh zFg6y/ECbFI4kJmUMgw3w1qoNPDyx0fDollQbWQiI1c5qkdZ1sAUs3QYPvwv2cK1G41B 0yJg== X-Gm-Message-State: AOJu0YwccsjGqFud7MXenEhOZ9dhiq7BvVxit4Rm6eWxKw3u07Bafzva ahM+MoZaXZ6K20LJceQ0DIOCKMLn3/QkxYIui8xCODSRT5Z6xiqS8pDvCoo2JPTyuOArMZl1+7b l X-Received: by 2002:a05:6512:1150:b0:539:de0d:1e35 with SMTP id 2adb3069b0e04-53d65dd0926mr7255780e87.1.1730805585337; Tue, 05 Nov 2024 03:19:45 -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.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Nov 2024 03:19:45 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 14/31] target/xtensa: Explicitly set 2-NaN propagation rule Date: Tue, 5 Nov 2024 11:19:18 +0000 Message-Id: <20241105111935.2747034-15-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::131; envelope-from=peter.maydell@linaro.org; helo=mail-lf1-x131.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 NaN propagation rule explicitly in xtensa_use_first_nan(). (When we convert the softfloat pickNaNMulAdd routine to also select a NaN propagation rule at runtime, we will be able to remove the use_first_nan flag because the propagation rules will handle everything.) Signed-off-by: Peter Maydell Reviewed-by: Max Filippov Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-id: 20241025141254.2141506-15-peter.maydell@linaro.org --- target/xtensa/fpu_helper.c | 2 ++ fpu/softfloat-specialize.c.inc | 12 +----------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/target/xtensa/fpu_helper.c b/target/xtensa/fpu_helper.c index 50a5efa65e2..f2d212d05df 100644 --- a/target/xtensa/fpu_helper.c +++ b/target/xtensa/fpu_helper.c @@ -60,6 +60,8 @@ static const struct { 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_prop_ba, + &env->fp_status); } 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 8bc95187178..b050c5eb04a 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -405,18 +405,8 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls, || defined(TARGET_TRICORE) || defined(TARGET_ARM) || defined(TARGET_MIPS) \ || defined(TARGET_LOONGARCH64) || defined(TARGET_HPPA) \ || defined(TARGET_S390X) || defined(TARGET_PPC) || defined(TARGET_M68K) \ - || defined(TARGET_SPARC) + || defined(TARGET_SPARC) || defined(TARGET_XTENSA) g_assert_not_reached(); -#elif defined(TARGET_XTENSA) - /* - * Xtensa has two NaN propagation modes. - * Which one is active is controlled by float_status::use_first_nan. - */ - if (status->use_first_nan) { - rule = float_2nan_prop_ab; - } else { - rule = float_2nan_prop_ba; - } #else rule = float_2nan_prop_x87; #endif