From patchwork Thu Jul 13 21:14:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 702241 Delivered-To: patch@linaro.org Received: by 2002:adf:db4e:0:b0:314:25da:8dc4 with SMTP id f14csp742241wrj; Thu, 13 Jul 2023 14:18:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlGFY9Rj/FN9SWjsYoCqxBBxo9ZO8j/PF0HkAdB/681NfcLNyxQj+4Dsk1ILcXXEZOlE9lsh X-Received: by 2002:ac8:7f91:0:b0:403:a6f7:a839 with SMTP id z17-20020ac87f91000000b00403a6f7a839mr3558227qtj.49.1689283110290; Thu, 13 Jul 2023 14:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689283110; cv=none; d=google.com; s=arc-20160816; b=KzKndv2EXLsJNhxme29tyU0FCEKXCWCHIyrgkdyMhewuO+k1L+ihta5zqM1z+nAVdo SJLs3HhMT/LraWED20BHiG1mjDP+LYwc+8xk9cDD3n0YM5shPIUJBR4c920ATcwTIDX5 3BquRaXQR8QqJr12p7qlCQW8LwpYAllEAadeYTaaVHH4jN96yNZLVbXEPFuKh4qtGad0 XSH60+DwMPN8rg6OGl779D2MDN+ekKWBGCkjMi4kGkWq8CjapdiuCqn27+Q2olgShuLL eMOaY5DMeMoQmfYtYwirTjeQPGhHoqEddFyNwqvGqlS7zwtn/3zjvDWTdOLVH+PHuzoc fSLQ== 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=uiRxUWQ/HM/fmJF0BXMvciSYviZrpuPjzgLczxVKcDA=; fh=4xNVIrgzKzsUJFZ/LK5iWzslbipp0obh3zmyxXTMM5Q=; b=EyZpJAmL934SYut++Vfs4qFjJ1kv8oBbf2yAQQqpH8XUx2bhm1RTrL2WF9rIJEX4Mh SBvJIN6mTlztFBHeVQjpvGPp67b1dXbbmhzc2oSD/sY7efzZN3aEPhMsYwBHnQTvWW2m 0VyVa4JxAQAiQ75EHODIWQNfTlEy49awZ3Oj+u516/6zij+03M0FDlT9MkDS5XOVU8jc mwEuZvQ4NPeAy/JSgFtEVcvtxFD5PO8hGN23nFjC9yRZhmKwQgLEgNVz31b4G9trbOGJ Kz/Ytd37gSAJrZalHwLOv9eZXaw2A6kAoTAGdH9m7RZ/LnQcBwY4YjnKmdicM2iEKDBV awtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="VlDqWrH/"; 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 v23-20020a05622a189700b00400a725621esi3677302qtc.508.2023.07.13.14.18.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jul 2023 14:18:30 -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="VlDqWrH/"; 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 1qK3ea-0000QP-Pb; Thu, 13 Jul 2023 17:15:12 -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 1qK3eQ-0000Mr-7T for qemu-devel@nongnu.org; Thu, 13 Jul 2023 17:15:04 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qK3eC-00016F-Cu for qemu-devel@nongnu.org; Thu, 13 Jul 2023 17:15:01 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3141c3a7547so1322193f8f.2 for ; Thu, 13 Jul 2023 14:14:46 -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=uiRxUWQ/HM/fmJF0BXMvciSYviZrpuPjzgLczxVKcDA=; b=VlDqWrH/ORjSn+/ojaVyuYiDoF8hi91RgmPXuZw1PpXzH3X8nfDlYA6T5NEvvDWpiy Jr8EGE9k1e6CNXDLoBsHF91xGt4kvKLwRKfDHHqQsK9bwFFIbySRS+gBzYnsmrlHJRy9 ZYU08Z/9kwbDPOeGGDe3ECNruoQAeACnXGC48DN3+osnWYBR3gm+BOce/xpQ/VqU0Jyj a5j8CYoHiVm4us5EMlcADlZ5KgN4QBwU28RPVd//Xmh7qgDSaqYfewfFLHOJOrNLgT/G 1wVEhU2Is3LKIDmZg7cH11ZqMZdRl7Ursrx1vdSQ+Wk4lcr6bvjS4A9sJ0Mv4mQMboxj ITmQ== 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=uiRxUWQ/HM/fmJF0BXMvciSYviZrpuPjzgLczxVKcDA=; b=K5MhPdGfWqhKcj9X9T/mhUr3OmPQ1dAD/M0TSVXfdnEVCYFuEVwP6nvPBFofFYwo3j ISnUkSNYirQ7iol2HjCP34CGJeb8oyIREePr9kmsUZmP+I8xSLn3JHfMHo/cTcnA73ZJ HfJ+efUQQpJByeVzBMtwWyMhcjQzCAF0KNOESdjqsOD0BNTkm5GfZk7W5Q98jNyW3m3r vUpbuKlh8wt5mt0VIUKWZkboMGmxwPL20aGb3RWgbIr4injCK34QC+h/Uwt7vFzJpJCf faxY7dEeRCRedBuiI0f3MQnvul9px1JElBcFqjXuP4XfYwOAaYq3kcSnw7tP86KCT+sN 8W8g== X-Gm-Message-State: ABy/qLbuJANSXpCTKNwZ4Sd3ziY3ktd5mPovm9YUN0SJfreZd4kr4QqF eZoLPjuUvXbDajiVTOPM5ADkaf1mBQpF9GGe2jN37ZOx X-Received: by 2002:adf:fa52:0:b0:313:f07b:8025 with SMTP id y18-20020adffa52000000b00313f07b8025mr2404490wrr.47.1689282885800; Thu, 13 Jul 2023 14:14:45 -0700 (PDT) Received: from stoup.. ([85.193.156.66]) by smtp.gmail.com with ESMTPSA id n12-20020adff08c000000b0030ada01ca78sm8973747wro.10.2023.07.13.14.14.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); 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 04/18] target/ppc: Use clmul_8* routines Date: Thu, 13 Jul 2023 22:14:21 +0100 Message-Id: <20230713211435.13505-5-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::430; envelope-from=richard.henderson@linaro.org; helo=mail-wr1-x430.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, 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 8-bit carry-less multiply. Signed-off-by: Richard Henderson --- target/ppc/int_helper.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/target/ppc/int_helper.c b/target/ppc/int_helper.c index 834da80fe3..3bf0f5dbe5 100644 --- a/target/ppc/int_helper.c +++ b/target/ppc/int_helper.c @@ -26,6 +26,7 @@ #include "exec/helper-proto.h" #include "crypto/aes.h" #include "crypto/aes-round.h" +#include "crypto/clmul.h" #include "fpu/softfloat.h" #include "qapi/error.h" #include "qemu/guest-random.h" @@ -1425,6 +1426,15 @@ void helper_vbpermq(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) #undef VBPERMQ_INDEX #undef VBPERMQ_DW +void helper_vpmsumb(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) +{ + Int128 ia = a->s128; + Int128 ib = b->s128; + Int128 e = clmul_8x8_even(ia, ib); + Int128 o = clmul_8x8_odd(ia, ib); + 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) \ { \ @@ -1445,7 +1455,6 @@ void helper_##name(ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b) \ } \ } -PMSUM(vpmsumb, u8, u16, uint16_t) PMSUM(vpmsumh, u16, u32, uint32_t) PMSUM(vpmsumw, u32, u64, uint64_t)