From nobody Wed Jan 8 07:14:50 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1689283014; cv=none; d=zohomail.com; s=zohoarc; b=Ac6HOFOIgaAQryGXvRouAFD8o9yLI8hjWqlNFuwckj/zQ7Y4ZxZQJUhcWjQPCe6aKxV4AY/wVliG2mly+CXkL7no9TkPTa1q3qk2KCypfj5SMgqJmr0BWwoUbC6YUJv2g1xifOMf5u88EFQ/uvgPZV2jagjLLUKEBiBDyN7FCTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689283014; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=H93abcQMfpcVmKf+SmjckREj83SkP9I5kccuQ+f4FCc=; b=YNVTkJ/tYJbHoTcjda2HXLhHFOHE3guwD9TzihE6yLr3g7PGxe/oOfeXQVnCvCfJQAmeq0lZ/EHQJLr7148iJB43uuyOlOu2v2XHvQe25tdtzNg1I9asrC19y1FLH901hOpCIiXNlmDb6cgOljKE5Rr6e0kgUeX5MMf5BV7pNXs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1689283014890883.1433912164662; Thu, 13 Jul 2023 14:16:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qK3eG-0000Hz-WB; Thu, 13 Jul 2023 17:14:53 -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 1qK3eE-0000HN-Dk for qemu-devel@nongnu.org; Thu, 13 Jul 2023 17:14:50 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qK3eB-000164-OC for qemu-devel@nongnu.org; Thu, 13 Jul 2023 17:14:49 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fc04692e20so11243125e9.0 for ; Thu, 13 Jul 2023 14:14:46 -0700 (PDT) Received: from stoup.. ([85.193.156.66]) by smtp.gmail.com with ESMTPSA id n12-20020adff08c000000b0030ada01ca78sm8973747wro.10.2023.07.13.14.14.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jul 2023 14:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689282885; x=1691874885; 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=H93abcQMfpcVmKf+SmjckREj83SkP9I5kccuQ+f4FCc=; b=vsG2NBtkBSfDV6qbPry0b/iRTj8SvYNpBk5CQwGPL5EFCbtfu3JWS11JZb5/u0kgTW Xdws6eXl+CV+IIoHhLiD6QPdGvppTYCOIw6zZvPqKtuJok0Ee1Y1LfhtY5YOSFD6OCOy YNqOadonC7Fg0Wp52Ti1F/4q7wmzAdyYAW5s30v2h7eG/Uy9GgF+tUHg6IO7ZA6Cj1vG KRT6btxSJ4nTiAJ/1yPGUoIr0Vyiyu3yO4I2D2k9/SpJWFVI1SPy+WPI9fKTEckOXC+o ewz8V/kCRKsHciyFfI8dARxo+K0ktc0TL0CyuGXT/iQvGJPMcQXhN0eIuMQLxNXyOXQ7 GlAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689282885; x=1691874885; 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=H93abcQMfpcVmKf+SmjckREj83SkP9I5kccuQ+f4FCc=; b=IaWOGogMPftK8MH70dTd65mFSH01vHvUVl/u8Y9W6wVvfQpHwa+jF+iSHZ1zwpMAje y37U9P+YbNbz+uyyQUDguJgn6oAMGbNYf5TezhYAYtH4LLDU3aVzv5a1cnwk6LhTs6MA 2rGcCQkkR1KmZd6d9nN2kDHD/kUa0tYiN79zBBz0zKCgt9FMykTmRCoc+5B+vIbf1r+N 9uZMtfobzz6/+/H39mubm0ezX7kzzMyzk7CtYCfRSDEPogh2w2kM/n4+JxQI/k/ZgrSb q/c0TPFtN8GVmALEXsxvcfOwLp0/+xrkJwQVx1bWyLLKgTVBbCyLFARAIpwyWodgmo2m rSkg== X-Gm-Message-State: ABy/qLZRMpJsVEq7TKQDWAAjqUYAGNqGYF0xtTl62x7+Wk1KZVPLrKpb YEvp9ug31nOAtU5ZbDsRu9bhVFd4Y+euUnM7P9pcKhhe X-Google-Smtp-Source: APBJJlHH6P0+nBbiHfOJz5IZy9/y3c8Ck3KvQdih/zUCOA19uJfvRIkldk2O6vCwLFrbsAccFzOgyQ== X-Received: by 2002:a5d:5650:0:b0:313:e88d:e6cf with SMTP id j16-20020a5d5650000000b00313e88de6cfmr2256359wrw.69.1689282885052; Thu, 13 Jul 2023 14:14:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: berrange@redhat.com, ardb@kernel.org Subject: [PATCH 03/18] target/s390x: Use clmul_8* routines Date: Thu, 13 Jul 2023 22:14:20 +0100 Message-Id: <20230713211435.13505-4-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 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x331.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1689283016660100010 Content-Type: text/plain; charset="utf-8" Use generic routines for 8-bit carry-less multiply. Remove our local version of galois_multiply8. 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_h= elper.c index 53ab5c5eb3..e110a7581a 100644 --- a/target/s390x/tcg/vec_int_helper.c +++ b/target/s390x/tcg/vec_int_helper.c @@ -14,6 +14,7 @@ #include "vec.h" #include "exec/helper-proto.h" #include "tcg/tcg-gvec-desc.h" +#include "crypto/clmul.h" =20 static bool s390_vec_is_zero(const S390Vector *v) { @@ -179,7 +180,6 @@ static uint##TBITS##_t galois_multiply##BITS(uint##TBIT= S##_t a, \ } = \ return res; = \ } -DEF_GALOIS_MULTIPLY(8, 16) DEF_GALOIS_MULTIPLY(16, 32) DEF_GALOIS_MULTIPLY(32, 64) =20 @@ -203,6 +203,29 @@ static S390Vector galois_multiply64(uint64_t a, uint64= _t b) return res; } =20 +static Int128 do_gfm8(Int128 n, Int128 m) +{ + Int128 e =3D clmul_8x8_even(n, m); + Int128 o =3D clmul_8x8_odd(n, m); + return int128_xor(e, o); +} + +void HELPER(gvec_vgfm8)(void *v1, const void *v2, const void *v3, uint32_t= d) +{ + /* + * There is no carry across the two doublewords, so their order + * does not matter, so we need not care for host endianness. + */ + *(Int128 *)v1 =3D do_gfm8(*(const Int128 *)v2, *(const Int128 *)v3); +} + +void HELPER(gvec_vgfma8)(void *v1, const void *v2, const void *v3, + const void *v4, uint32_t d) +{ + Int128 r =3D do_gfm8(*(const Int128 *)v2, *(const Int128 *)v3); + *(Int128 *)v1 =3D int128_xor(r, *(Int128 *)v4); +} + #define DEF_VGFM(BITS, TBITS) = \ void HELPER(gvec_vgfm##BITS)(void *v1, const void *v2, const void *v3, = \ uint32_t desc) = \ @@ -220,7 +243,6 @@ void HELPER(gvec_vgfm##BITS)(void *v1, const void *v2, = const void *v3, \ s390_vec_write_element##TBITS(v1, i, d); = \ } = \ } -DEF_VGFM(8, 16) DEF_VGFM(16, 32) DEF_VGFM(32, 64) =20 @@ -257,7 +279,6 @@ void HELPER(gvec_vgfma##BITS)(void *v1, const void *v2,= const void *v3, \ s390_vec_write_element##TBITS(v1, i, d); = \ } = \ } -DEF_VGFMA(8, 16) DEF_VGFMA(16, 32) DEF_VGFMA(32, 64) =20 --=20 2.34.1