From patchwork Mon Aug 21 16:18:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 715389 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp1925780wrs; Mon, 21 Aug 2023 09:21:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmlXhJqBiF1UQqfWYs0sH9u/SGxrKxiXzKd6xSkXG6QhjXc5suYO00d/XIAnhdJkknkxgS X-Received: by 2002:a0c:df89:0:b0:64a:6ae6:46f6 with SMTP id w9-20020a0cdf89000000b0064a6ae646f6mr7549959qvl.2.1692634894607; Mon, 21 Aug 2023 09:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692634894; cv=none; d=google.com; s=arc-20160816; b=bGQWml/i4pi7ppJDiApj/UNDuvpUiMg62X3oR1MaCgyPcs+MCEn38Sl9l90UPCh+Mw bnYUhFWHKuysbdfPAA/XeiBYsvjjypZp0QAAsK4W9/1BG4VVSipTnRB61FoEBTYr/3+H Fs6U8/eOdjUl9aXhOVgc+BA2EAN0BLh0u2ZyqRjc+nr+idZ7MPsed6v3c2H68r7ZGy0i 33HLKun20qhd6i1EhWDqe4wZIqk6DiuaTHcB5Yh6DS3LBYfnkoMUdjCw2E27C/NVeiz7 qT78j8exebqg0KzJovBbgUea5XBajV32LxQuL1/Y52n7FhKHOCqRA3paz1JHjZsPtIaB fnzg== 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=rjJiUhlPai6mmk7xoBYCGw+/59480gYFwt2JNZw/Qk4=; fh=ihrF4BApiA3Z+XvqRPGwUXuGbDlKBmHEuYVfGNAjZIQ=; b=dbSTojQMp70UIjYG+2obz3ykmb1poYGzWECyjsWPNMlZil1oACI5n6lqWHBpQfJUcH zTQ2GJmSXHZoNzGp17gEmsNvUVDKozc4YxAv+1+pIaGnS+1LyMKNS8D9HZb4IfdjN4JP u9LISAwRJqWFvQ0H1MN1SB2XAUI8PcfvXy1fyOuu/sEqUXAcJ6HqezvOSjfpBJ8tG0LK rWf+ivKanWwWWM2KfU+05mLR02Ps+LDvU5fZM92cK55CkBEgZrvenNOmQyS4/8pSRLWv z2Ed9Pm+a3yT2mD5ubHos1cVGgs6dOfpjwMoQRrGcwj/q3NNQqKENdVpkkhutEP3HHO6 /snA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CesaKTvz; 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 f7-20020a0ccc87000000b0064718f836f6si59372qvl.552.2023.08.21.09.21.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Aug 2023 09:21:34 -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=CesaKTvz; 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 1qY7cp-0001jf-0q; Mon, 21 Aug 2023 12:19:31 -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 1qY7cP-0001UE-Sn for qemu-devel@nongnu.org; Mon, 21 Aug 2023 12:19:05 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qY7cN-0005cD-I9 for qemu-devel@nongnu.org; Mon, 21 Aug 2023 12:19:05 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bd9b4f8e0eso21234505ad.1 for ; Mon, 21 Aug 2023 09:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692634742; x=1693239542; 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=rjJiUhlPai6mmk7xoBYCGw+/59480gYFwt2JNZw/Qk4=; b=CesaKTvzUC/8eEwCu7nznCGFFyf6iaJqRk9V4r0aj+u3K4iXLHf/6ElY1y+HSkmauw sc68m2ZEBzg/bflvu14xEDyyn+kEW5ufb3l+xb4uv0ajwgnr7zoaQ6qZhyNQfi6I7X4b jOy4D8/EzpWK71LXLfNXg8RfXu4mjPusFYvtMimHMPdLYgN+Oxq3QMhBQY7glX6T45+e 81VEgkhCGpZ7KtHdqE+cr/RLIgLQaCLhm/eA96G/1nL3ut7f2AjnD0oKNSQhNpdcamGQ rfNUvCwqScoj18MuoZJrQanItTgLAeOu3K4LXwQlsuJ+jAXEPOmiHHqV0TScipe91MX1 7RpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692634742; x=1693239542; 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=rjJiUhlPai6mmk7xoBYCGw+/59480gYFwt2JNZw/Qk4=; b=cZ+rABt12FDHAlEJcE9fM8b1MsEZA3jVpPGTBCAgeH134SzZEdUz1Xr/RysCjwB6RC NidgbDbRCjIOnNZ/6jmIfYkqlOwjmULg4M64dLr5jKWrZTP3VL3WlMrpl+KxR2Aqkq6t GNNs8MnlLqfbV5p1bIXOaDv8nqPOoI70aXiWB65GGH+TARolQ+5DKE6kOLPPQSQD/dQi lLNcrOxKozvqU3GLcTvBc/lrxVkTMLmuvnOtF8qy7j9/58geguYmmxtU3FzpntMM0d+Y cKrwoyEnaoBVtRCS7XrOEId7Z1cRucAl+eBsGp3L2SKOWdpBkWznDJcKtP7jlb5G76yJ bXkQ== X-Gm-Message-State: AOJu0YxAFGDlBDCWrlThPZGxE4epg0ypyLw4KQfeQ9aLgpvUK1Bm2X/7 /RJkSVmDCJoekfS3JAM5zfZyk+x4GOYUPAsonbI= X-Received: by 2002:a17:902:dac2:b0:1bb:99d3:6a53 with SMTP id q2-20020a170902dac200b001bb99d36a53mr5721262plx.20.1692634742149; Mon, 21 Aug 2023 09:19:02 -0700 (PDT) Received: from stoup.. ([2602:47:d483:7301:2c08:e710:4459:46f1]) by smtp.gmail.com with ESMTPSA id e16-20020a17090301d000b001ab2b4105ddsm7234549plh.60.2023.08.21.09.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Aug 2023 09:19:01 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: berrange@redhat.com, ardb@kernel.org, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH v3 07/19] target/s390x: Use clmul_16* routines Date: Mon, 21 Aug 2023 09:18:41 -0700 Message-Id: <20230821161854.419893-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230821161854.419893-1-richard.henderson@linaro.org> References: <20230821161854.419893-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 16-bit carry-less multiply. Remove our local version of galois_multiply16. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/tcg/vec_int_helper.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/target/s390x/tcg/vec_int_helper.c b/target/s390x/tcg/vec_int_helper.c index edff4d6b2b..11477556e5 100644 --- a/target/s390x/tcg/vec_int_helper.c +++ b/target/s390x/tcg/vec_int_helper.c @@ -180,7 +180,6 @@ static uint##TBITS##_t galois_multiply##BITS(uint##TBITS##_t a, \ } \ return res; \ } -DEF_GALOIS_MULTIPLY(16, 32) DEF_GALOIS_MULTIPLY(32, 64) static S390Vector galois_multiply64(uint64_t a, uint64_t b) @@ -231,6 +230,30 @@ void HELPER(gvec_vgfma8)(void *v1, const void *v2, const void *v3, q1[1] = do_gfma8(q2[1], q3[1], q4[1]); } +static inline uint64_t do_gfma16(uint64_t n, uint64_t m, uint64_t a) +{ + return clmul_16x2_even(n, m) ^ clmul_16x2_odd(n, m) ^ a; +} + +void HELPER(gvec_vgfm16)(void *v1, const void *v2, const void *v3, uint32_t d) +{ + uint64_t *q1 = v1; + const uint64_t *q2 = v2, *q3 = v3; + + q1[0] = do_gfma16(q2[0], q3[0], 0); + q1[1] = do_gfma16(q2[1], q3[1], 0); +} + +void HELPER(gvec_vgfma16)(void *v1, const void *v2, const void *v3, + const void *v4, uint32_t d) +{ + uint64_t *q1 = v1; + const uint64_t *q2 = v2, *q3 = v3, *q4 = v4; + + q1[0] = do_gfma16(q2[0], q3[0], q4[0]); + q1[1] = do_gfma16(q2[1], q3[1], q4[1]); +} + #define DEF_VGFM(BITS, TBITS) \ void HELPER(gvec_vgfm##BITS)(void *v1, const void *v2, const void *v3, \ uint32_t desc) \ @@ -248,7 +271,6 @@ void HELPER(gvec_vgfm##BITS)(void *v1, const void *v2, const void *v3, \ s390_vec_write_element##TBITS(v1, i, d); \ } \ } -DEF_VGFM(16, 32) DEF_VGFM(32, 64) void HELPER(gvec_vgfm64)(void *v1, const void *v2, const void *v3, @@ -284,7 +306,6 @@ void HELPER(gvec_vgfma##BITS)(void *v1, const void *v2, const void *v3, \ s390_vec_write_element##TBITS(v1, i, d); \ } \ } -DEF_VGFMA(16, 32) DEF_VGFMA(32, 64) void HELPER(gvec_vgfma64)(void *v1, const void *v2, const void *v3,