From patchwork Sat Aug 19 01:02:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 715014 Delivered-To: patch@linaro.org Received: by 2002:a5d:484e:0:b0:317:ecd7:513f with SMTP id n14csp801340wrs; Fri, 18 Aug 2023 18:05:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGqJegyx/XNjrE/g175mWRw88xYYSTD07f01niXBpl3yXDvu/f4qb/aFMzSQFxB0iNS3Oza X-Received: by 2002:a05:620a:3183:b0:76c:d05f:99f5 with SMTP id bi3-20020a05620a318300b0076cd05f99f5mr977111qkb.52.1692407106757; Fri, 18 Aug 2023 18:05:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692407106; cv=none; d=google.com; s=arc-20160816; b=yNrhOxGvsXpNIEmCobZXEXjnx4w5NGXpRJrJtPIFzmuLsFzH3gZkJvkb4wjUH5ohZn mgHMXgrm0fEq9z6yy/Rig4FESg0f67EZ6fdJ6KVjCP3kHsEe+s18Js5kwnIH+Jsk8UBT O/yisP1JdAjJ7yfyGCUSHJv44bG6bDjpQ0tXDFYIZaFsPPu8FcHP2Unzzitk7y8Gj00j 17BaRfWqqN2ZYpMoBa3z7zgA6QE45wDRgehT0vDbZYpGg1AZ8aNowWdBEdYdoKrKyTZw uT59FJYy8ZCxtj50cNGlfbGqv5L+oFtZFxbZzp9g5H8xVFG47DLyOPUPfRjjM11tRiAW 8WCQ== 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=ZRvobRxifTOwS5r7R7zXbKsRuZh6imu3x1ylIR15QTo=; fh=4xNVIrgzKzsUJFZ/LK5iWzslbipp0obh3zmyxXTMM5Q=; b=xXgd445ZkDBAhH+iXikDMHBtMbeW1fEhjo96+v5fLwpWQrc23QCIg7QJq9YC6//lcj BcsPUK01Auzinf3q4blpkHKRw60w29Un3qze8dQGuZfHterGMTFiXwNPKeEFtASpm60v dlV4bRcPKmGHjUOH5JGEX8jgcg8EN02J4PoK25ocfRJZFoHZDkNFFNyOGFrivsZdkzky 6hGsVT32Q883nTcKb+GD7DfcZXjAD5R38vpoUdd0/a/OYgYbrmgaF9xYMMdd/S8qYCnv sGFmeq0eyqJ+3hzoiEQtz7ClNflVrSv4dsYqihiGrEhciMdaFjmDKkPOUex7EofJINOB KJvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vSko8l00; 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 i20-20020a05620a249400b0076d8644a47csi1931561qkn.433.2023.08.18.18.05.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 Aug 2023 18:05:06 -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=vSko8l00; 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 1qXAML-0008Sj-LN; Fri, 18 Aug 2023 21:02:33 -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 1qXAMI-0008QT-Az for qemu-devel@nongnu.org; Fri, 18 Aug 2023 21:02:30 -0400 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qXAMG-0007Lf-1a for qemu-devel@nongnu.org; Fri, 18 Aug 2023 21:02:30 -0400 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-6889078ee66so1257382b3a.0 for ; Fri, 18 Aug 2023 18:02:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692406946; x=1693011746; 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=ZRvobRxifTOwS5r7R7zXbKsRuZh6imu3x1ylIR15QTo=; b=vSko8l00lJ/TbMwRXhOCOhzuMltviL06MrhXmbaZ+WA6VbtgxNFy4qNtBdn5AcXqPj zY06qybaC4EC3+HvW8OM8cA9TFgcQfE7HTxbKu+s1tV0/9etrIbXocr2MUHMBitX0yuB XMD6D/DXPDDzsSwYFB4k5WPzkIJdki4I7/lSGFyW2EYemGgctdPIM/sbeX0K6IaXhlSe adR5pOXzBUJObFqd86n2dWDMreKNyLBtSPXM9kqEEkzGtGN0DA3NP294kDr8mQH5Q3yI 8/ZxlHiPxltspoAwp0Pl78TPJgi79ocr/dY4m6bxxOctdxIW6peLObg1z3ZMXWctvgmy Ijug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692406946; x=1693011746; 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=ZRvobRxifTOwS5r7R7zXbKsRuZh6imu3x1ylIR15QTo=; b=gOVdQv0FBLZQOFzDESr3SOBGcDY9ua8P05n/I6J+ARkWmAWfGj+a/NizsERQXyneAx gZG/7688w/FV0vi72oUVWUtS2geIYxznzR43MS5jpBajHsndVtFf7gTnXlv4F5lOsqEs E/YundQMy1t+Km7eLQuqMcBt8ANLlmunicddT9c+lpuIbA2uAi5bM2VYhey1ouzON+DT n2YpIHGeRsmiuZrdyQqCa5LjXIWMM/VyF8i9bGRoXvr/yltRnAeY49FW3f0pzz9d1wVb tafmcBFnRC0dXZgLuAsYYSjf3QaaSkeQM2Pba5TWgkRwhD+Y7INF02AZ1PjOsEHFHSWD 7S5Q== X-Gm-Message-State: AOJu0YzakWh4vXmm7UulJLolXmHW0vdf7IIEy6uQDQPDPc+s1MnOXW3H 7DzsnNlTuPz9PbDChls0uscFmFpwFT4HB2R2sc0= X-Received: by 2002:a05:6a20:8f09:b0:137:2281:944f with SMTP id b9-20020a056a208f0900b001372281944fmr916565pzk.40.1692406946554; Fri, 18 Aug 2023 18:02:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Aug 2023 18:02:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: berrange@redhat.com, ardb@kernel.org Subject: [PATCH v2 07/18] target/s390x: Use clmul_16* routines Date: Fri, 18 Aug 2023 18:02:07 -0700 Message-Id: <20230819010218.192706-8-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::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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,