From patchwork Mon Feb 24 11:15:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 867901 Delivered-To: patch@linaro.org Received: by 2002:a5d:47cf:0:b0:38f:210b:807b with SMTP id o15csp1493771wrc; Mon, 24 Feb 2025 03:16:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCURX7cbOvnJwoTnhFKE3WHRA1wnTA21b+CwA7sm9bk8k7VObs4wIc8lQy/NZCe3P/VNSQRNiw==@linaro.org X-Google-Smtp-Source: AGHT+IGduziDaQM0F7zRuLZ5gKNzD12NFZHZAacPDtJ9E2QZwMUxkXIzsm6YQkTAyFczM/7LMPzg X-Received: by 2002:ad4:5d6e:0:b0:6d8:9062:6616 with SMTP id 6a1803df08f44-6e6ae7c9d52mr157349156d6.7.1740395789691; Mon, 24 Feb 2025 03:16:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1740395789; cv=none; d=google.com; s=arc-20240605; b=VbQh/AG8K9zNpIaep3RDYL5tfDK9pwHXzvHrGmK4LxSKqWQh/JKNcevsI5lv/XQofZ UN+8CiMGUOdpR4PYt7+2SOamdtWu5Q8BrWF38htOFvJ5iLy1vvjkUe8h/+zDw33mt9QQ Nk7hqQiGCxuTBg8FLXR35s+z7/1oFoU9IYKNICA78ROe+zBRTvzx2SQnLph8vABy74o5 J3wjOtqplG7DvEhY6ouY1a45M4Dp1Url/lg74yVGEkcNr7bhyKLWfv7D3VFDxUDBNuI0 3/Y09gzuQuUCr/Vr5PlnhhpT8MEwRUeo2UP8ZheLni25orqc0cUwunaifyJjEkZZYux8 dObA== 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=9DbKOvjmlaa+eK1MxGX4jbLYMxjD78KrF+C7Cfab4aQ=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=KPuCfoDuAWubjuGq95QBou7+Wr7mBdx6T3EIauSu2EV+WtQXppQEks6LLGAak8WPaK gOckFhGjqW6FWOWx0kNz/9gYwcKiussMiixXjN511kAAKZGM4Cf7LPEvRIh9AJewC/pp loRYeMFPQcpm9oLuxRfVWK3HmWpk6t7m/ShdsIoQfwj0XR2AJT8hKubS17RMAVrD3ek0 Mrsp7F9ADrfiJ8tf4s/yet4i90/5O7LF425V5ahMqw3mRx8CNuoj06CKC2x9iXrrvgjt fUBWRLHy+yCGXmt47y/+83CB+PCrT/uIcW76ebFTdazJvjR3Sh8AJxPiSidsE9GSbjPc A4gQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bSjtL5+T; 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-6e65d742899si206632266d6.142.2025.02.24.03.16.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Feb 2025 03:16:29 -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=bSjtL5+T; 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 1tmWR0-0005lr-K3; Mon, 24 Feb 2025 06:15:38 -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 1tmWQw-0005kV-P9 for qemu-devel@nongnu.org; Mon, 24 Feb 2025 06:15:34 -0500 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 1tmWQu-00016c-SI for qemu-devel@nongnu.org; Mon, 24 Feb 2025 06:15:34 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4394036c0efso25741625e9.2 for ; Mon, 24 Feb 2025 03:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740395731; x=1741000531; 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=9DbKOvjmlaa+eK1MxGX4jbLYMxjD78KrF+C7Cfab4aQ=; b=bSjtL5+THtnPiuPJAuWhlqnOAIM8bHkhP1gwdFuzmtUXe+PY3QDHestA1qJpIPerCt 6cmWx7IlsHvFPGCu93zEniU+O3GzuNn7F9f5j2FHrmb/z199ZEduOpHMHRB2A3BrpOX2 dlWZujhgMNOO0cmVa2wsBpTVKBEoCW7t4HQiaknQd53WNvJ4prDXDfZVz1jrU/oHzGYi EAnO7VRLsqnpaFPpxowODycIS6iJNiSyMoP0dhFyY5Pbl4ers7rbOvjJce50iHMsiRS2 CvvWK9bd8m/n1dF2xX6F48Wkuz2A9XD5Pt2scnUCg5PgxPBMA0v0m/VvEu9Supy5H94l GmJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740395731; x=1741000531; 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=9DbKOvjmlaa+eK1MxGX4jbLYMxjD78KrF+C7Cfab4aQ=; b=rmzWRUtozGsF0f/mQiC9psCzUjIBuRfmazYpOjygFDYjtZcgktaq4UPvF1pzzdu7WN DQ93k0yVK0kTRsZB1Lw+AxtgaVzVuYh1faJNmG0F6x3UnY25kV6EF7i2B1bpetJMcuyb fRjCM+lWYFImAYnqpBGF3RORKDrtpXnNbwEc/8MHnDdZZl8sCpsUpI7LW2fA6GqRdbso hOdhqqx2HoyQ2cgHnKrTA/HmduHgTygvxYJbrXXwoeItJy+9tCUut4aEMxnKecuodMGC mzn8iw3/OR/yFiAWhdai/MmtejblmCtGHs+6/x+HVoqMPYrKOTqbPbEqKLdXhE1KWUw3 stYQ== X-Gm-Message-State: AOJu0YyQEaLI4rGxGfuE9EOqjhfrYOpcuxfAWTrptm28Bc33YtdKt4BZ LDJYU9Oas1m7VsoJvxiNzX1s/rqBQdrBj7ETV6YHRqBRBU+psw69YjXGCqd8hKiqRwX9hBScq/F s X-Gm-Gg: ASbGncuTUSbVeClShmaZbOEgNI8qmkyf39aWJYJEDPJ2b2f2Z5Id8pQnwh7qwhIgUQC mspgQDLKOnee/P3caloentrP+R2Yw3GzO3b4W9aJk3VYlBIxeAvlBDBaO1GCaykD2BqEhYBhDHN M1HyyB2V7PdVG7GwOoNTM5SBsY0WkPfpeCuk5w0+xrG2Y5FPrnIz2e8XjNXrRXlSu/JXv7XSrFA cyvwykYtPP+jK6CKMryrfCbCGKkKB3rvz3Uh7I1IsfAYXhVEMu6TVW5+k2DkHUzgdUyR/HDjfmf szH8RwwxSmicr5HvJcDv9QYp1lnPMrjd X-Received: by 2002:a05:600c:1c85:b0:439:8346:505f with SMTP id 5b1f17b1804b1-439ae212980mr93119685e9.20.1740395731147; Mon, 24 Feb 2025 03:15:31 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b037214asm101447705e9.38.2025.02.24.03.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Feb 2025 03:15:30 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 03/12] target/i386: Avoid using floatx80_infinity global const Date: Mon, 24 Feb 2025 11:15:15 +0000 Message-ID: <20250224111524.1101196-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250224111524.1101196-1-peter.maydell@linaro.org> References: <20250224111524.1101196-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 The global const floatx80_infinity is (unlike all the other float*_infinity values) target-specific, because whether the explicit Integer bit is set or not varies between m68k and i386. We want to be able to compile softfloat once for multiple targets, so we can't continue to use a single global whose value needs to be different between targets. Replace the direct uses of floatx80_infinity in target/i386 with calls to the new floatx80_default_inf() function. Note that because we can ask the function for either a negative or positive infinity, we don't need to change the sign of a positive infinity via floatx80_chs() for the negative-Inf case. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-id: 20250217125055.160887-4-peter.maydell@linaro.org --- target/i386/tcg/fpu_helper.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index f112c6c6737..741af09f908 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -1832,7 +1832,7 @@ void helper_fxtract(CPUX86State *env) } else if (floatx80_is_infinity(ST0)) { fpush(env); ST0 = ST1; - ST1 = floatx80_infinity; + ST1 = floatx80_default_inf(0, &env->fp_status); } else { int expdif; @@ -2358,9 +2358,8 @@ void helper_fscale(CPUX86State *env) float_raise(float_flag_invalid, &env->fp_status); ST0 = floatx80_default_nan(&env->fp_status); } else { - ST0 = (floatx80_is_neg(ST0) ? - floatx80_chs(floatx80_infinity) : - floatx80_infinity); + ST0 = floatx80_default_inf(floatx80_is_neg(ST0), + &env->fp_status); } } } else {