From patchwork Mon Aug 21 16:18:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 715383 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1924961wrs; Mon, 21 Aug 2023 09:19:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNsebZzcweUsVmWXB4iYmjkC6IUn9UkGBTQMvMxTm/rVjdpBrCgF+4qkk73SZHmV/UzKfK X-Received: by 2002:ac8:7d84:0:b0:402:2e84:f06e with SMTP id c4-20020ac87d84000000b004022e84f06emr8114981qtd.27.1692634799416; Mon, 21 Aug 2023 09:19:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692634799; cv=none; d=google.com; s=arc-20160816; b=t1VR9K5JsYfhakbHz/FUOiq+wSUUugn1iZm31b2sh/QbUbKX6COuWYvDEMmZkXs7EU cvI+VQYzV+td1c2h5se5mRgyEKbppPQhiBqF9MHB3rGDzJBUQdN3TUSatMsrPOS4wU7x hze899kKzjJbul9tHPKT0aPSbG2q9Wi1RFPmTftKZ+FlLFy7sskT+p1bOd0oj2GOUde/ AaiYVWKujWuUN0UUOh8BKMntfiuSnCmVuieeQfV+fAbriRfKiJ69iBjOud3pQgSs0DmB jzSzmN4cWX+RNWm/cDOxanwHK+BgxJJXdhAAL1D1NZV/b9qYtdUPYrbBCGXVuUvtZoTn x32Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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:cc:to :from:dkim-signature; bh=iPO8TcwjCQpKboJkMUgpUg7QTAvab+8lUqTEXa4XMVA=; fh=ihrF4BApiA3Z+XvqRPGwUXuGbDlKBmHEuYVfGNAjZIQ=; b=BviDyc27jMn9O0eiohzCnNX1lnooOa0e7qMrn4ol2nMiEo4lhn71K9zvqACTKfEIAi V4vvvtTU8tg9vbKHOddN/TJRCNZVC3iXQLKLBpgOk5mCr6VcPtCTqFHr/aB8rTOm+SnK Kdg1GxNpeL4HuY41xlFbItf5hUhEDxqCEAIa7KNHSJ2m33HLwwgMNnB+vHSPOw4CIxAQ 079kp3Vty1Rz2Ocs7rUJcZZMJ3qR3PmlZ5EYfqyJvIn/qy8B6FtS6fioUoxJfDI2T02K o44QmMadkLL2IU6cY4m1twyvkbfXbh4PaPH/Ai0d3qqStuypudXQ54mvlKRlp2PanQCd Spdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i9Pul3Ab; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l18-20020a05622a175200b0041095900432si1950300qtk.776.2023.08.21.09.19.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Aug 2023 09:19:59 -0700 (PDT) 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=i9Pul3Ab; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qY7cm-0001Wl-OC; Mon, 21 Aug 2023 12:19:28 -0400 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 1qY7cP-0001Tm-6n for qemu-devel@nongnu.org; Mon, 21 Aug 2023 12:19:05 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qY7cM-0005bw-JM for qemu-devel@nongnu.org; Mon, 21 Aug 2023 12:19:04 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1bdf4752c3cso18697195ad.2 for ; Mon, 21 Aug 2023 09:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692634741; x=1693239541; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iPO8TcwjCQpKboJkMUgpUg7QTAvab+8lUqTEXa4XMVA=; b=i9Pul3Abu2Ih4oaJAslQeER23SCU1VmvZM7Y5D30Y6DYKiqjKAPycL898FqD6Yrswk WtTxnlqy/CQZnrUQvp+7ToVsCOBVPBUmBRayPEVrpxRkRPoXwSSM7ff4CNsp3L9Ylbh4 IErifGiIs4tfi1euqT+9QWZ622G5PWEIwsl0NcCn4mkpRD1bbxtL+UtfrwmH3fYL3xAZ EYDWmfQ0BzCz/pSoYzhWr8kgXp9xBuAbD8R+B07gR5UkV/L+xbulczPKWHSDeMFSUJFm GjwYJBzQ0RmVwYYArS3/liRh0H3I6CV2Jhwd+W0uCw/Cn2r3nUpZraZ2d9bvJ5ZNHx6l mQ8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634741; x=1693239541; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iPO8TcwjCQpKboJkMUgpUg7QTAvab+8lUqTEXa4XMVA=; b=CqEiOareqFntWce0MDqCF5MphP8y2qdnfTKoRUqiIeELsxc21JvUaI5Vf6HK4YxAzu KFIYkZCq3xUgtlpVpKhPiSk7bjD9gnx8lP1nJ8o3AxNeq22kn9+wZi8gvylOvQOkyu1S Tr8oTQyrVpQfFJ5+fnBh2j8xBv4FATBq2LI3NLbhawDU+FZTSFyeUjVlupfjcnQF5ga8 5vNln62EiJlnxA0kc0+TwHPlXfRoNXDQgeqQxMn+ehFp8P58QeaC9+ihLX5FGWtI/vpg 2rljaJ2YwBRij6kWnTNUWQxaBWxyCD+JyjjWhyA1I5vsFzsX1gZD+/eXTSaPAPxVMnSg nkQA== X-Gm-Message-State: AOJu0Yw4cG/0Q2w0vqsvsosrTZLvqbAgPj1Sc2sQFwR2rDyrzR4M0qvG tbldTyk/ZmDthuqUhniB1zrF6u77hkFeuA3pUAU= X-Received: by 2002:a17:903:11cc:b0:1b9:da8b:4eac with SMTP id q12-20020a17090311cc00b001b9da8b4eacmr4743575plh.56.1692634741170; Mon, 21 Aug 2023 09:19:01 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:2c08:e710:4459:46f1]) by smtp.gmail.com with ESMTPSA id e16-20020a17090301d000b001ab2b4105ddsm7234549plh.60.2023.08.21.09.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:19:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: berrange@redhat.com, ardb@kernel.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v3 06/19] target/arm: Use clmul_16* routines Date: Mon, 21 Aug 2023 09:18:40 -0700 Message-Id: <20230821161854.419893-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821161854.419893-1-richard.henderson@linaro.org> References: <20230821161854.419893-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 Use generic routines for 16-bit carry-less multiply. Remove our local version of pmull_w. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/vec_internal.h | 6 ------ target/arm/tcg/mve_helper.c | 8 ++------ target/arm/tcg/vec_helper.c | 13 ------------- 3 files changed, 2 insertions(+), 25 deletions(-) diff --git a/target/arm/tcg/vec_internal.h b/target/arm/tcg/vec_internal.h index c4afba6d9f..3ca1b94ccf 100644 --- a/target/arm/tcg/vec_internal.h +++ b/target/arm/tcg/vec_internal.h @@ -219,12 +219,6 @@ int16_t do_sqrdmlah_h(int16_t, int16_t, int16_t, bool, bool, uint32_t *); int32_t do_sqrdmlah_s(int32_t, int32_t, int32_t, bool, bool, uint32_t *); int64_t do_sqrdmlah_d(int64_t, int64_t, int64_t, bool, bool); -/* - * 16 x 16 -> 32 vector polynomial multiply where the inputs are - * in the low 16 bits of each 32-bit element - */ -uint64_t pmull_w(uint64_t op1, uint64_t op2); - /** * bfdotadd: * @sum: addend diff --git a/target/arm/tcg/mve_helper.c b/target/arm/tcg/mve_helper.c index 96ddfb4b3a..c666a96ba1 100644 --- a/target/arm/tcg/mve_helper.c +++ b/target/arm/tcg/mve_helper.c @@ -985,14 +985,10 @@ DO_2OP_L(vmulltuw, 1, 4, uint32_t, 8, uint64_t, DO_MUL) * Polynomial multiply. We can always do this generating 64 bits * of the result at a time, so we don't need to use DO_2OP_L. */ -#define VMULLPW_MASK 0x0000ffff0000ffffULL -#define DO_VMULLPBW(N, M) pmull_w((N) & VMULLPW_MASK, (M) & VMULLPW_MASK) -#define DO_VMULLPTW(N, M) DO_VMULLPBW((N) >> 16, (M) >> 16) - DO_2OP(vmullpbh, 8, uint64_t, clmul_8x4_even) DO_2OP(vmullpth, 8, uint64_t, clmul_8x4_odd) -DO_2OP(vmullpbw, 8, uint64_t, DO_VMULLPBW) -DO_2OP(vmullptw, 8, uint64_t, DO_VMULLPTW) +DO_2OP(vmullpbw, 8, uint64_t, clmul_16x2_even) +DO_2OP(vmullptw, 8, uint64_t, clmul_16x2_odd) /* * Because the computation type is at least twice as large as required, diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index cd630ff905..5def86b573 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2029,19 +2029,6 @@ void HELPER(gvec_pmull_q)(void *vd, void *vn, void *vm, uint32_t desc) clear_tail(d, opr_sz, simd_maxsz(desc)); } -uint64_t pmull_w(uint64_t op1, uint64_t op2) -{ - uint64_t result = 0; - int i; - for (i = 0; i < 16; ++i) { - uint64_t mask = (op1 & 0x0000000100000001ull) * 0xffffffff; - result ^= op2 & mask; - op1 >>= 1; - op2 <<= 1; - } - return result; -} - void HELPER(neon_pmull_h)(void *vd, void *vn, void *vm, uint32_t desc) { int hi = simd_data(desc);