From patchwork Sat Aug 19 01:02:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 715015 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp801362wrs; Fri, 18 Aug 2023 18:05:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0arNlWv6cgLcCq1FqesemGgEhysYDcdV7ckTJhOLtHRxkVnPU9Exd1TF+camD/B6g4jYI X-Received: by 2002:a05:620a:4482:b0:76c:9931:cbd with SMTP id x2-20020a05620a448200b0076c99310cbdmr1055772qkp.28.1692407109483; Fri, 18 Aug 2023 18:05:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692407109; cv=none; d=google.com; s=arc-20160816; b=yvPDfqiVyMK9dE5zwtCOqb4sdZhdBtZQ+qPUJnDXKechrrj9F7VfIZ41BY6RdBMBgI VZHwfPvqbAGxUZeHV/4Dil7br9ZrD4ZDhXXZSYcDw3Kf/NKNJtIwdq1ENpjvOntU1rN8 oOuwry0clzkeJfr3JS9dbw/uh7Bya+C9964JZ1Z8xdEgXWax2jkOMyPgItVDEkbOgqSx 89qbMogVui341vwvQVBooEDaiSd8UuW1g6dxkbtmKsOOwWaWBEkL4ceiLHVWTE7h/m1p sb0Dww4vlZ8AqVFdHmjLPqAjtChH+ozxKA89UB2ZYB032iAETlP2/i98D2SOhu7TA/Cr uI3g== 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=KOR8Q/KDHweXHhtPJBOF6KbMNecqFI3FxCLD3VnqMyo=; fh=4xNVIrgzKzsUJFZ/LK5iWzslbipp0obh3zmyxXTMM5Q=; b=U0eKzuGqGIqsV0pah+qQWObfPfVcpWyoU8kJ4XJhqVELip209T9oE6pTdcNE3ZaYaA MSkQ8lvmL4h/2KAT6rHchRx0+oz+hG4yksHoUrZmltvgzPK85v9LEfG4Tid66Lv0Kajq PDTVQYxx0x7T5IU/Wl95k/+EkQZqDvQIndtB2G1VLVcxsl9+iEwchO1bRlQjsEqbKtSX XnNIOnEnQ73H9Z/XTrliEce6KiJKeOE/Q9qtN4afGJeksLkdHVe9IWuULtTm3ulJq8qF j1uQ9zgZZKHPrmu8vVtitAECKvNRUovW+tCw6DY5Z7qQdebi2wq7t8O4LKG7KQ8woJ8a doRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="xBw/Xgej"; 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 ox19-20020a05620a829300b0076cdc1a072esi1786657qkn.320.2023.08.18.18.05.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Aug 2023 18:05:09 -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="xBw/Xgej"; 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 1qXAMQ-00004x-0f; Fri, 18 Aug 2023 21:02:38 -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 1qXAMO-0008WG-FN for qemu-devel@nongnu.org; Fri, 18 Aug 2023 21:02:36 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qXAMM-0007NZ-5l for qemu-devel@nongnu.org; Fri, 18 Aug 2023 21:02:36 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1bf48546ccfso6980285ad.2 for ; Fri, 18 Aug 2023 18:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692406953; x=1693011753; 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=KOR8Q/KDHweXHhtPJBOF6KbMNecqFI3FxCLD3VnqMyo=; b=xBw/XgejVnzOPPO3ZgB8tMHJfr8SSTR+y4Ga0aJvwGQxJfb/fqTrYcsNQWJ+wZmNvi f59dpHckMtlZbNxgSVE8DTdA8DmLlLP+gNjLXkglKAUiSF/0356Gp+my5wUYHaM77mMU uG0yQ2gkwIs20ebfhboJoTwwrqIM6A5KoBIzhR40ttMEjaG8z4drF/1QiZsLtZjV3+Kx ONIL1P3XAt3Xeynk6oGxVf5j0SSescsnfzbhwH6Q5hgoOWm4oqt/MDOs5pfMU65utHxw ye3pLwD7IFk0ei6NMbC2oX6IdzmarZQPdBex/A4oDi+BRYS1jlOO74tlHkGbCi1dNi2x h6ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692406953; x=1693011753; 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=KOR8Q/KDHweXHhtPJBOF6KbMNecqFI3FxCLD3VnqMyo=; b=iBNNThCyFfbsZcpBBabryViRLukCdo7lLTZBzUuiJiH6ZnQiKCPE+RD+gxE3Z0TAjI mqPnsQbtlr7ulQaOA6CjyDrm3JxRM9rfcS0OXxA/POfwS1j/JyxoL/UEdLK618YR5jqN HsUe/wXtEL+W2PczxPC6dUgmJ9NLSo6gHoiYmHxh8t3OakMIxKDwBVcfY+G6iC0P+R3w NmUAvtNJtkMJWGDzBkowwm4GPN3mdweySE/BrlppLL6z/JY7zYlrXObbFEfgbSPH2Rf9 a0fNRddTwys6DdjXMp23Py4Y5XPWD3c7iVN17Wim2Lorwb4xBKhdjuVBaJh5sGBHjcYZ auRg== X-Gm-Message-State: AOJu0Yx+DPnYmySoP21i0RWXRmpjn2tj+zIPhpU1FfMXG+7GTZS/0u79 EUsML0BaICsC0m2qzXUY3TvwZ6solhwgd2EZFcw= X-Received: by 2002:a17:902:ea0d:b0:1b8:9552:2249 with SMTP id s13-20020a170902ea0d00b001b895522249mr752814plg.43.1692406952936; Fri, 18 Aug 2023 18:02:32 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:cf24:6daf:2b9e:7972]) by smtp.gmail.com with ESMTPSA id b13-20020a170902d50d00b001b87bedcc6fsm2372019plg.93.2023.08.18.18.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 18:02:32 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: berrange@redhat.com, ardb@kernel.org Subject: [PATCH v2 14/18] target/arm: Use clmul_64 Date: Fri, 18 Aug 2023 18:02:14 -0700 Message-Id: <20230819010218.192706-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230819010218.192706-1-richard.henderson@linaro.org> References: <20230819010218.192706-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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 routine for 64-bit carry-less multiply. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/tcg/vec_helper.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index ffb4b44ce4..1f93510b85 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2003,28 +2003,14 @@ void HELPER(gvec_pmul_b)(void *vd, void *vn, void *vm, uint32_t desc) */ void HELPER(gvec_pmull_q)(void *vd, void *vn, void *vm, uint32_t desc) { - intptr_t i, j, opr_sz = simd_oprsz(desc); + intptr_t i, opr_sz = simd_oprsz(desc); intptr_t hi = simd_data(desc); uint64_t *d = vd, *n = vn, *m = vm; for (i = 0; i < opr_sz / 8; i += 2) { - uint64_t nn = n[i + hi]; - uint64_t mm = m[i + hi]; - uint64_t rhi = 0; - uint64_t rlo = 0; - - /* Bit 0 can only influence the low 64-bit result. */ - if (nn & 1) { - rlo = mm; - } - - for (j = 1; j < 64; ++j) { - uint64_t mask = -((nn >> j) & 1); - rlo ^= (mm << j) & mask; - rhi ^= (mm >> (64 - j)) & mask; - } - d[i] = rlo; - d[i + 1] = rhi; + Int128 r = clmul_64(n[i + hi], m[i + hi]); + d[i] = int128_getlo(r); + d[i + 1] = int128_gethi(r); } clear_tail(d, opr_sz, simd_maxsz(desc)); }