From patchwork Wed Dec 11 16:19:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 849213 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp417187wry; Wed, 11 Dec 2024 08:27:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUiEH9DQxDveiI5C89WxtBp+tYHcrx5o8C6h59IxjSlugZkMILhg7KXGERrpb5sqSp15l6f+g==@linaro.org X-Google-Smtp-Source: AGHT+IGNVWKaxDVw89PyqqeaJBkdRza9bDYMDjoGTBIZurZdVUWVdAwEMyDxf4fNJohcNE0AI27C X-Received: by 2002:a05:6214:ca5:b0:6d8:aa04:9a5d with SMTP id 6a1803df08f44-6d9348d2142mr56742616d6.4.1733934455003; Wed, 11 Dec 2024 08:27:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733934454; cv=none; d=google.com; s=arc-20240605; b=UmUWUocCZAPaiuDP6r52Hd8ojdy3DT9eiV/15Ww1w5WiIRFgmicG6Df19Q0P8iEh8M j+PSRL5+gEomnh+h4nnziJ4cbJP+wXZOPvtexGr0JqLP4hAlDhB79aId753cizzm7HED u2xsh7zwXPfyeYB2Fwka2PRUTRjexcHxk/ep/D88PuK3uFNUk4dUbH6nFvRZnYSEMtxE 6SFUh2crIdbE9kX1AVy/5VPr5kIN0zS1RLzYnExCNTsTxhRqdRqD7tq3ZTTyH8STdq76 BJ5VmJ8ykC8I4fn77/YJIMGioqp6rz7/dQfY/GU7EY1NPeKiN0U7GIOxk/edF83HNRyd g3Tw== 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=kqc/nDYRVw371GtkZwgUaEiTpivDb51JFPpNFEa+LMQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=jVx5t4YAtaW7OWg/qlxxYqFZSlPLw+/Qkb2Nax5CLO2lPoShw2u52P/RMrNRVWjrUs e64I14491MBebtS3F+gJPz3RVp7S6YVo8Pj50DtXUmibOxbHMMdv8ZystXogQAlbHSNN TWnIa8iGz0vunoFOQPsQ9VZPzQUYFq+Fn/HzHjAKRCBogdjhAGuYAAoDH8781odcCwAb Vlc/slkiVCvohmH/+2ZmmzXiuE8cgOV0yYrzDRn0qzkRUppKo22EDASHRt+4FWCnyp++ nlLqD7G3tt8WFH56VcSXZGA+CblyU3RNq60xpwEPHrjipA0OP/tUCyK0wOTtdc2XSxMe oA8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xxGLLGaX; 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 6a1803df08f44-6d8dac25a7fsi183064136d6.419.2024.12.11.08.27.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Dec 2024 08:27:34 -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=xxGLLGaX; 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 1tLPSY-00015N-Kr; Wed, 11 Dec 2024 11:21: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 1tLPSV-0000zX-1N for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:21:07 -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 1tLPST-0007ow-Fc for qemu-devel@nongnu.org; Wed, 11 Dec 2024 11:21:06 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-434ab938e37so45369095e9.0 for ; Wed, 11 Dec 2024 08:21:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733934063; x=1734538863; 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=kqc/nDYRVw371GtkZwgUaEiTpivDb51JFPpNFEa+LMQ=; b=xxGLLGaXYK13mgR4nfwgD6INDqMIX9ENoBWteZKtSHMF4tPgeZRnAiuGpXBgeNZ//3 T2wpNlbHsaug+dR0zjsBzcY9eC5xKzI4N4J1HbJP3pfcFt0HABj+nQ575XyNz8UzWuox N4zDovXGtixje29XB2iq6FOZfEhSchEpOHPN7/C+kJMSDwN8qoanTnZqXZvBVgY9FDMG Q2xZRcIdTumNyIxETQyqRI1pBwVVa73DWpHozRJc2Lv3d7IAU6He12nBoroyCsLG73Hi rSzNakI308o2bqU5nx1ZOuJjwFSWFaVixOEMuyklHVlxzT+1pHXJz717W1V3QBId8cT3 yA+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733934063; x=1734538863; 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=kqc/nDYRVw371GtkZwgUaEiTpivDb51JFPpNFEa+LMQ=; b=ic3gJJl1gWzukHIaRirInF6Hdb/6ruq/vw4bgSuUzFeJsxpVfBl1rOE09vJRxv7qVo +mdqtaRHZGyYOvkGBS8l9jShIk8XldlAvSA4egxAexdECpuqizYYWOjZQV6kwH2ztfwk 9xdDUNF/7itO0RYCpT87bls8SzrB+T8wMiook5hZgwO3RQipMxWADZ4Nv6OJXGjjgzqv k2bBl3si2voH74rAaU++tJ9AIDaGaQlzJDVOojkpLK7NeEqHUTDKczpAidRlz6rJ7E0R asq9VUoZP7P/pRwmuhJDSqlXXdiFocLg4Z3Wid4hd/LSwnpvcaaElbH63Y0paNyaXxl7 y4lw== X-Gm-Message-State: AOJu0YyEkpxkmi1HPyrryKGvNZfBMr5VuXHUY6EKDxG9PWJzH/poD5Fr jPBasp+rqHJyd0xIQZOunLllCpWgUEq/rJoomPo02lP+ei4egBE+zviMBJMHGzOJ1TfuZ3vELx1 p X-Gm-Gg: ASbGncvNLD9aEQKyF1eQ89S5vuNV4bk3on5GRGf+xyh8w/At7Nb3EIewLqY1sk5F2kg T0iX3juf4GIQy+/R0kvIyF2+eedFn5eAuAk4mORxbHiavYbnPdjavZggG2sC6kj93Fs0tYnAjEn ua3g7xOQVRk04iZ9RgDziarozUjBUuTJSvOxO4ptxUcLxEu1lNxuA+bAXqc/wNzpbArxSNlylkZ IcSq6A6IX+g8nEz/yvLy0tg5/sftQMKyf2RMUMY++Ges6+PgWsvk1grpbnj X-Received: by 2002:a05:600c:3541:b0:434:f131:1e64 with SMTP id 5b1f17b1804b1-4361c36f796mr27470055e9.9.1733934063021; Wed, 11 Dec 2024 08:21:03 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434f4dfdcdfsm121460595e9.39.2024.12.11.08.21.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2024 08:21:02 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 49/72] target/mips: Set default NaN pattern explicitly Date: Wed, 11 Dec 2024 16:19:41 +0000 Message-Id: <20241211162004.2795499-50-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241211162004.2795499-1-peter.maydell@linaro.org> References: <20241211162004.2795499-1-peter.maydell@linaro.org> MIME-Version: 1.0 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=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 default NaN pattern explicitly for MIPS. Note that this is our only target which currently changes the default NaN at runtime (which it was previously doing indirectly when it changed the snan_bit_is_one setting). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20241202131347.498124-44-peter.maydell@linaro.org --- target/mips/fpu_helper.h | 7 +++++++ target/mips/msa.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/target/mips/fpu_helper.h b/target/mips/fpu_helper.h index 8ca0ca7ea39..6ad1e466cfd 100644 --- a/target/mips/fpu_helper.h +++ b/target/mips/fpu_helper.h @@ -47,6 +47,13 @@ static inline void restore_snan_bit_mode(CPUMIPSState *env) 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); + /* + * With nan2008, the default NaN value has the sign bit clear and the + * frac msb set; with the older mode, the sign bit is clear, and all + * frac bits except the msb are set. + */ + set_float_default_nan_pattern(nan2008 ? 0b01000000 : 0b00111111, + &env->active_fpu.fp_status); } diff --git a/target/mips/msa.c b/target/mips/msa.c index 93a9a87d76d..fc77bfc7b9a 100644 --- a/target/mips/msa.c +++ b/target/mips/msa.c @@ -81,4 +81,7 @@ void msa_reset(CPUMIPSState *env) /* Inf * 0 + NaN returns the input NaN */ set_float_infzeronan_rule(float_infzeronan_dnan_never, &env->active_tc.msa_fp_status); + /* Default NaN: sign bit clear, frac msb set */ + set_float_default_nan_pattern(0b01000000, + &env->active_tc.msa_fp_status); }