From patchwork Sat Feb 1 16:39:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 861234 Delivered-To: patch@linaro.org Received: by 2002:adf:fb05:0:b0:385:e875:8a9e with SMTP id c5csp1262530wrr; Sat, 1 Feb 2025 08:42:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUwoc+YktbKdq8VVjfqNL+jGVOBNbdVJ20Gw5D5i+OOvPJ6SkC9+4zF5MAHG55ESMCzfMfFsw==@linaro.org X-Google-Smtp-Source: AGHT+IHIdLlkNPaAPofg6DbaRF9pzGfSumgA2IuokJTJ8MxqAqql5Lgw8CyflKEvFjQtzvb8NPPi X-Received: by 2002:ad4:5c4e:0:b0:6d8:a76d:b66c with SMTP id 6a1803df08f44-6e243c949d8mr198907146d6.30.1738428124949; Sat, 01 Feb 2025 08:42:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738428124; cv=none; d=google.com; s=arc-20240605; b=S5+ROcQQRdlICVL4W2m7StwGTpIa36FEav254HobqqtCfYTVD1l+SEpVQvxErdwDiF b+cBBj3/tXfMEm8lTz/aNxRyYVmqU7TmyPw+Lc/4F5eDrLhJnxPtRP7na0tc3no6boWW Dxif7BVaDqMud24VUpD+Z/C++9akRiJd1WYl6eXw7H3WRT+nCrHp8TUmrl3STu7hJzTv xqk9f7oQw1bzDLW4zNvAt5hTSzwNRpuhznA0iZzAqxwgfN1KSsF7Fm2hWNXxNKl1S5u8 phXVWKwlSK21ZCrgRfI+TEjW3zaAnlcxQyDCeSJXeH2HzMb2xF2klSHooMuOOhPETrjS r0Gg== 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=PiC8b+hxDayGjJ/0/ccDWcMdvLrmbzc3zVuQjWwGjhM=; fh=CbC3c2K+ZV56WfmFh6z3k2JRn5MuU7vxooQr8KdhHuY=; b=TwU7EbLWdi704lgbh7BFgweVziul6COJKzZbxRv0XgLwM2Ybznm6fJfW4bi/YZzQXE w0sUWVSxFISJ9yixSswVk/aUu1ybhiWSUIHaC8apDcsYWziOOPZUVU97vVQK4Vq9xsCV O2wbqvC2hjroL8eH+XGnbswt5f1YxY1mNYBwbKKwU791E1QK8hIAT8eV2Wb/h91r+XIM 5Ml0Tl4yZpixXs5BtZbxZRJmMNTcf0TsdD59zmsG6ahsG1EmrcbjR64Jcom9yunqMao4 kScZgLqHoMQF5aW1pGUN9bcd/DEclZEoCRABVm1bIiXNNjHdKLMSp0tm40BgcTxAAzQf eP1g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=g6cZQEK0; 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-6e2549719bdsi59161046d6.252.2025.02.01.08.42.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Feb 2025 08:42:04 -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=g6cZQEK0; 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 1teGYF-0006QM-Al; Sat, 01 Feb 2025 11:40:59 -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 1teGY9-0006Hl-8t for qemu-devel@nongnu.org; Sat, 01 Feb 2025 11:40:53 -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 1teGY7-0001AZ-Nn for qemu-devel@nongnu.org; Sat, 01 Feb 2025 11:40:52 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso18602555e9.1 for ; Sat, 01 Feb 2025 08:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738428050; x=1739032850; 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=PiC8b+hxDayGjJ/0/ccDWcMdvLrmbzc3zVuQjWwGjhM=; b=g6cZQEK0nD6Hp9l7FrVHt07tb06olo9Dn1+kxvKp/2IDziU/Z1I1EXl7bx74y/pkNh Z+EH/+M/twVFBKas1kgR+rFxzVfiqR3OGUdrNqhRJu+3Ni9TjEIWWNUKQr4ytoQ9Waw+ B89tnDOm32x1oUUA7XFyHzIQBCKD86Rnzmz5AjlfLG3fKvakZVrXQmJEPEY/ZA3fKyh2 6TBG3iah1+rfg+RR73c1+h6hzKl8C14PxYReqlfFE3ohfRYqUwwsVtc4xuLytQg38KOo nxpl/WWzHgtrRBs8hO69qKcDNA2gyyUue5lTPg0a9Ye+MHGwf9OQe79WbBq+3rK8AZMg mdig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738428050; x=1739032850; 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=PiC8b+hxDayGjJ/0/ccDWcMdvLrmbzc3zVuQjWwGjhM=; b=FMidDx8zS8XLhXyrS0XxZlXRYM38iIOp+kqHGT5sImVfq8V5wr13cOg6VGhIr8FWdA pcatZWta0XwHwfvx3nuLjFe2GLwWUHI7Gk++TvKbivryonuHypQPAreiv2uHJQDriWLi Ti+1jrNDzUMKOqSe9wlu6iWtSnEzDAhlOwiKlJfu+fsJIDcAW5k7qwnK59YIx4AkzMzJ pJWQP43V6wA78UC3N6n3ZpRiT8FKuz6dPvOnxYhBDX8XbgQNIqXGC1iteS8YUr0M30Dm fYg/t2o4DEoAa/jwjPLXqM01JL2km8rr+MMXgIK51/FJ1HQf+tDMa1juMfEP4duNsbDo 2egA== X-Forwarded-Encrypted: i=1; AJvYcCXa4I1bcHoxjfbiypQHhOalwzos9kYy6IHZ6cBo+VHMPU6fA+ESD2JRPzgWJj1rh9sGsCvo4lEN7hcu@nongnu.org X-Gm-Message-State: AOJu0Yz9ZN3XlP2vCZ6w4XkntNIz1/rdBqENINvtdhpVFyVkYiExE6h0 WG/uS6mGgVzaqsGWW1dLSHIIj5/rUj4je6R6VY55aCAxPwo27JwuUe2XsGC39Km00TbGV8synhk G X-Gm-Gg: ASbGncu3rYE+GjyAY78vVW6lVmFFVqjpvEo0lMatfaAnaLQhMjwoD45psfJR+sCLXcN Cz3GcJNS3I5ytR8QeqdWX4VnC5yHtoM7NNnoEZhMCSoycr3Ba80TnsfzJxfhVvFPqMOSzeqF6JV /pmdcXdJpynqzMWsA0cKuzNqF6HcZJzioQxUt86A8BF2lMlV5vAaxeOFQtwQDuJe7Jq+3r7nVae cCj5JeT/Mo9c43nj5AfYo/J6tVmI0u7c8WVeI/JREQtV1R+bw30JHde89Ai0ySHoIvc4YnFm/xg CRM5TbGjG6AXpcwwpFVH X-Received: by 2002:a05:600c:45cc:b0:434:e892:1033 with SMTP id 5b1f17b1804b1-438e6ea8c74mr59945075e9.2.1738428050254; Sat, 01 Feb 2025 08:40:50 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438dcc81d74sm127401525e9.37.2025.02.01.08.40.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Feb 2025 08:40:49 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 26/69] target/arm: Implement FPCR.AH semantics for FMAXV and FMINV Date: Sat, 1 Feb 2025 16:39:29 +0000 Message-Id: <20250201164012.1660228-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250201164012.1660228-1-peter.maydell@linaro.org> References: <20250201164012.1660228-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 cad9883f7dc..80a6562ed51 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -7029,27 +7029,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