From patchwork Tue Feb 11 16:25:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 864065 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1289:b0:385:e875:8a9e with SMTP id f9csp323541wrx; Tue, 11 Feb 2025 08:27:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWKqj2TZYbK3p25TI7ny2JRV15yGkhsZ4l2WfnmxVSatoTPnjcxReqOpxD4RYC4tqFuirjLPg==@linaro.org X-Google-Smtp-Source: AGHT+IFjtqmsSfeML7Gz5ez9IAdNZCiTL7BfQJmQQL21R9FWGkVHM4u/EKF0f/0W3A/aVm6RBAeQ X-Received: by 2002:a05:620a:24cb:b0:7b6:c474:d87e with SMTP id af79cd13be357-7c068fb9d18mr643877785a.10.1739291230709; Tue, 11 Feb 2025 08:27:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739291230; cv=none; d=google.com; s=arc-20240605; b=Vix6ORB5gFfvB63Hxgi5mAY1BtxOPOzUHujJ8VnEMKHC5yM3isdhl1PXej0EO1WQp9 dz8tbmOP0xsd66desrmBKt2GUY6eBmDrbl3PWVee8W74k/lyjSKP/2SpoTCenwck5X6E Hfe1GPInWPn4/+tSsAYU+H/5wZ1mlkpCmtzqpQDM42jFjpVf6vyCUGRYdvsh6ehlimCm XreZmzXQN8wVquxKkM6S1mGI0XLF+x+TJUww5bCQoPGlnh0MrCUD1tZad5YyESszaoUn hJzvK9VrlvbZZyBG1t4Ac1PZikUH499ov5I/Oijzn20ZF6ScXZlVWy6ieoFhuhvWU0Z6 S3rA== 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=Z3YGmuarfBzTTyJth0EvutsVXIKFE4fV+5NakAnRC0I=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=lSimv9reHh+rat/tk5Aj2BuAimLNVQyO1VeS7LLx+5mi+6cl3YynNY+XWxLtfxScKu PAZ7yzhDj2hbhmh7haONktLa0jEw51AcEN7f1RbzPod81xHkeBVbDT0ccY7mu79ntLMp ovsLk97LcA2JDuObvQjboUd+CesqRa/R79h0KQDXsXV72DWpUXwesxC8gdxmNWbq81Sw 1HO8u5aMsyJWEyeaY1liNI95hBLDR4eIzHnPU6GLuzlYXppk8wRMPed70HplRb5RXIxH eFf1FUzGGdjkT1JEYmNDEZCt4BPzBA1CdUI3dFJyy9L23aWc0zWNL8IvdIfzzTRJFcxq hs3g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JCnDJCuA; 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-7c0551b956bsi645085185a.40.2025.02.11.08.27.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Feb 2025 08:27:10 -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=JCnDJCuA; 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 1tht6C-0006mg-QY; Tue, 11 Feb 2025 11:27:01 -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 1tht5Z-0006Tp-0U for qemu-devel@nongnu.org; Tue, 11 Feb 2025 11:26:21 -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 1tht5W-00037g-5i for qemu-devel@nongnu.org; Tue, 11 Feb 2025 11:26:20 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-439554db49dso7728435e9.1 for ; Tue, 11 Feb 2025 08:26:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739291177; x=1739895977; 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=Z3YGmuarfBzTTyJth0EvutsVXIKFE4fV+5NakAnRC0I=; b=JCnDJCuAlmXFXg5mJhpwzR8XnUtBTlOgOpF79f08AhWATPBgkO4wn8DGYue6QcuIDE 029U+mhmwFXUROLCdlnPTY+Vu5h++Ih+JraSGsKv4buu9ZvqAAaNYwmwfLmcOCvPKvj2 mgc7BjKSceU3VWrL7LpyLi8i8zAvLoAgVel08En1TgHvfCLHpu4SLutnc5V4AYI8pVum YjQFJ7z9Rjeb8x0++sXi6SMZX0J0ZGjti7nYPZmcAqii6ZVO2fHtAdgMnfERsxNaqCax wU5lXhUqCdgoXr6LcQpAPeydi0hrwi9n1rj2Tc6Z1aedWKe1l8IzVC/1JG/wKq1f/8VA e9aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739291177; x=1739895977; 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=Z3YGmuarfBzTTyJth0EvutsVXIKFE4fV+5NakAnRC0I=; b=DSyhVVZbGjvwcvS8SesqlZ84BYMDXF5WfhVRZA6WM+IDUDLJxVONCYF8DinP6iCevy At/VQvzLadrLiRaIvZyQuJOgc+TfrJWKcfs7bzR6Y1S4enJp13CUs2dN3YUNnUC3Ye1T 19zZDinOXy++Wea63AwO7mdezz5cM4n0YPllQABY4PuYSHea3kJs5UclMeP+7pR36OVF orSLFbJLAXnHb5yFEbuIIbSighiZYdOrFOBagGM3XP4djl2wF3w4qLPJeirm6ICUSCrR gCVcngRR36t9P3cQko9S+TIbHuGt/r8PlL4Vq+4NUPH8gQnjwZe8lR5NrQnMqDPB+Cfh 0khQ== X-Gm-Message-State: AOJu0YyoPXCGnvJpgS6ktaUE+HQ8pBGQZsIV2k42sGYRkG7fYbt+bTTF VReIxjMO0JdNYpqOXu0YjT7un/mBJA0IW/S/KHrrp+I6EzF6axYQlyDBuwBqtnAimQYVXLfFMCj H X-Gm-Gg: ASbGncvAVrUp/kyt+hLAIECP0B/VTV2iC+mWGh54xSUyGyjMRTg5q3VoDy20RO0cdwL KMfNqAM9kC2UFUBHEiLfKO1eN+aZinjidRh9YhJ+Vvpj9e0ZL78P+MzAJCzsBx8Ala8lrf7esaB iuJpG7t4h9j4osI6/M0PFZ0v/FH4G5nCYvv7TgXUNmakp1Xf0YZ6jfpiUehmBBZLyZSydY3q632 a0W8mZ8/pHPAa36ZEzLAOpsc0hxJYviYb5AYwTCEqe6HX3iUdOzeWbIcpRMLQj/PSSydaLDG2A1 RdcGPp5wGcUnAzQ3VxJR X-Received: by 2002:a05:600c:3d07:b0:439:4700:9eb3 with SMTP id 5b1f17b1804b1-43947009ff1mr66057635e9.3.1739291176667; Tue, 11 Feb 2025 08:26:16 -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.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 08:26:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 18/68] target/arm: Handle FPCR.NEP for 1-input scalar operations Date: Tue, 11 Feb 2025 16:25:04 +0000 Message-Id: <20250211162554.4135349-19-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::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 Handle FPCR.NEP for the 1-input scalar operations. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 61ea2bb9f75..a5f59a94ec2 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8509,17 +8509,17 @@ static bool do_fp1_scalar_with_fpsttype(DisasContext *s, arg_rr_e *a, case MO_64: t64 = read_fp_dreg(s, a->rn); f->gen_d(t64, t64, fpst); - write_fp_dreg(s, a->rd, t64); + write_fp_dreg_merging(s, a->rd, a->rd, t64); break; case MO_32: t32 = read_fp_sreg(s, a->rn); f->gen_s(t32, t32, fpst); - write_fp_sreg(s, a->rd, t32); + write_fp_sreg_merging(s, a->rd, a->rd, t32); break; case MO_16: t32 = read_fp_hreg(s, a->rn); f->gen_h(t32, t32, fpst); - write_fp_sreg(s, a->rd, t32); + write_fp_hreg_merging(s, a->rd, a->rd, t32); break; default: g_assert_not_reached(); @@ -8640,7 +8640,7 @@ static bool trans_FCVT_s_ds(DisasContext *s, arg_rr *a) TCGv_ptr fpst = fpstatus_ptr(FPST_A64); gen_helper_vfp_fcvtds(tcg_rd, tcg_rn, fpst); - write_fp_dreg(s, a->rd, tcg_rd); + write_fp_dreg_merging(s, a->rd, a->rd, tcg_rd); } return true; } @@ -8653,8 +8653,8 @@ static bool trans_FCVT_s_hs(DisasContext *s, arg_rr *a) TCGv_ptr fpst = fpstatus_ptr(FPST_A64); gen_helper_vfp_fcvt_f32_to_f16(tmp, tmp, fpst, ahp); - /* write_fp_sreg is OK here because top half of result is zero */ - write_fp_sreg(s, a->rd, tmp); + /* write_fp_hreg_merging is OK here because top half of result is zero */ + write_fp_hreg_merging(s, a->rd, a->rd, tmp); } return true; } @@ -8667,7 +8667,7 @@ static bool trans_FCVT_s_sd(DisasContext *s, arg_rr *a) TCGv_ptr fpst = fpstatus_ptr(FPST_A64); gen_helper_vfp_fcvtsd(tcg_rd, tcg_rn, fpst); - write_fp_sreg(s, a->rd, tcg_rd); + write_fp_sreg_merging(s, a->rd, a->rd, tcg_rd); } return true; } @@ -8681,8 +8681,8 @@ static bool trans_FCVT_s_hd(DisasContext *s, arg_rr *a) TCGv_ptr fpst = fpstatus_ptr(FPST_A64); gen_helper_vfp_fcvt_f64_to_f16(tcg_rd, tcg_rn, fpst, ahp); - /* write_fp_sreg is OK here because top half of tcg_rd is zero */ - write_fp_sreg(s, a->rd, tcg_rd); + /* write_fp_hreg_merging is OK here because top half of tcg_rd is zero */ + write_fp_hreg_merging(s, a->rd, a->rd, tcg_rd); } return true; } @@ -8696,7 +8696,7 @@ static bool trans_FCVT_s_sh(DisasContext *s, arg_rr *a) TCGv_i32 tcg_ahp = get_ahp_flag(); gen_helper_vfp_fcvt_f16_to_f32(tcg_rd, tcg_rn, tcg_fpst, tcg_ahp); - write_fp_sreg(s, a->rd, tcg_rd); + write_fp_sreg_merging(s, a->rd, a->rd, tcg_rd); } return true; } @@ -8710,7 +8710,7 @@ static bool trans_FCVT_s_dh(DisasContext *s, arg_rr *a) TCGv_i32 tcg_ahp = get_ahp_flag(); gen_helper_vfp_fcvt_f16_to_f64(tcg_rd, tcg_rn, tcg_fpst, tcg_ahp); - write_fp_dreg(s, a->rd, tcg_rd); + write_fp_dreg_merging(s, a->rd, a->rd, tcg_rd); } return true; } @@ -8958,7 +8958,9 @@ static bool do_fcvt_f(DisasContext *s, arg_fcvt *a, do_fcvt_scalar(s, a->esz | (is_signed ? MO_SIGN : 0), a->esz, tcg_int, a->shift, a->rn, rmode); - clear_vec(s, a->rd); + if (!s->fpcr_nep) { + clear_vec(s, a->rd); + } write_vec_element(s, tcg_int, a->rd, 0, a->esz); return true; }