From patchwork Fri Oct 25 14:12:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 838361 Delivered-To: patch@linaro.org Received: by 2002:adf:e287:0:b0:37d:45d0:187 with SMTP id v7csp308737wri; Fri, 25 Oct 2024 07:17:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWcY1QsJmcNEipi+5WuplNLuLBj7U+SyLzWtT8U4lH1VpTVKKd2EpP+x1XH5I6hAFHmtlUb1g==@linaro.org X-Google-Smtp-Source: AGHT+IGTWmNKVVv1v8XfxBEZoPi4nizf157UUb5BKzU3yBCaSU1CSocyEZgv3SvfW71qQYm8dLe7 X-Received: by 2002:a05:620a:394f:b0:7a9:c160:c80b with SMTP id af79cd13be357-7b186babf70mr856013085a.8.1729865879507; Fri, 25 Oct 2024 07:17:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729865879; cv=none; d=google.com; s=arc-20240605; b=O5TAtdSJNON7fpxJerB+N2Z9zX+Raee0AEEfXhv4C9K67fk0kReWmqv2EDhUamqeoY bXeVwEBqA2I+nmMguZnJlO9kQd3YP5ULhMyNVcj6/PXeQZIdDa89WqCSA5bbdMlaKSSi TBMcJoA7LAA3sGcwKbWYcA96TNcg+e+GGwsyHYkcJ9Bug9ptWJTnaSCG4jO1t+xRMhco RAP6VjIl8cqPuWrbgj2Bn7o7IgxxVLFVOldY9ciSoreYAQatryPrDTQYBgMAJEfWfhX8 xvRLCblwr/ku3OBVLFKrrzYgx+5HdagPH1cwhXMUjPyzeGLlzattNszUmHXezOMdBiwX +rrQ== 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=YDlbbvylJyMrU/YJShcxhMfUmai1iRbva+PhQ15qan4=; fh=mQ94+JDKCuTRZEBuBVFMAzSyfCAHcso4ihd8C6tGW+E=; b=HbiQ11QqJCU0llTOaCoes4AXhLYpmtkYfCfUO8gC0NveVelFQ5Hs1CJwm2mEdG5yAp NWXUQggLzFn2cCKB46JVCHFgOIroMCOqWOM0qGuqFlRIVDYgne2uW98zsa9/PtJcgHyL bTwyzFgBi/nBkldDFF79ilVmcQ9ry8jKR3epea+FWeEAP0xdscg53QXGU84avSJVfj5+ hLG7bflcFU+Pnst08jAzvPpom3x0erTFdvECSMN4OLyTmbWGRvM5Bm+KIAKNFEkOm4TB dA0R4Utgs2F5a4C1z9gAAdoa2U6L32+iazMcH+GwTD1o5zNqkAMuVkdUGEb7AivIBJXE MpFw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2s93LMA; 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 af79cd13be357-7b18d26b044si162153185a.52.2024.10.25.07.17.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2024 07:17:59 -0700 (PDT) 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=O2s93LMA; 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 1t4L3x-00048O-E9; Fri, 25 Oct 2024 10:13:13 -0400 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 1t4L3s-00042x-57 for qemu-devel@nongnu.org; Fri, 25 Oct 2024 10:13:08 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t4L3m-0007nI-CA for qemu-devel@nongnu.org; Fri, 25 Oct 2024 10:13:07 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4315c1c7392so21121825e9.1 for ; Fri, 25 Oct 2024 07:13:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729865581; x=1730470381; 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=YDlbbvylJyMrU/YJShcxhMfUmai1iRbva+PhQ15qan4=; b=O2s93LMAgXPvuN0338XpNBLW0UNo2M5/Kgk+ROvEM52yyeaN5uzbmk2gYnF9lHu2Lc JDouInfGo/lSWGLNW0EqQiXo/1ZnwSUYL2+3D48lEkb0qKDNZytlqyByju9SP5TAXYWn wHsfh7G2sBpR7j6xBihiAFL13b4ug89XNOW5jTMBgVu2UovagfCoq+npfffyeEjcdGnW 1QKBwiCn0Dlctx6oLTOYZOxqZEttcN91LdKz+jblhqItmYpQzk0P47Hy6UdHx17qy4LZ N0y3MAI/1G+kHb069gIRHXrzJ1SB0rGR99wpG7SZdF4vGf8BNOHl5x+pZIloTamiL0WQ /VGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729865581; x=1730470381; 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=YDlbbvylJyMrU/YJShcxhMfUmai1iRbva+PhQ15qan4=; b=AFzUpNvbQjzVdq82GrTYvl1NBTvgYGr0cJtOmzuDJy2fe9yK05ZyhF/TZtTLA1WPmJ Qdqmpr5NEEz8kg9KXjswRUOGGijXA6yiClDCFXQLXOOOh1Pq/7px+5jc41YyEB42FhW/ FR441V7Tpc9oltjkefnKZY2VWtxojj+900AOQUN7B21pecwI4hqs1cxu2mlfGKYVE3RS ZPoRjuMq11LDK4kBOlotbNc4Re3HBlzOF1xXlYCK8fi9r1RvCcvMVtPcHZ3J2nDJu++P O+JtbEwpgAQrKs+NZm+YktiaQQjDOP8szqCnkhTz1JHsE4Zak/Q4IVh58VOB0UfOFzqN DiGA== X-Forwarded-Encrypted: i=1; AJvYcCUcNaRht+KrRATa1kshZL7CE3UIzImIPJCbMX9wXDii7DiICbKEB4jEMnWOqk9ipuFDUJH7SSDVmPP8@nongnu.org X-Gm-Message-State: AOJu0Yzzt223NZSYxzzJqVNlc6yYZj/ZTl5B0q6RujqB8nDYLLGqUcg5 uKmDLiDEXaJKRM2CNkxTkqEJU9y04lfB4RKovsvFOiKsVFD+POyVIRKwsSoqXbU= X-Received: by 2002:a05:600c:1c03:b0:42b:af5a:109 with SMTP id 5b1f17b1804b1-4318424eb98mr90790405e9.24.1729865580849; Fri, 25 Oct 2024 07:13:00 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4318b57b051sm50104535e9.42.2024.10.25.07.13.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 07:13:00 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Song Gao , Eduardo Habkost , "Edgar E. Iglesias" , Jiaxun Yang , Aleksandar Rikalo , Stafford Horne , Nicholas Piggin , Daniel Henrique Barboza , Yoshinori Sato , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov , qemu-ppc@nongnu.org, qemu-s390x@nongnu.org Subject: [PATCH 05/21] target/loongarch: Explicitly set 2-NaN propagation rule Date: Fri, 25 Oct 2024 15:12:38 +0100 Message-Id: <20241025141254.2141506-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241025141254.2141506-1-peter.maydell@linaro.org> References: <20241025141254.2141506-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x332.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 the float_status word we use. (There are a couple of places in fpu_helper.c where we create a dummy float_status word with "float_status *s = { };", but these are only used for calling float*_is_quiet_nan() so it doesn't matter that we don't set a 2-NaN propagation rule there.) Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/loongarch/tcg/fpu_helper.c | 1 + fpu/softfloat-specialize.c.inc | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/target/loongarch/tcg/fpu_helper.c b/target/loongarch/tcg/fpu_helper.c index f6753c5875b..21bc3b04a96 100644 --- a/target/loongarch/tcg/fpu_helper.c +++ b/target/loongarch/tcg/fpu_helper.c @@ -31,6 +31,7 @@ void restore_fp_status(CPULoongArchState *env) set_float_rounding_mode(ieee_rm[(env->fcsr0 >> FCSR0_RM) & 0x3], &env->fp_status); set_flush_to_zero(0, &env->fp_status); + set_float_2nan_prop_rule(float_2nan_prop_s_ab, &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 c60b999aa3d..bbc3b70fa9d 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -402,10 +402,10 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls, /* target didn't set the rule: fall back to old ifdef choices */ #if defined(TARGET_AVR) || defined(TARGET_HEXAGON) \ || defined(TARGET_RISCV) || defined(TARGET_SH4) \ - || defined(TARGET_TRICORE) || defined(TARGET_ARM) || defined(TARGET_MIPS) + || defined(TARGET_TRICORE) || defined(TARGET_ARM) || defined(TARGET_MIPS) \ + || defined(TARGET_LOONGARCH64) g_assert_not_reached(); -#elif defined(TARGET_HPPA) || \ - defined(TARGET_LOONGARCH64) || defined(TARGET_S390X) +#elif defined(TARGET_HPPA) || defined(TARGET_S390X) rule = float_2nan_prop_s_ab; #elif defined(TARGET_PPC) || defined(TARGET_M68K) /*