From patchwork Thu Jul 13 21:14:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 702236 Delivered-To: patch@linaro.org Received: by 2002:adf:db4e:0:b0:314:25da:8dc4 with SMTP id f14csp741674wrj; Thu, 13 Jul 2023 14:17:18 -0700 (PDT) X-Google-Smtp-Source: APBJJlHFaT+TsYACeZfuIuTwA0Kd8T0JYSObmrACKqFZu/9npbNSqAVssgrqrBG8BR2+ta/y0Ncw X-Received: by 2002:a05:6102:3026:b0:443:8eab:c664 with SMTP id v6-20020a056102302600b004438eabc664mr2116745vsa.13.1689283037948; Thu, 13 Jul 2023 14:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689283037; cv=none; d=google.com; s=arc-20160816; b=hfCZ+cNehkie3v8hZZzORye6IXWIOJGkH9DfrQWyXHhDMmD1jIgWllWrXggQsDWmos MFrZj3EJRXBszvFcR2QNN8uammuAI/wPfzc4XU7tHI572FMFsTD/QXUujOMw3wSMtQeP x14UgDV0gGL++oBGRT15Z5g9Smg91vMrYDnwennULWbQPmmyVNWHgcxYlb04MKXz0efI un9OZVULGJ4DTOsYzJrTLZfsZhZzCyvEHfLH/i6rgyqFG6XOxl3RD9wIwiPNLSQwwoGJ OEZ0ff9QGO0nNmyCTVAl7qdkLTyAi2yN1iWSIRdQAHLklDg2ho5O8ZY1yRwVhTbE8cSu IUIQ== 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=nIVnJ7xXPoFHeKhRtV8u1nP3hp+hYXvngLOg/MOoyhs=; fh=4xNVIrgzKzsUJFZ/LK5iWzslbipp0obh3zmyxXTMM5Q=; b=apIGSV0Sj9nkjhYfNlCmJk8aWJ8teniIRu8m67Ou9iv9kP904GclDpyTuxrUTj1JqR 1Dj4xxs/yJWEc7jxSWcKOsHrXA567gHmJZeQ812FS0gH1N3nDMUNP1jvOTZywyFQT+a+ okoRWmJGGm1UxTIb5Fw+JqI87Kx5Bv4PGf9adwlDi6+9zyQeTXSs9Zd/0UP9YnwMJfON vGSenN+lKUCIaK2qNZL0ucQNjMUYy57TUHx43woy9E/G8M7KovCmNZNWj1U6T77k+7Me rwgjnA/FFUHsGkNsTDqttgOV+0ahnHkhrjvsl+SYyaraIQw/DiaOCNyRnPb0TR8S82ca IckQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fLtEgnnc; 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 bn39-20020a05620a2ae700b00767ba3c23ecsi3622152qkb.284.2023.07.13.14.17.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2023 14:17: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=fLtEgnnc; 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 1qK3eU-0000Lv-HR; Thu, 13 Jul 2023 17:15:06 -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 1qK3eK-0000JI-NA for qemu-devel@nongnu.org; Thu, 13 Jul 2023 17:14:56 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qK3eI-000186-RR for qemu-devel@nongnu.org; Thu, 13 Jul 2023 17:14:56 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fbf1b82de7so7720355e9.1 for ; Thu, 13 Jul 2023 14:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689282893; x=1691874893; 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=nIVnJ7xXPoFHeKhRtV8u1nP3hp+hYXvngLOg/MOoyhs=; b=fLtEgnncCjkpJKMR5EUcqTThok6V4283ZQNWuxOUcnZGvSQ7KnVx6WbaRA7Rz5w5c9 MHv8ot8qQm0NE/bsjxse0JJq/hO/36lOwEnnU+SEJu0tzWiAccmrl4Fm525s5f1o7CtD k3+dvDaJMkbVUvxtC3tk0cRoyLQ+QE8rQzLAFjDPumdBmwfWg3N2jSMjG4ZZwZRP9xGY /xaSvSY0yNORREHO7R/ARuZTe5XXwjK2S4h6ClOws1A8KUGYI1EcF0TcPYC7rH9DA4fe sEfSFCZAp0ksx43P7ybIlTIC9ah6brtPvPO0/MgBG7um3w+HJ/XCJdiKfP4u00pIe/8w 251Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689282893; x=1691874893; 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=nIVnJ7xXPoFHeKhRtV8u1nP3hp+hYXvngLOg/MOoyhs=; b=NA5VY3OG1PkBz3z0BJj+CNbLMyiR1NlgPyZzyhph3KmQL0SK+HubqaEEbIgFyjZQIp /qETjg93mObT10X+FX+8vsEO9Jppqu+A4xgfNDWMPee+U5FwajPEyCTInwWI18olUq0W FmWQrgkff1uASlcoWI0dJn/fOV1iHtMtKpWlyi4HMsh/5Vr97MfkexhWpVhdWUACaAH6 CWUSQLEd7Lt9kRKlIOCft4iO1wTz2jmcXplo3gu6jpoPtz4oFn8oNXjFHIFkHuSUGr+H CDeh6fvd2yqRxlaNY+PktpBHaHByg9Xc99sA88sX1M7ntpi9pd/i/HaMR9zlRqCHNzXQ R79Q== X-Gm-Message-State: ABy/qLbUgP2f6QuxSG2Z0KCyCNzoNvWkDoYy0b7bVAMouJ/61SUEAfkS l7BgoLvCmKzPs1ybuVcuPBMadUY2Lv1zDdMumRQs+Fet X-Received: by 2002:a7b:ce87:0:b0:3fa:8422:158d with SMTP id q7-20020a7bce87000000b003fa8422158dmr560883wmj.18.1689282893616; Thu, 13 Jul 2023 14:14:53 -0700 (PDT) Received: from stoup.. ([85.193.156.66]) by smtp.gmail.com with ESMTPSA id n12-20020adff08c000000b0030ada01ca78sm8973747wro.10.2023.07.13.14.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 14:14:53 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: berrange@redhat.com, ardb@kernel.org Subject: [PATCH 12/18] target/ppc: Use clmul_32* routines Date: Thu, 13 Jul 2023 22:14:29 +0100 Message-Id: <20230713211435.13505-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230713211435.13505-1-richard.henderson@linaro.org> References: <20230713211435.13505-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x330.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, T_SCC_BODY_TEXT_LINE=-0.01 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 | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 98d6310f59..828f04bce7 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -1444,28 +1444,15 @@ void helper_vpmsumh(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) r->s128 = int128_xor(e, o); } -#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) +{ + Int128 ia = a->s128; + Int128 ib = b->s128; + Int128 e = clmul_32x2_even(ia, ib); + Int128 o = clmul_32x2_odd(ia, ib); + r->s128 = int128_xor(e, o); } -PMSUM(vpmsumw, u32, u64, uint64_t) - void helper_VPMSUMD(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) { int i, j;