From nobody Sat Apr 5 01:27:41 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1739291846; cv=none; d=zohomail.com; s=zohoarc; b=oBY/8D/MG7kLgpyE+4IqmqL087xR1HYPZHpOSq37mWzAq5D2u9UQQvdTE5xacuVQ4ZVNY0Oe1YmuLzjhlkGyF4k5qkeNXH3oSuGxZHPzFlaibLwKFeTZdMHcKTnO5d44eMad68UcO6VlPG0H6pFOb7CwlN3lMz0G+vmuv0WV0SY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1739291846; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=OYapsXWWu8r+6NSGgdddbEDpLTmPdprJZCqNJSzTqPo=; b=JPbcLdU/4TZodmPyTKND/ZlUJrMW9ie0gNQ3MRjz7NNprmAR6r7gRQOxrZtp0a5x3RqOeTqA8yu7wDN5/U6ODy7+MbVL28tqpMafySj0Z+IdL+wKUj9gjCDUfSZJoaRY5NBTCnfQDMK8g1A9cOW6xNu0STabLcvG2rzSoss/XAY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1739291846471594.5043380348529; Tue, 11 Feb 2025 08:37:26 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IHkVw6zMlvJvYYJPFW1UAoGyvaD437l3iCkbW68enPuW1T0L4ntEuvkUtT9GvtpnndOftvZsA== 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) 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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1739291873798019000 Content-Type: text/plain; charset="utf-8" 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 =3D=3D 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, in= t rn, MemOp esz, } =20 static bool do_fp_reduction(DisasContext *s, arg_qrr_e *a, - NeonGenTwoSingleOpFn *fn) + NeonGenTwoSingleOpFn *fnormal, + NeonGenTwoSingleOpFn *fah) { if (fp_access_check(s)) { MemOp esz =3D a->esz; int elts =3D (a->q ? 16 : 8) >> esz; TCGv_ptr fpst =3D fpstatus_ptr(esz =3D=3D MO_16 ? FPST_A64_F16 : F= PST_A64); - TCGv_i32 res =3D do_reduction_op(s, a->rn, esz, 0, elts, fpst, fn); + TCGv_i32 res =3D do_reduction_op(s, a->rn, esz, 0, elts, fpst, + s->fpcr_ah ? fah : fnormal); write_fp_sreg(s, a->rd, res); } return true; } =20 -TRANS_FEAT(FMAXNMV_h, aa64_fp16, do_fp_reduction, a, gen_helper_vfp_maxnum= h) -TRANS_FEAT(FMINNMV_h, aa64_fp16, do_fp_reduction, a, gen_helper_vfp_minnum= h) -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) =20 -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) =20 /* * Floating-point Immediate --=20 2.34.1