From patchwork Fri Dec 13 17:31:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 850159 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:2c4:b0:385:e875:8a9e with SMTP id o4csp1639909wry; Fri, 13 Dec 2024 09:37:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX0KIX8RjosLawDyWBcWd+TOUAIWDN2vGDkGV6qyYcopgRluJIMX0ryz/qsloDhj0qkW22hCA==@linaro.org X-Google-Smtp-Source: AGHT+IGDu/6OQfuRiP49LN/bRDY3Zpb55LCsHyGuQon9X/uUDj80zdWr1ae8GmD3S164MZngu/Hw X-Received: by 2002:a05:6402:270f:b0:5d0:8f1c:d9d7 with SMTP id 4fb4d7f45d1cf-5d63c3007e4mr7426184a12.4.1734111471902; Fri, 13 Dec 2024 09:37:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734111471; cv=none; d=google.com; s=arc-20240605; b=KXdd+SAzlOJAYrYiT1BNft5O5idruYpETE7Vq4WE8tvd59FsrZL5MJpB8AoLNaw1k0 4h3G2+Tq3K8tGcp0nNgOFFqb66E2lByINjiJ7OkokuXtTjX214YKXQPoy0kbfFl5J4N9 16RkncXgLNJxB/3ylvl54qYlV9kavyqsvdRbLbCK9CcIH0BZ++2u5llQGg6bl802adby Wp+NQQKYWjYzi3//An1B1WzpIKFtQcXpDYC6OEiy3tbvJhTfxjkgNTT29Ja2b5B5RQMg +GWoPkisWcsqwqm2WoBMG3qaMbmnwI8wrhXgpvJwGZ9ORtlqIUD/ns/VYr7ASSkTfthe x3zA== 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=WK+Z64alPo67E0gxwuqk0uYvI1XoxQYQ14C8cyJtCPA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=XYc9sJSUCfkfjLPn4BeYMBMUqmuQLns4BMgg0KnbmcG5H2a4VDwFeCoubXY1dy6tn2 PAvTEoD0aBeD6rLRvJtRHD/qu69rzVihQ0Wzgl+xwi7104n0HAYzDy3sMU29ynq0uYqA m8tDvUZiNF34uuIoVasSLNV+8gp67bhdPSuzgpy+tvY6yDiQZA0twIQJCxVfbP/UZo4q +I61jg/1E+XEn8EBVOqwtWlePS+0Zrl5U0siij5MWnFDNf/CSHqy4cKYjTJxPaPxvQUi VrTP/PlPYer+X7C+DFzNaLyuV4FnwBE3h5c24VbFIbnen/1FqzLs+HVFbQJhSNiHIncU S3Ng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CGXq2vP/"; 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 a640c23a62f3a-aa65d7078f7si969169666b.777.2024.12.13.09.37.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Dec 2024 09:37:51 -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="CGXq2vP/"; 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 1tM9YL-0001TW-Cu; Fri, 13 Dec 2024 12:34:13 -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 1tM9Xb-0007R0-1m for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:27 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tM9XZ-0001dk-4U for qemu-devel@nongnu.org; Fri, 13 Dec 2024 12:33:26 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-435004228c0so24464155e9.0 for ; Fri, 13 Dec 2024 09:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734111202; x=1734716002; 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=WK+Z64alPo67E0gxwuqk0uYvI1XoxQYQ14C8cyJtCPA=; b=CGXq2vP/TXmmy0mjyzlIStGtzCj+dsmbZgd/vDQcYMiSMsrzrCcTqNqrPsyJtPCrde WuAmKgsq+wvg/FKLyHiGg/dIsdvee8aozpHShwEajVh6+x4aeaCfXSN++3+LYppE25/1 8EWi3JpzYWZ4S2R5IvaKJChPX5sDhS+Qdu2jeYemKI5yTieR0W1iLwgysM7d25NDdTbX optK/U7deo6J7sjrMDpPqWBLps9j0mbX2AFq6x/ui9KEQkYqgHJDQpq+zmTdyx7duSXH P1EnLBCPJxS60ucT4OB4iSZ5Rserp0oKgg8k8Gi3rf+XJYmhQACHVCJ8tWPyf5DC8p9Q Q52A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734111202; x=1734716002; 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=WK+Z64alPo67E0gxwuqk0uYvI1XoxQYQ14C8cyJtCPA=; b=QzZZ0EOZazZD6v/2e08rjFSyDO0gnEbxc5IdtEH62Hsog0gxswXC8n32Fje7MlWn4H JBq5o/QQA4HjULEfmJAR2vx9yq7HmUahNBOER/s8zZAi+5Qsidu9JJhsM9PcfyQ1K7KF 59sb3hVDvOFO0AeROnJKxbKBQ4jLSRoB+KmyN3g/3QUWDuGOOWh4FvcBGQCkaRulga9v GQ/JjOeE/bHh2+T+Qjnqfq/XESonOxtxPEec3Vqh0OM4YjKyw2RExCKSo27pLW5WZRPk dOr2Q+W9cYsX39mlHqWiE/UNii5FKeHe6uJ93nFzGvJHSPJx8bfhqmDoi9KkQ/X/rHYg HVfw== X-Gm-Message-State: AOJu0YwheO5daNt89hI06K37eQX/C7eZLG3XvJaKdJyretYyFXahx8YK Qp7q3e7lHnGZKxHmfDvOdpLp3qfiOvADiQsW86iM7e4KUT8btHNn4F62cV5SQn3oPhLiBpRGv+C R X-Gm-Gg: ASbGncszsavereqayUzgXEnrQWHSPCXFLZFVF4tmE3oY/NVoIu0ff6NUtLcBXmAncax QC48aOCgOf6x0WhceURfap3XwbfG04MzfOyVlswaFsIGRLLTgSpcQwet+GtYIJHR85aDqsOcZ0O uIzLUinxyQNXHJQUFLW3vRtF6lyMYT5tPOE21jXRXeUbAFKd0QEpOAX7gmmy3Ye7+12fi/64OKF nwRTMGT3ouAJhyzY07X9cfJhYW6CsiuFf+WnpIO1y4VWVuD1m6oSWLWZ7sqZA== X-Received: by 2002:a05:6000:4615:b0:386:605:77e with SMTP id ffacd0b85a97d-3888e0bfb19mr3227471f8f.49.1734111202617; Fri, 13 Dec 2024 09:33:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c80162ddsm87026f8f.37.2024.12.13.09.33.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Dec 2024 09:33:21 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 47/85] target/arm: Remove helper_neon_{add,sub}l_u{16,32} Date: Fri, 13 Dec 2024 17:31:51 +0000 Message-Id: <20241213173229.3308926-48-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241213173229.3308926-1-peter.maydell@linaro.org> References: <20241213173229.3308926-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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 From: Richard Henderson These have generic equivalents: tcg_gen_vec_{add,sub}{16,32}_i64. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20241211163036.2297116-48-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.h | 4 ---- target/arm/tcg/neon_helper.c | 36 --------------------------------- target/arm/tcg/translate-neon.c | 22 ++++++++++---------- 3 files changed, 11 insertions(+), 51 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index 6369d07d053..04e422ab081 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -395,12 +395,8 @@ DEF_HELPER_1(neon_widen_s8, i64, i32) DEF_HELPER_1(neon_widen_u16, i64, i32) DEF_HELPER_1(neon_widen_s16, i64, i32) -DEF_HELPER_2(neon_addl_u16, i64, i64, i64) -DEF_HELPER_2(neon_addl_u32, i64, i64, i64) DEF_HELPER_FLAGS_1(neon_addlp_s8, TCG_CALL_NO_RWG_SE, i64, i64) DEF_HELPER_FLAGS_1(neon_addlp_s16, TCG_CALL_NO_RWG_SE, i64, i64) -DEF_HELPER_2(neon_subl_u16, i64, i64, i64) -DEF_HELPER_2(neon_subl_u32, i64, i64, i64) DEF_HELPER_3(neon_addl_saturate_s32, i64, env, i64, i64) DEF_HELPER_3(neon_addl_saturate_s64, i64, env, i64, i64) DEF_HELPER_2(neon_abdl_u16, i64, i32, i32) diff --git a/target/arm/tcg/neon_helper.c b/target/arm/tcg/neon_helper.c index 1a22857b5eb..c687e882ad9 100644 --- a/target/arm/tcg/neon_helper.c +++ b/target/arm/tcg/neon_helper.c @@ -826,24 +826,6 @@ uint64_t HELPER(neon_widen_s16)(uint32_t x) return ((uint32_t)(int16_t)x) | (high << 32); } -uint64_t HELPER(neon_addl_u16)(uint64_t a, uint64_t b) -{ - uint64_t mask; - mask = (a ^ b) & 0x8000800080008000ull; - a &= ~0x8000800080008000ull; - b &= ~0x8000800080008000ull; - return (a + b) ^ mask; -} - -uint64_t HELPER(neon_addl_u32)(uint64_t a, uint64_t b) -{ - uint64_t mask; - mask = (a ^ b) & 0x8000000080000000ull; - a &= ~0x8000000080000000ull; - b &= ~0x8000000080000000ull; - return (a + b) ^ mask; -} - /* Pairwise long add: add pairs of adjacent elements into * double-width elements in the result (eg _s8 is an 8x8->16 op) */ @@ -887,24 +869,6 @@ uint64_t HELPER(neon_addlp_s16)(uint64_t a) return (uint32_t)reslo | (((uint64_t)reshi) << 32); } -uint64_t HELPER(neon_subl_u16)(uint64_t a, uint64_t b) -{ - uint64_t mask; - mask = (a ^ ~b) & 0x8000800080008000ull; - a |= 0x8000800080008000ull; - b &= ~0x8000800080008000ull; - return (a - b) ^ mask; -} - -uint64_t HELPER(neon_subl_u32)(uint64_t a, uint64_t b) -{ - uint64_t mask; - mask = (a ^ ~b) & 0x8000000080000000ull; - a |= 0x8000000080000000ull; - b &= ~0x8000000080000000ull; - return (a - b) ^ mask; -} - uint64_t HELPER(neon_addl_saturate_s32)(CPUARMState *env, uint64_t a, uint64_t b) { uint32_t x, y; diff --git a/target/arm/tcg/translate-neon.c b/target/arm/tcg/translate-neon.c index 19a18018f1a..0821f10fad5 100644 --- a/target/arm/tcg/translate-neon.c +++ b/target/arm/tcg/translate-neon.c @@ -1560,8 +1560,8 @@ static bool do_prewiden_3d(DisasContext *s, arg_3diff *a, NULL, NULL, \ }; \ static NeonGenTwo64OpFn * const addfn[] = { \ - gen_helper_neon_##OP##l_u16, \ - gen_helper_neon_##OP##l_u32, \ + tcg_gen_vec_##OP##16_i64, \ + tcg_gen_vec_##OP##32_i64, \ tcg_gen_##OP##_i64, \ NULL, \ }; \ @@ -1639,8 +1639,8 @@ static bool do_narrow_3d(DisasContext *s, arg_3diff *a, static bool trans_##INSN##_3d(DisasContext *s, arg_3diff *a) \ { \ static NeonGenTwo64OpFn * const addfn[] = { \ - gen_helper_neon_##OP##l_u16, \ - gen_helper_neon_##OP##l_u32, \ + tcg_gen_vec_##OP##16_i64, \ + tcg_gen_vec_##OP##32_i64, \ tcg_gen_##OP##_i64, \ NULL, \ }; \ @@ -1761,8 +1761,8 @@ static bool trans_VABAL_S_3d(DisasContext *s, arg_3diff *a) NULL, }; static NeonGenTwo64OpFn * const addfn[] = { - gen_helper_neon_addl_u16, - gen_helper_neon_addl_u32, + tcg_gen_vec_add16_i64, + tcg_gen_vec_add32_i64, tcg_gen_add_i64, NULL, }; @@ -1779,8 +1779,8 @@ static bool trans_VABAL_U_3d(DisasContext *s, arg_3diff *a) NULL, }; static NeonGenTwo64OpFn * const addfn[] = { - gen_helper_neon_addl_u16, - gen_helper_neon_addl_u32, + tcg_gen_vec_add16_i64, + tcg_gen_vec_add32_i64, tcg_gen_add_i64, NULL, }; @@ -1840,8 +1840,8 @@ static bool trans_VMULL_U_3d(DisasContext *s, arg_3diff *a) NULL, \ }; \ static NeonGenTwo64OpFn * const accfn[] = { \ - gen_helper_neon_##ACC##l_u16, \ - gen_helper_neon_##ACC##l_u32, \ + tcg_gen_vec_##ACC##16_i64, \ + tcg_gen_vec_##ACC##32_i64, \ tcg_gen_##ACC##_i64, \ NULL, \ }; \ @@ -2371,7 +2371,7 @@ static bool trans_VMULL_U_2sc(DisasContext *s, arg_2scalar *a) }; \ static NeonGenTwo64OpFn * const accfn[] = { \ NULL, \ - gen_helper_neon_##ACC##l_u32, \ + tcg_gen_vec_##ACC##32_i64, \ tcg_gen_##ACC##_i64, \ NULL, \ }; \