From patchwork Tue Feb 11 16:25:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 864123 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1289:b0:385:e875:8a9e with SMTP id f9csp330628wrx; Tue, 11 Feb 2025 08:41:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVytkt8KWG6TErVHzO9x8pgmjaM6cZMzQF7TT04vnKnOad62Sp4S3IxTqMDaltfN8NW4TlDSA==@linaro.org X-Google-Smtp-Source: AGHT+IE1VWZcYxoFAnbPkyMM60/tl7OCt0yGlFEcYdapzls1ak/KFvNUEb/cYTn/DGGoYUq7gEOk X-Received: by 2002:a5d:64cf:0:b0:38d:e384:5561 with SMTP id ffacd0b85a97d-38de3845662mr5031412f8f.11.1739292080749; Tue, 11 Feb 2025 08:41:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739292080; cv=none; d=google.com; s=arc-20240605; b=YLxVgscD+sx0uBHRY4I/3SXpHKEB7fvN1QkhiAlhV+ASO9fwEYKbAP4JJk2PizAcY8 HVVBf8dJ0FyUle5scQjlgAG6/D5euwpeSR477DMukLB3ahtw/PX5Zf9RfTPcS8qhcgBJ K7hyndRrIAtxbayEPI/eGKFT3yIYtGmtz9GQ21T4XMt01C7uPsPfpJFZHWmoyPdA0sp8 gHU6oc9GsxxDNKl0v2iRbPTApcG1AAqvXnJRFyI+Ifk6fv2ZTVdqoNOKkXYK+MTCYi4c yo1bSsLhjiHvGdWUsvhsBRZqYnvbz3cM5r8xIPRZwn8SU4UcIjAPYYchVsyYyeD8IwoW 589g== 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=Jzv36lXWBV913+k/GNHt1ww49Fjtm1eDjzOizNTD6d8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=jpYpAeiF9bxVZK6s/Xjrx2Yy4TD+36oxbrhrABYuf/xpRx5z9dYWy/OIvXo2IW4jx7 rRQQ6AoQUgmycs0CQGKcprvmImtItHg2AD1HCgGtNnypIF3e/HeyD5NDRh0zIHszOBMm rU9s8WoB+zMD5zqeq7fJunLG7xH40rW/zaaGkQ8BY5AijOZwW6SfaANrfv8fG11BlThu UN2Vv5XbtihZOX1EdR2D3qQ14c0FNCC0GZBi7mbIkvM+SWNf/uKxbQDjiwaxVTxs8Wjk 8bPf3gfHfRBqKwHhK89F057JRzYobBIbuk4JN+ncurGQ8s9p4o/4stSMiKQk3Aqk4pjA Rfqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pcYZep9b; 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 ffacd0b85a97d-38dd4d66ed8si5399317f8f.808.2025.02.11.08.41.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Feb 2025 08:41:20 -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=pcYZep9b; 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 1tht6U-0007Yc-V6; Tue, 11 Feb 2025 11:27:18 -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 1tht5a-0006U7-6I for qemu-devel@nongnu.org; Tue, 11 Feb 2025 11:26:22 -0500 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 1tht5X-00038P-Po for qemu-devel@nongnu.org; Tue, 11 Feb 2025 11:26:21 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43690d4605dso39884245e9.0 for ; Tue, 11 Feb 2025 08:26:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739291178; x=1739895978; 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=Jzv36lXWBV913+k/GNHt1ww49Fjtm1eDjzOizNTD6d8=; b=pcYZep9bJdBNgPmV8v0FBL2cktz52JSy58uV6+Co5rpRadz6J2UOIGl9q3Vhdx/RUv veaS0LwhqmH6ItAsuPte5F7euPpKiGuBkV7Jb02WCpVn4QiZNsFhAfmq9IWLMhrJ727D UTJfuW6TmFglKax6L5ntfAiq0glzRPi0fTKSS04+6A7QPPb0WHAlVwjlzY2PdY77Ydfy Mv93TqjXAf2zGf/zBxPIQty8/fA8bLUoBf3UgydyvhLKRF5DVTJscKitMgnzTBMROO4o 51KQ5yj/27aDPFoJMhbVBP066aZbTfll5ygiYSKbKRtg0AZ0yGyZ1SjQXmgUaEQx8SZr y5Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739291178; x=1739895978; 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=Jzv36lXWBV913+k/GNHt1ww49Fjtm1eDjzOizNTD6d8=; b=cjZc1MnqFItjXX0YsTMsARNLsXUJRb53Tmt7il1II7ezFnRYJl90S9P5eKg9mb9/ky anYHpni3KUTwiYwZePu0il+nytZnscv3SH50aJ68tod0wuIWk3/an/SctQ0Z0XUB0UYq V+CkGZrih7XORTmtACOqN9402GGibTZdfi+/kM8+1Wq2WPq3uhp1wOfBhDRy5HqgVRKj CsFFN5EBLchOY0DIlbDFh5n6iOggiRnX5Lbl0WZOb3gVrIsDKmxdD3sAN1xvm4dwj5My Gjd8vKkgYwYuzADt0LNEn/dtIH11WF7kOJos3XN5wzVC89J9FUe1sbja6QopnXPXoNrl O3EA== X-Gm-Message-State: AOJu0YzeotxV+nYztrUWDOM6JypW2rRXvN4jE6RTTg/gk1IVHlUVEJKf cXywBbrDLhC/37Ysu3zGs9xYoycZUpkClOubTD7PVv9acgP30F9TuIyX+XMoMGFyX1v3LMEFj5F v X-Gm-Gg: ASbGncssG5kcPsmQosDvDoNiRgrCY6gsZdfXAM6NQyj05LHX+JbjcZQB3RxLimK33aE 4imkOyhEScuVXhMYwnsJOf4Jox/qZ6kfE1aEXNOd1H+Gi/NjB0DZGmALPAdfXifMuWdC7RxTwGk h7UizGxCgWwNb2ueY9TpI3egT0UWn7hT85kAyZx1fiTLmqdXvSaLFNitfkMhFzyLB/GVmcfYTEF iQeTIUtx/Zc2dVeAuVCtPNKZ9jqcb7bEF+35P84WCEXGpiozhfYiBvmOOyZRoH0WJA5rKGHWVsb eHVls+O8e2myEtXfBF/B X-Received: by 2002:a05:600c:468f:b0:436:e3ea:4447 with SMTP id 5b1f17b1804b1-439249c38afmr179943575e9.30.1739291178370; Tue, 11 Feb 2025 08:26:18 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4393f202721sm82660455e9.21.2025.02.11.08.26.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 08:26:17 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 20/68] target/arm: Handle FPCR.NEP for scalar FABS and FNEG Date: Tue, 11 Feb 2025 16:25:06 +0000 Message-Id: <20250211162554.4135349-21-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250211162554.4135349-1-peter.maydell@linaro.org> References: <20250211162554.4135349-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 Handle FPCR.NEP merging for scalar FABS and FNEG; this requires an extra parameter to do_fp1_scalar_int(), since FMOV scalar does not have the merging behaviour. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 804b6b5b67d..3195cb5fef1 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8426,21 +8426,30 @@ typedef struct FPScalar1Int { } FPScalar1Int; static bool do_fp1_scalar_int(DisasContext *s, arg_rr_e *a, - const FPScalar1Int *f) + const FPScalar1Int *f, + bool merging) { switch (a->esz) { case MO_64: if (fp_access_check(s)) { TCGv_i64 t = read_fp_dreg(s, a->rn); f->gen_d(t, t); - write_fp_dreg(s, a->rd, t); + if (merging) { + write_fp_dreg_merging(s, a->rd, a->rd, t); + } else { + write_fp_dreg(s, a->rd, t); + } } break; case MO_32: if (fp_access_check(s)) { TCGv_i32 t = read_fp_sreg(s, a->rn); f->gen_s(t, t); - write_fp_sreg(s, a->rd, t); + if (merging) { + write_fp_sreg_merging(s, a->rd, a->rd, t); + } else { + write_fp_sreg(s, a->rd, t); + } } break; case MO_16: @@ -8450,7 +8459,11 @@ static bool do_fp1_scalar_int(DisasContext *s, arg_rr_e *a, if (fp_access_check(s)) { TCGv_i32 t = read_fp_hreg(s, a->rn); f->gen_h(t, t); - write_fp_sreg(s, a->rd, t); + if (merging) { + write_fp_hreg_merging(s, a->rd, a->rd, t); + } else { + write_fp_sreg(s, a->rd, t); + } } break; default: @@ -8464,21 +8477,21 @@ static const FPScalar1Int f_scalar_fmov = { tcg_gen_mov_i32, tcg_gen_mov_i64, }; -TRANS(FMOV_s, do_fp1_scalar_int, a, &f_scalar_fmov) +TRANS(FMOV_s, do_fp1_scalar_int, a, &f_scalar_fmov, false) static const FPScalar1Int f_scalar_fabs = { gen_vfp_absh, gen_vfp_abss, gen_vfp_absd, }; -TRANS(FABS_s, do_fp1_scalar_int, a, &f_scalar_fabs) +TRANS(FABS_s, do_fp1_scalar_int, a, &f_scalar_fabs, true) static const FPScalar1Int f_scalar_fneg = { gen_vfp_negh, gen_vfp_negs, gen_vfp_negd, }; -TRANS(FNEG_s, do_fp1_scalar_int, a, &f_scalar_fneg) +TRANS(FNEG_s, do_fp1_scalar_int, a, &f_scalar_fneg, true) typedef struct FPScalar1 { void (*gen_h)(TCGv_i32, TCGv_i32, TCGv_ptr);