From patchwork Fri Oct 25 14:12:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 838346 Delivered-To: patch@linaro.org Received: by 2002:adf:e287:0:b0:37d:45d0:187 with SMTP id v7csp306248wri; Fri, 25 Oct 2024 07:14:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXitBHZQpCr4nXY6cwwrHm+KbMilK7ND0Dil7/eU6vnEvrek0lFaibfhgT+IyaUGIyxzQovow==@linaro.org X-Google-Smtp-Source: AGHT+IGNO0OMYDPcuI0s83R75/tpB+BDsDaUoo4bUW9lWi4PpNg/631VtZj99y0QifmU/7f5yPq9 X-Received: by 2002:a05:6902:1b87:b0:e2b:d4ef:25e8 with SMTP id 3f1490d57ef6-e2f2fbc3550mr5578771276.46.1729865650895; Fri, 25 Oct 2024 07:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729865650; cv=none; d=google.com; s=arc-20240605; b=PTkfdQXEFTP7YGuAPgoSMnvsScrDJZxUOMFu6CL7xITA3XRJw96wIfdC3rRFRyy39Y yT+CFNHnz8k9co6hdoplS99zJSVam/0mHNwAJe2Hw/3lbVJmqfd0bcGEOnmoM6ydTjeL asvPZpnAANvjo8MVycdGDuTeSQaWNkEHVD3134JxFCHLEJmPCqR2GsZIFL5ZwvRvEvlu 2fglRuElmSGYTHkUvegdvAwN8XxF/cjtoF9Qxz1ed1r+/Tth0aOq7hroHAIpqt9FBWn0 a4YitiAL4itmrrVUoLoKeQ1hnAj9lHib1HFwEaVz+1Fcne/X8DNOFhOJELfni/me/T6o rMwQ== 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=D17Ee6pVmUO+XC5zV2qFLSsZ3L5n+f/7oR7L3Btz1qY=; fh=pPmVlts4ZUf1sVXFwaDLw+UdVSXh/fOnabnSaIOIurE=; b=JIaHBa3oOLngF9JaxKmxwVcrEmlGx9L20YsH4X5UD73Db0zLKamBLNbSWfulOxTBzk 5Knqb6djRpHEwsqn+JpQYgkhxK0I+AxYC/looqm+/oLAVjhnTPz+l9PNYxSn3s4gDG75 OTQgWpSaC3aMgnhLFk6qIoGDfJdtSyfSTerB5Pv2mmjL2mh4hPybIwlMxIho/rmpc3WM rTL5ySLYZiIEw32wAC9e8ovKUQm6JUwmLacSFLwKK0fsoD0KB2BUUdNcywixBR9hrWCR o5+F3VrnnV0Osb/cp/Lb+Ww2k99jQY1tm6MWCzzEmu4KxExgYAsEjW2R3IgQ7HXSLQzw gh4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cAK75Km+; 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-4613235ddcfsi15012621cf.350.2024.10.25.07.14.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2024 07:14:10 -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=cAK75Km+; 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 1t4L4R-0004nQ-BG; Fri, 25 Oct 2024 10:13:43 -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 1t4L4A-0004PJ-KO for qemu-devel@nongnu.org; Fri, 25 Oct 2024 10:13:26 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t4L3z-0007vH-34 for qemu-devel@nongnu.org; Fri, 25 Oct 2024 10:13:26 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4316e9f4a40so21294035e9.2 for ; Fri, 25 Oct 2024 07:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1729865594; x=1730470394; 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=D17Ee6pVmUO+XC5zV2qFLSsZ3L5n+f/7oR7L3Btz1qY=; b=cAK75Km+rTrSaHVpzm5LZt73g11cAWk0qPgRPeZN58LFEMdFV2iBKNVT5IwzgLWqD0 s67H6KcSyLqO6Gp445X+v4aRQY8NMlaeuF1yhkNqQJqtM01f06VkCbUuSQxxVHYYbVv0 pFFyAPGWwv3GtxgafnApGvaD9iGWNVz6jsb6c07Ry2RuO62bAAWU5cLbJ4xwdiLvIc6J lPm2nlbJflFosP7oUUZikzhy3Tu1r/R4JoTjyKzRkMrUhkSfbDFijR8JQ4QXzD28U+uZ axOZNiQkHyLEAB0sK5yyWX1I9H8B5ZZQtqiw00ReaBzrLcZ0gBdhFJprxauYAjrhVCXd 1O9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729865594; x=1730470394; 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=D17Ee6pVmUO+XC5zV2qFLSsZ3L5n+f/7oR7L3Btz1qY=; b=E4RX1SJbpeKJke0HEjBntB7KTPGVLbbsELTnC+Hn/5K10N2Fvjb1Xluua8auLQR+b8 XdvUvzxokdNKtkqHPfbkvf9gWuBQGSPvrWmhNYKMya/BlyuNoEnGS2R2HiE5AU9hbiPh Lsa1h7I1+XsOY8xunAel44hqDJnzmDuwDuyUFGaIzcJ9R27E0cQ64AudpguvwY9jeGAU ONv4y2uAwcDU0Mb/CMsuKV8OxOVlM02CNqRVyJc0leJrCYifdolsQa0D6A6ypRCn4Bxw z5JBImFq7JrW6GuMweQrT+iq+EpApr7XLkLIfAw+6iskAsTtJ7/IC5ApiE0eb7dvA3S9 qY3A== X-Forwarded-Encrypted: i=1; AJvYcCW9vwAS7KymATEnbDbI5ih616xX1mrNkklBIBRlflJ6OzhwWmpvU+TKPdEtZ6vaCZwSbllcj3fGvg1l@nongnu.org X-Gm-Message-State: AOJu0Yzc2fQKohB3TFloZ94KF0PKtaaq+uqg0WxezByRDBsA9SaI1CYk QmWkKG6AssXdM82KXRSwG+BT3t+Uipz87ZhVCpd32KIMxR+sFQO0MHIKWK8sLjE= X-Received: by 2002:a05:600c:1d98:b0:430:5356:ac92 with SMTP id 5b1f17b1804b1-4318c6e8ad6mr49585085e9.7.1729865593604; Fri, 25 Oct 2024 07:13:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 07:13:13 -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 20/21] target/rx: Explicitly set 2-NaN propagation rule Date: Fri, 25 Oct 2024 15:12:53 +0100 Message-Id: <20241025141254.2141506-21-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::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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 for the float_status word used in the rx target. This not the architecturally correct behaviour, but since this is a no-behaviour-change patch, we leave a TODO note to that effect. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/rx/cpu.c | 7 +++++++ fpu/softfloat-specialize.c.inc | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 36d2a6f1890..65a74ce720f 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -93,6 +93,13 @@ static void rx_cpu_reset_hold(Object *obj, ResetType type) env->fpsw = 0; set_flush_to_zero(1, &env->fp_status); set_flush_inputs_to_zero(1, &env->fp_status); + /* + * TODO: this is not the correct NaN propagation rule for this + * architecture. The "RX Family User's Manual: Software" table 1.6 + * defines the propagation rules as "prefer SNaN over QNaN; + * then prefer dest over source", which is float_2nan_prop_s_ab. + */ + set_float_2nan_prop_rule(float_2nan_prop_x87, &env->fp_status); } static ObjectClass *rx_cpu_class_by_name(const char *cpu_model) diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index ee5c73cad46..254bbd67168 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -407,7 +407,8 @@ static int pickNaN(FloatClass a_cls, FloatClass b_cls, || defined(TARGET_S390X) || defined(TARGET_PPC) || defined(TARGET_M68K) \ || defined(TARGET_SPARC) || defined(TARGET_XTENSA) \ || defined(TARGET_I386) || defined(TARGET_ALPHA) \ - || defined(TARGET_MICROBLAZE) || defined(TARGET_OPENRISC) + || defined(TARGET_MICROBLAZE) || defined(TARGET_OPENRISC) \ + || defined(TARGET_RX) g_assert_not_reached(); #else rule = float_2nan_prop_x87;