From patchwork Sat Aug 19 01:02:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 715017 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp801410wrs; Fri, 18 Aug 2023 18:05:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFydiCgohE0sSBmOTafSI+Zhmur9Nki5ZbafJ5d8H7jkVDkK1nh40AhiFOEnt1Qe5vHAlU8 X-Received: by 2002:a05:622a:cc:b0:403:8de7:4503 with SMTP id p12-20020a05622a00cc00b004038de74503mr1024626qtw.52.1692407117278; Fri, 18 Aug 2023 18:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692407117; cv=none; d=google.com; s=arc-20160816; b=ZMlsdQzUMMJ8a+zT+WfYWJ49+bE41l2AZFxgm6tTOMZx/Oa6g02xDNe8vZ8ZLi5Xd8 K0diC8n+6ypexyZ/BICSBHtdS/LM3CjFKgGXNfKaLYq2Bj8+WozXZGwu7mTs8/hPDqIx 3GiDWwHOX5T5kydXyeQnSNA2HhdnWn5BzHNa3XKvMFS7o5ndX1sQhbFy1kjV2VHs69Lz xbTsvOejtOCtSachbx9MYC5fI8Y5BOfe4dPblMTksL4vvKlyaR1novzD1YHSvhcvytME zSrSSbZlMzm/Uq3b+egl0Lg9UBUP9aHfeUVxzLQR2d5XRo/3snNSzQVqcdgvNkqWdvv7 JuGA== 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=EYOvUjl9DKYepdyDRgw1XoKhgsFy5EQ3dFtSTrNTOWE=; fh=4xNVIrgzKzsUJFZ/LK5iWzslbipp0obh3zmyxXTMM5Q=; b=LBo7BuyCmrFasi5lZPiNkAd4JtrsKZPME/xomYciKXjCBu4uMFWOi2j8X15NVyvDTM gOV7spJJgIP5a5nYpxxVr5tHSEpzHFAUk2LBE7B3ypRqk6dyoxvIFw0g/VhdsP8zGAze 2bE05ihoz7YbNpTsqto5EIcRFXlrxF+/n0r0g8X3ECbI346zb7QDZmsFgjslBGz+6Yo+ 5VUIsD+55W2Bsh2a9bBEZVkFwdM8NkL+3/rof2eRy7X9ps6I7zROF6WrLfj/9ll4UEAV F/1s2Asrv0kv+bzoxd6tbq4ONzYth745YN9sYR3eKwzYxU7iI9ohnS/JSijaf91k3os9 lzcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T7YmyQ0h; 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 b8-20020a05622a020800b00403c944ba12si2025310qtx.775.2023.08.18.18.05.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Aug 2023 18:05:17 -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=T7YmyQ0h; 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 1qXAMR-00006A-NU; Fri, 18 Aug 2023 21:02:39 -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 1qXAMQ-00005B-4R for qemu-devel@nongnu.org; Fri, 18 Aug 2023 21:02:38 -0400 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qXAMN-0007O0-Vg for qemu-devel@nongnu.org; Fri, 18 Aug 2023 21:02:37 -0400 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bdca7cc28dso12355495ad.1 for ; Fri, 18 Aug 2023 18:02:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692406955; x=1693011755; 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=EYOvUjl9DKYepdyDRgw1XoKhgsFy5EQ3dFtSTrNTOWE=; b=T7YmyQ0hTa37BA8zQsPUY0C+QlKcFL2EtaFxnuGn/8GRI+8FmFF2G1d2a4hMAOsFsH 9kNiuYpTgitTw4ouQUkU8zuhSmZm5YRzCu+RAZ4kDNpwCoyHSFfKgLkMwdNtNqYfIpCe Bd4VRdeYE0Fno6yZbceSknSoxct6f6EVY9gO/uWdJzcEomrpkLe7pn6fd33DpXhTWhGa MwP8Ua3Ea/hFj6kkgkGjloZNg+F4uBB2LCkIA/HKO2CmfOPsPh+7OloXeNHmjbSWuUwf F/0RVxMWMsb1qo0a9VbiomN7vZjkAKo85jtuO8fKR7ghVWbvBiXFzZNEpds8llA715hC 81aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692406955; x=1693011755; 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=EYOvUjl9DKYepdyDRgw1XoKhgsFy5EQ3dFtSTrNTOWE=; b=Edb/dS6MqBtCYNItoN/k6Xai7wuYLezQWXKqrB+Tp7vvLemtKxMvtpJQSpOqjHWxeJ tcrSD1Q+PRj02eAF2qJM31jyf1t5AanLqO3HYn3xerAeDao716tdn/eeemzzDvfDBxlu GP2cp7xRk1gv/6k3S7OdvAx8Uv33muPkBeITBrKSTvwBtmOAv/tIIL+Ufms4Y+LWS8fU 8YwtZJ6975eR6wfJOwSF9CYMw0ikHJ4VJjp4lkduR1ybMDGJ+dCxbq2zbPH3JVtpYBae dfq0Y+DiWioDdBorDFxZZ7Cjcn3Ipo7kWxvKcIYKxpgzhlthIUfPntGI9SaBdPeAU/u1 Z9MA== X-Gm-Message-State: AOJu0Ywb5PuESQcWTwsvZ/smeXiL4V+pEaTcDWbS/87i8o1tNDUG3i9s 2i5TZlAfxbZMOh70L4/rw2ip3rWeIcVnkkpYaGI= X-Received: by 2002:a17:902:ce8e:b0:1b8:8223:8bdd with SMTP id f14-20020a170902ce8e00b001b882238bddmr860340plg.59.1692406954751; Fri, 18 Aug 2023 18:02:34 -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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 18:02:34 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: berrange@redhat.com, ardb@kernel.org Subject: [PATCH v2 16/18] target/ppc: Use clmul_64 Date: Fri, 18 Aug 2023 18:02:16 -0700 Message-Id: <20230819010218.192706-17-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::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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/ppc/int_helper.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index ce793cf163..432834c7d5 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -1456,20 +1456,9 @@ void helper_vpmsumw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) void helper_VPMSUMD(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { - int i, j; - Int128 tmp, prod[2] = {int128_zero(), int128_zero()}; - - for (j = 0; j < 64; j++) { - for (i = 0; i < ARRAY_SIZE(r->u64); i++) { - if (a->VsrD(i) & (1ull << j)) { - tmp = int128_make64(b->VsrD(i)); - tmp = int128_lshift(tmp, j); - prod[i] = int128_xor(prod[i], tmp); - } - } - } - - r->s128 = int128_xor(prod[0], prod[1]); + Int128 e = clmul_64(a->u64[0], b->u64[0]); + Int128 o = clmul_64(a->u64[1], b->u64[1]); + r->s128 = int128_xor(e, o); } #if HOST_BIG_ENDIAN