From patchwork Tue Feb 11 16:25:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 864111 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1289:b0:385:e875:8a9e with SMTP id f9csp328783wrx; Tue, 11 Feb 2025 08:37:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV/cjW3UAtpRd/N8hA+t0jSU1z+e3YT13v43Gr2IUAwefMJibFbUUy+LP8zDF2cAqeraJWqRw==@linaro.org X-Google-Smtp-Source: AGHT+IFRxpjV+ZSXkNW6eizRCvPvTCesXtOyGR/RzzxDNPx9ZPqkB2KVT/vTS2A0hmp+qPg1LhiM X-Received: by 2002:a05:622a:5a8c:b0:467:517b:90ca with SMTP id d75a77b69052e-471a141a8b9mr60973311cf.21.1739291847485; Tue, 11 Feb 2025 08:37:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1739291847; cv=none; d=google.com; s=arc-20240605; b=lHkj3e7VZRlfROVzdRGWrtm/V/m+s6IpziuiZrUH20UsbqLyDk1Tgg3gwghoW6MAbq o0kC4Ebbax+BOGZycJTkkdrKh4EYOzq1bBTuNy/Y2jPwG/hWiTlATCgXYAaj57s9hxlt e6iL4dGgU8rYtDXC72l5SwZNBZq5/6TG//7FZTulABqukKd6THS/tvwgXs7jIGHEYGo8 r4yo3S7j3h14PV5kvzAcFSQi7rEFNuSNRKZN5RtkOhiDUR4v+hGscrI/UJUygyxzpW2k yYA3ccCwkS2W0g5c4okKhpw8iDymXs8NfwGnP9aTrrW6B+pomXGgMnhQCogYk1vOgHH0 Xsdw== 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=OYapsXWWu8r+6NSGgdddbEDpLTmPdprJZCqNJSzTqPo=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Bcl16lpQePEow4xUCE4nWX9pccOKp+O+BSXlVPTuuu0TBMiz05CnAg/J7x+8M9eyWQ QGDLP+M77aL/6fx4Ji3ohg+cDFpqPyy26cm2Mlwd/hbbyjTDryUPc+jkdyNXxLqSGCde pLGwe9xdz74Ij1JsBwEdXPi3AuKaxOHPUxMPAKAxulMzkoNFQPI0fDzuPIfy/pS7r6zs Vbvfe4PTwc8Eki/h4jG6+7Mi0zuie5DkeXOkGap/0vIN9lH6LdkQhQd8EOtcKjOvSTpv 7mN42sVqUTM6W/DXNunyV4B2TLvsx+TZS+/++iZXiZY9feIMS4f1dp5Mudmc8JAkefOL UMvw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JLjhySCN; 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-47153bbb4absi114617001cf.477.2025.02.11.08.37.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Feb 2025 08:37:27 -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=JLjhySCN; 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 1tht6T-0007Tk-A8; Tue, 11 Feb 2025 11:27:17 -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 1tht5e-0006Vr-5k for qemu-devel@nongnu.org; Tue, 11 Feb 2025 11:26:26 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tht5c-00039l-GK for qemu-devel@nongnu.org; Tue, 11 Feb 2025 11:26:25 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-43955067383so6056105e9.0 for ; Tue, 11 Feb 2025 08:26:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1739291183; x=1739895983; 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=OYapsXWWu8r+6NSGgdddbEDpLTmPdprJZCqNJSzTqPo=; b=JLjhySCNRtduZH4WEbpm4pJedp9ewvVaO8Gzn4qUuiO6xdwMp7nHRYoYVgAei/sewb o6RI2jvyzhroJCIHBg7+Wxuwk9l/PK2KopDdzcDc1A5lqLKVqE44zbawmjJJWnR40i+N QpLHd+91RNDgSw8iHJFaAP7Vy/C8VR+OGmOWLd4n2WnUoHxFJ+Kg5BeoYZ3FsLWH/pX5 u0ucjl6uExwc0gMkaGGmHPXEZVnDZ8hgKnmKvA0SpG6oJKrBdiuNHDbM6558sqLM0rKT cYQLy7RHhPxIrppwvToj5STOcRXVudsuvbz3kc2yovNXk7hlMxcbOhhXSYDzXbpZU+Sp 4Rig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739291183; x=1739895983; 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=OYapsXWWu8r+6NSGgdddbEDpLTmPdprJZCqNJSzTqPo=; b=SDOk67yW9aJYHCxu78oYYFc0lA57pCmH3CZA3ac1RlBrUgI6BlYhTwp772VeeNPoe2 IrLqdqHrar377qIP1RR7tX0DpKBgOnhMtDTvsASJW1fx6XeefvHFdk3C+8jendEHJIDc uHWw2WWRXjIPniQattiPq8B5k2+b58od/8I8cJjhvX0WsEF7EjAjVjP2VtFxPF8A8JPq FTIhMjnS84p4eohFUKLOoMG+E3CLSwbySrS4sTcXzRjwJicNDPq34m7UF/rSEZcLqWTB CopHuCD/V8ZLAZtp0OClEbUHp0tZJFYZl5mLf7EoJ5RzhHDTuVBcEFDY8Eu9ZHRz/jzl YFHg== X-Gm-Message-State: AOJu0YzOlrVtD+Ewc8WaqBph/Dxl6bEKJ6MrEiX7t9gk4Mue45Kq71mL 9Kqrmbelqjy/fViZH5n6qczlwKJ8V8hzm0jJddPnFIuRLdZk7crY705HBqFOuE+QsUu0pCiQkI2 U X-Gm-Gg: ASbGncuToc+mfx+Ivb8UEb6/QTrj7uPulS0GvAbodJduYB+KJoRSzpKVG11CLeSLFIv V3OBRd9i5bhRURlSFjS+6Z2SsNgdL6n7ZCORAITR3/NR2kGMt7x6PJv8ib7LdkmJNPjjqKADTiD WdHrn/Upe6SrtlbcZnG3hPeaPNxeYTXe+yf4e+AN81glfSOeHdYBE5V8hyoS07mFK0//8WmF6rS p+caxgZsdnmdlQxDnxMhYPMTmnoeJd6rGyuupWXV0bBWbXh65n1Tm4bWgmCFXLbjFtLolCPZnGC Jv8WYNggSo8SjlvaoddD X-Received: by 2002:a05:600c:354c:b0:439:4b9a:a9fb with SMTP id 5b1f17b1804b1-4394c85448fmr51735635e9.30.1739291182870; Tue, 11 Feb 2025 08:26:22 -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.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 08:26:22 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 25/68] target/arm: Implement FPCR.AH semantics for FMAXV and FMINV Date: Tue, 11 Feb 2025 16:25:11 +0000 Message-Id: <20250211162554.4135349-26-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::334; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x334.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 Implement the FPCR.AH semantics for FMAXV and FMINV. These are the "recursively reduce all lanes of a vector to a scalar result" insns; we just need to use the _ah_ helper for the reduction step when FPCR.AH == 1. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/arm/tcg/translate-a64.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 24695ab55b6..4ae0426bf76 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7018,27 +7018,35 @@ static TCGv_i32 do_reduction_op(DisasContext *s, int rn, MemOp esz, } static bool do_fp_reduction(DisasContext *s, arg_qrr_e *a, - NeonGenTwoSingleOpFn *fn) + NeonGenTwoSingleOpFn *fnormal, + NeonGenTwoSingleOpFn *fah) { if (fp_access_check(s)) { MemOp esz = a->esz; int elts = (a->q ? 16 : 8) >> esz; TCGv_ptr fpst = fpstatus_ptr(esz == MO_16 ? FPST_A64_F16 : FPST_A64); - TCGv_i32 res = do_reduction_op(s, a->rn, esz, 0, elts, fpst, fn); + TCGv_i32 res = do_reduction_op(s, a->rn, esz, 0, elts, fpst, + s->fpcr_ah ? fah : fnormal); write_fp_sreg(s, a->rd, res); } return true; } -TRANS_FEAT(FMAXNMV_h, aa64_fp16, do_fp_reduction, a, gen_helper_vfp_maxnumh) -TRANS_FEAT(FMINNMV_h, aa64_fp16, do_fp_reduction, a, gen_helper_vfp_minnumh) -TRANS_FEAT(FMAXV_h, aa64_fp16, do_fp_reduction, a, gen_helper_vfp_maxh) -TRANS_FEAT(FMINV_h, aa64_fp16, do_fp_reduction, a, gen_helper_vfp_minh) +TRANS_FEAT(FMAXNMV_h, aa64_fp16, do_fp_reduction, a, + gen_helper_vfp_maxnumh, gen_helper_vfp_maxnumh) +TRANS_FEAT(FMINNMV_h, aa64_fp16, do_fp_reduction, a, + gen_helper_vfp_minnumh, gen_helper_vfp_minnumh) +TRANS_FEAT(FMAXV_h, aa64_fp16, do_fp_reduction, a, + gen_helper_vfp_maxh, gen_helper_vfp_ah_maxh) +TRANS_FEAT(FMINV_h, aa64_fp16, do_fp_reduction, a, + gen_helper_vfp_minh, gen_helper_vfp_ah_minh) -TRANS(FMAXNMV_s, do_fp_reduction, a, gen_helper_vfp_maxnums) -TRANS(FMINNMV_s, do_fp_reduction, a, gen_helper_vfp_minnums) -TRANS(FMAXV_s, do_fp_reduction, a, gen_helper_vfp_maxs) -TRANS(FMINV_s, do_fp_reduction, a, gen_helper_vfp_mins) +TRANS(FMAXNMV_s, do_fp_reduction, a, + gen_helper_vfp_maxnums, gen_helper_vfp_maxnums) +TRANS(FMINNMV_s, do_fp_reduction, a, + gen_helper_vfp_minnums, gen_helper_vfp_minnums) +TRANS(FMAXV_s, do_fp_reduction, a, gen_helper_vfp_maxs, gen_helper_vfp_ah_maxs) +TRANS(FMINV_s, do_fp_reduction, a, gen_helper_vfp_mins, gen_helper_vfp_ah_mins) /* * Floating-point Immediate