From patchwork Thu Nov 28 10:43:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 845923 Delivered-To: patch@linaro.org Received: by 2002:adf:f2c4:0:b0:382:43a8:7b94 with SMTP id d4csp158428wrp; Thu, 28 Nov 2024 02:45:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVhcKlz/O+VCCBxkKr3umFydz7caCRUDfQrkgcnHMbk9CuXFjGqm5e598ZYppZ1a1DpB56EOg==@linaro.org X-Google-Smtp-Source: AGHT+IHamcD4OEGy80ul7MdRiqGmqxjOUNNbNJc9zeU/OkAZ0vbw170hoe9erathOk8woc2TpLkY X-Received: by 2002:ac8:7c52:0:b0:466:9360:4933 with SMTP id d75a77b69052e-466c1c0ea6cmr45295851cf.27.1732790723289; Thu, 28 Nov 2024 02:45:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732790723; cv=none; d=google.com; s=arc-20240605; b=eJg7riEl7wKO+KIREchVfzddsQTfi4C1ehHnCrzo5BH1kwOsyMCjomsKcnu+x+UgW3 u5wjCMPPY7Ysv+YNPE2LuR4AwXsQe55J9KsGIFUnkx1I156OC2IVhMPEA7c4ZUCyblFN HgdI3Xn31ckFVyoVkL3yEjj45T6gjzTvifkAcMXuffZkT99TGp5RRbhFCkVcWCg/V+x/ mEofLdwGAb99jkAyIGL4VlcHUTLjZJisd0glP6Yvo+7JlDXr1rEqa5F5FkniFznC3O2F eTpECTqhTcA/5noObzVCytUTR14qJezGBJgmI40yN3H5TDKreJQjEcaKHiOfPVO9Uvad BvsQ== 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=2TrVJRkkr5D+N0aBUkmYJt1MSRdpl5FRuyVmIZ66utw=; fh=QgE9QYJDVj//6C0QJWGeEM+qaFVaxwMel1ZWqkEy6K0=; b=ONbLJW4aWkoY7NCRbwyHo3Vj2XRcpg1T4uBZ1SNo7eWWBRDS9v8WeyJ3mv2pIXJF+7 4SpJDFkKp+5wIJpKnPOv6rexRdkCIV52Fc2gKP1IcQQMrdKjy9KzEPrrgBBqtoA5tbAw hJZb06jMi2kVh4RCFy56C/sVuKRMrUScVKUYmrmt75YFjyZpPFWJriqH3wBeTm+TwQt0 gdfQ9f4/MT/bmwZiTjkyP1m8smFQThSJOkJGh6v4YpwENaRUVsHQxxCu611vukE2A5BF 6NIG2qoJ0WDumbQui5d9o4kFwkz4U9dhWgI/KHjLiw8Ujvvg2WrcnHcJf6tW+2jEcBJX jbow==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aFqv7/Qc"; 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-466c410322esi14114641cf.341.2024.11.28.02.45.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Nov 2024 02:45:23 -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="aFqv7/Qc"; 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 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) 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-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) 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) 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 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 *env) { bool nan2008 = env->active_fpu.fcr31 & (1 << FCR31_NAN2008); FloatInfZeroNaNRule izn_rule; + Float3NaNPropRule nan3_rule; /* * With nan2008, SNaNs are silenced in the usual way. @@ -44,6 +45,9 @@ static inline void restore_snan_bit_mode(CPUMIPSState *env) */ izn_rule = nan2008 ? float_infzeronan_dnan_never : float_infzeronan_dnan_always; set_float_infzeronan_rule(izn_rule, &env->active_fpu.fp_status); + nan3_rule = nan2008 ? float_3nan_prop_s_cab : float_3nan_prop_s_abc; + set_float_3nan_prop_rule(nan3_rule, &env->active_fpu.fp_status); + } 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); + 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); 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, } if (rule == float_3nan_prop_none) { -#if defined(TARGET_MIPS) - if (snan_bit_is_one(status)) { - rule = float_3nan_prop_s_abc; - } else { - rule = float_3nan_prop_s_cab; - } -#elif defined(TARGET_XTENSA) +#if defined(TARGET_XTENSA) if (status->use_first_nan) { rule = float_3nan_prop_abc; } else {