From patchwork Fri Sep 15 16:42:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 723142 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp488800wro; Fri, 15 Sep 2023 09:44:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6iwwMp3dRu4VWJu/ybSHpA8WYKzVYsG8wI8KdP/znuTr7XmTL+lvok3PBmWEaDJA4pSXC X-Received: by 2002:a05:6102:34da:b0:440:a8c8:f34 with SMTP id a26-20020a05610234da00b00440a8c80f34mr2565481vst.3.1694796279089; Fri, 15 Sep 2023 09:44:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694796279; cv=none; d=google.com; s=arc-20160816; b=t+w6jLnGG9UGWlmvsWk30DSI/qzkpDneDIgzTP9Onp2hVtDpc1b17iSuyKHF4Qc1Lq p6eo+bH6dsf+uo71yAT6drN59iq7LwtVIdM8hJ6RmMduApMcRxXnmR//7fK63n9zjYNB 4s6ThJIJO50gYo0eleZ5rJz6zlJrTGDvt6X7JkILa3evrC2fCAvPIA0cYaZiP7hm7HjH lws43jH1FwJ3UpZuEg+H8yXHH8CZdF7B/G1OLNRi2pHeQjN4VKa5qIwtzrof30hyB5Jm Do4qrUne6QBET5AQol5y9IIFA1Jo6RFvu4vTFmQTm29U5reJzHxf7/X2LjDnlx3w5NZd RVNw== 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:to:from :dkim-signature; bh=/GHGqee03AmoquehQcXqyFpwhRv/6DB5C+2O1I5qXiA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=B3dMQgHVSR+7eB23sqSG/ndcqIONjnSb6S56GL5cK/anjh4ENO/B219uiLeEhfO5rL eCIJoZvceCPOGST2KD3BE1fk8oZl5OwvjhzuQpiZVgxCezFHirZy0vZfd+rc+5pERST+ ECPr/qxaAFpEfcolWUf3MJFFHL/ecewD0I8q5qLuLdzhBjLO4kGSjsG1bFS2Elat+8xH 6AEzTJCl91+R70IJIbpuThrPMsHmZj9vYxKsxPXiQJy92T50vLDUIg3cyuTelaHJemHv pKFG8BWPm1oqg9EURCV/lwuHAWyzCoib3U28jzRF6ngtmcDcB6iC/yQ5w7Gdt+cmkSJm LEwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hZa36b7c; 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 n17-20020a0cdc91000000b0064f387ba538si2457203qvk.291.2023.09.15.09.44.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2023 09:44:39 -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=hZa36b7c; 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 1qhBu4-0004V3-KV; Fri, 15 Sep 2023 12:42:48 -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 1qhBu2-0004UE-GI for qemu-devel@nongnu.org; Fri, 15 Sep 2023 12:42:46 -0400 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhBu0-0004w4-UF for qemu-devel@nongnu.org; Fri, 15 Sep 2023 12:42:46 -0400 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-68fb5bd8f02so2279738b3a.0 for ; Fri, 15 Sep 2023 09:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694796163; x=1695400963; 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=/GHGqee03AmoquehQcXqyFpwhRv/6DB5C+2O1I5qXiA=; b=hZa36b7cKvfSMEJRbyOnG2C2ZF6k6cSpi8xtFRm53IP+jJoEqNOyjWKfa1YCxB9Iz/ zWJXQ1eyJS0b8OGfOKy+CPsMNf8o3muegyvcG4pfuLzesDrSUfYj/2vNA8ylSaJ1o0Yl CE5wjDbRowYDdBL6jEdW5rbxn2caesLdvXKLM92OXFP5d26H/hrEDYnl6aI2eBAxlHlJ yFj2ddu5sr4v8zqQxprF9VO8ZZr3XaP2ffNqyDI7hKnkSV+X83vwXYFme4l5kWOa+TcO lul8w4fI9/AfHPuzavSGwjw+CKGmBvO6dsqiQ+jl/NRFfCYvH7+noDIVzU56bl73la0r XkZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694796163; x=1695400963; 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=/GHGqee03AmoquehQcXqyFpwhRv/6DB5C+2O1I5qXiA=; b=wx4BJFuA9jb6C2asenurRqDBRJe4qeTcglVDsc+bWdb+0UIi43jzUDaCyYlnuoxM21 bml+Em5UQmR8zHzMPLzNSvLVkUbaTUwnhicM5XrH/sZrLII5U2boW7ouLo0/23JnvlW0 B+hxP0XOH4L0re5n86YXlB5SWW5G7YG1bnzfimd+qrhFqe1g74ztzp2cqMgLzp0VE4v1 aW/84BZiTK4+bkr40ANq2uQezM+tWDFTANcST95M7BATeXh4m3xAHiuL54Fs1mHta3kB sR79D+RxHgItjOFn4luaUFT+5E+Ld29xr6jNBlYGLYYDnDGLtYdnbwGKpw8lYNmVQIju EFQw== X-Gm-Message-State: AOJu0Ywk4I+eucu/jDZparxCCyeQVOO0qlLfFHYo7DrCbQ9BzmPPn6Y+ ZEKNfLDUvTbiMu0F1BYHBVcG1SOSnq/363RWIUI= X-Received: by 2002:a05:6a00:24d2:b0:68f:d35d:2168 with SMTP id d18-20020a056a0024d200b0068fd35d2168mr2393689pfv.0.1694796163459; Fri, 15 Sep 2023 09:42:43 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id s187-20020a6377c4000000b00577f55e4a4esm3010087pgc.20.2023.09.15.09.42.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 09:42:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 12/19] target/ppc: Use clmul_32* routines Date: Fri, 15 Sep 2023 09:42:24 -0700 Message-Id: <20230915164231.123580-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230915164231.123580-1-richard.henderson@linaro.org> References: <20230915164231.123580-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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 32-bit carry-less multiply. Signed-off-by: Richard Henderson --- target/ppc/int_helper.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index ebb2957fe7..1ea42b4ede 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -1445,28 +1445,14 @@ void helper_vpmsumh(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) } } -#define PMSUM(name, srcfld, trgfld, trgtyp) \ -void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ -{ \ - int i, j; \ - trgtyp prod[sizeof(ppc_avr_t) / sizeof(a->srcfld[0])]; \ - \ - VECTOR_FOR_INORDER_I(i, srcfld) { \ - prod[i] = 0; \ - for (j = 0; j < sizeof(a->srcfld[0]) * 8; j++) { \ - if (a->srcfld[i] & (1ull << j)) { \ - prod[i] ^= ((trgtyp)b->srcfld[i] << j); \ - } \ - } \ - } \ - \ - VECTOR_FOR_INORDER_I(i, trgfld) { \ - r->trgfld[i] = prod[2 * i] ^ prod[2 * i + 1]; \ - } \ +void helper_vpmsumw(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + for (int i = 0; i < 2; ++i) { + uint64_t aa = a->u64[i], bb = b->u64[i]; + r->u64[i] = clmul_32(aa, bb) ^ clmul_32(aa >> 32, bb >> 32); + } } -PMSUM(vpmsumw, u32, u64, uint64_t) - void helper_VPMSUMD(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int i, j;