From patchwork Sat Aug 19 01:02:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 715007 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp801083wrs; Fri, 18 Aug 2023 18:04:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcVSXXDOHuyiEPFcFg96Zucju0pAq3dB8qDc9qHjvWQpgPnJp1ZktzDqA4e8fJ0rsSiOkq X-Received: by 2002:a25:c7d3:0:b0:d07:e56a:7423 with SMTP id w202-20020a25c7d3000000b00d07e56a7423mr938550ybe.17.1692407065552; Fri, 18 Aug 2023 18:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692407065; cv=none; d=google.com; s=arc-20160816; b=RZxmMCyWdTKT+M7i1ZATGLRzrxV7r0HPpegp1MG00z2hcPsE6RtavWDWtC80BGf/Kg BlOuz1j0DLyQInhPdI6FPsOJ+d1pOsW0di24FoD7+uy1BTv7dv8UtCEptk4PV69ynuzd vQIJ7/8EogjUtZHKnb1Onf349lmnFuF03V+VhP4SPExmILLPTD3nx/KyASDuKSoj97oA BiDk6I87tnE9DVvBAUoaUQIeITqrykHd27LgBzWLMB8oK7PO/8fCFvqY5RgUda00e82Q MzgiYTe6nbvQKMPNl0X8dQiNLwyrlcdkfbqkzJsabZb43qwQWPfFrLdhQxgWQqB9PtVr baDg== 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=47nFV1aM9JE1wMIAXCDJba3wZ1tlxMIcg3CYQKdGdcE=; fh=4xNVIrgzKzsUJFZ/LK5iWzslbipp0obh3zmyxXTMM5Q=; b=rJ1wb4vlwFw889RyC47BqL/x55IYK7X1qi4QU5s3c05EIMr2Iv93jY+p48e/TbzTNy S4F99v6uQGNNNjb9FmDGKja+0t5td3t9PVRPcyxvepAyP8p/86wf3D4TFK49mcnb40RI 1cS/xnEYeUPuHsjZ37b4obtUy0Gx3xuV3gCKZgAncYS3LFg6Rwz4sGVGHDRYeLJIV9T0 wqcCw4wi9WNoyGcpAZLjlG9466MdZO+TtfQLIb/IiEMoOokdwsQcr4jDs6z29O8LJLrQ yqPsFDF9wmazWXjjJhhBVs7ZET8Yus5K7FaI/36ortuGiwvqYEI/L8OBV4YQHRW8uF5x rwsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HsRBblDc; 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 fh17-20020a0562141a1100b0063c6f79f586si2098852qvb.520.2023.08.18.18.04.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Aug 2023 18:04:25 -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=HsRBblDc; 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 1qXAMO-0008WB-Du; Fri, 18 Aug 2023 21:02:36 -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 1qXAMM-0008Ty-P0 for qemu-devel@nongnu.org; Fri, 18 Aug 2023 21:02:34 -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 1qXAMK-0007N4-Fa for qemu-devel@nongnu.org; Fri, 18 Aug 2023 21:02:34 -0400 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1bdcb800594so12031905ad.1 for ; Fri, 18 Aug 2023 18:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692406951; x=1693011751; 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=47nFV1aM9JE1wMIAXCDJba3wZ1tlxMIcg3CYQKdGdcE=; b=HsRBblDc/DT4SvE7vRSfwkYQa4f/+zjvf6D7JWCOFtStkhNYMpjuEyB0mw+LQN0qjP 0DWfkfIfjJYBOO4zHOtMz/PPdMu6UDS/ws11fhrb49+yqjp+qeycmVyqQiPY2TfwX9fR NHlDJNpQR2CIbxOkTcSuyYWNZ0maXKIcTR0dLk7JgCrK1E1+DuKuIMRXAyK2dqWcb6xj vCYMFyCQySa9izxGjGKRL4GXel2tEPQ3yIMDrU3Kpo6JnzKlqEcNLR2qrmX12AbyyMaJ PjPaVQNoTPH38rluohmYmJa4njKcdny/91HQ9A4EROFBNUDldr+QtAAYY2PrMzeRdL37 p4FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692406951; x=1693011751; 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=47nFV1aM9JE1wMIAXCDJba3wZ1tlxMIcg3CYQKdGdcE=; b=bbFzD44VMd3icHWO6Ihg6CoX5YvM5kEHj+yagRRcfTuZK8enV6JFBMdK4mVLIQ939Y SEyqYMZ4wE0WIU24sewBjFEP6u79+c+RXq1G8s6uCXxCctFFNHYDBi0rYur7arZhlc09 XQwzZ/C1LfUd8yMCYH0ORxTvzqzsUxbknC6lqEotZb/vHVLaLcHVzLyB5RH+e/4xQQ+3 q3CmwVzF/M240jeD8I6Y7WvyW9pHvgD5VJ0y9RMSq4gNVczukSqfI1EQFq7iEevwQCKX imMv75zSNhAQDUTbTe7sImKq93dzjY1bP6NnU5P7Gu3nrcY0PteasKpJvf9SG98V99U5 yZZw== X-Gm-Message-State: AOJu0YzVCOG9bT/u//ed9JNSosb8fRfnonYg8quyBxSv7cgnod3lyHiO L54pjURd7h4axQDOkv8Idut+NnuREJ6k/5jrvRc= X-Received: by 2002:a17:902:f684:b0:1bc:25ed:374 with SMTP id l4-20020a170902f68400b001bc25ed0374mr817370plg.49.1692406951158; Fri, 18 Aug 2023 18:02:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 18:02:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: berrange@redhat.com, ardb@kernel.org Subject: [PATCH v2 12/18] target/ppc: Use clmul_32* routines Date: Fri, 18 Aug 2023 18:02:12 -0700 Message-Id: <20230819010218.192706-13-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::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 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 10e19d8c9b..ce793cf163 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -1446,28 +1446,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;