From patchwork Fri Sep 15 16:42:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 723130 Delivered-To: patch@linaro.org Received: by 2002:adf:f0d1:0:b0:31d:da82:a3b4 with SMTP id x17csp488190wro; Fri, 15 Sep 2023 09:43:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDlfMfroT1oKhbJVur8ATl8woLs/LQMJpMsGUrME4pypJ5s9xf/Mn8/GO2lQpbeU07yxsX X-Received: by 2002:ac8:58cb:0:b0:417:98a1:3403 with SMTP id u11-20020ac858cb000000b0041798a13403mr2229947qta.25.1694796190645; Fri, 15 Sep 2023 09:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694796190; cv=none; d=google.com; s=arc-20160816; b=xLgQ6vdV149u3mHPfuLzRE9Uj1qmfVOKtMc2KttYBq21zfkJT2HTtZ+3oNrPIQ0DGy UwK/QUQSiVEro8IsaAR8uJ33Tx4SrVXunvI0GCwXfWtxDbsOXbxmwP+0mWWL164PdTbj RoH0C1XfT+x5i/R+GzmJt0cWE8laDL9lhHaw9rwuduAtkvZ/+lc5xjdYaKij4g8Gb9Lt rexRD47LKaU19bPC4640kiXS3C5TVG/m4JR1daowpvj7xtM6xChq24r1PuCFRSNI9SXL uAIwMHJAn5SlpzdhKm1hv/FzfMRFAMjw+SlGq+BR2G6n4RzJ4qknBT9Sfa9pWyaX7f34 gYSA== 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=LeRwmoZj3gayyKtebRoC0JW2YuHlKTaNGyIqgqME+tw=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=Ck7thSQikr5eHgEGKSryXMSp6WTWO/7rpF45l+xSJfKr243IgCiJzkN/RlgHD3DHoK feKDcIBsrhXpoh4Jb5XmjiMYLM4BliWWQ4HDbTrQEhtSkYA+fw5/rYOr4HhJmF6567L7 wX9B4TZ7bg75j339Ep4xQIp3CuzF5zafl6pP62VS/YWGlimb5VmFNm7pJmFzdcLYWpst P7/coYKSsKfGyCw9VjfgTlH4irFYWxRtiLYhist1+Hzm2uHX2sVhbgc+qj/gp415Rtgl mqFnmtb+OWcU4z5tuxGEpFkSqgWvOvF7tm+8CL7U3wii1FK4pwPeEw8An4JhaxsITkf1 3NDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MLzuqBHT; 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 i19-20020ac85c13000000b0040556bb3b65si2649675qti.674.2023.09.15.09.43.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Sep 2023 09:43:10 -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=MLzuqBHT; 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 1qhBuB-0004YY-CX; Fri, 15 Sep 2023 12:42:55 -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 1qhBu7-0004W8-0c for qemu-devel@nongnu.org; Fri, 15 Sep 2023 12:42:52 -0400 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhBu2-0004wW-6b for qemu-devel@nongnu.org; Fri, 15 Sep 2023 12:42:50 -0400 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68fcb4dc8a9so2247964b3a.2 for ; Fri, 15 Sep 2023 09:42:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694796165; x=1695400965; darn=nongnu.org; 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=LeRwmoZj3gayyKtebRoC0JW2YuHlKTaNGyIqgqME+tw=; b=MLzuqBHT1waQVa1NmOP9k3UJtevIvMy1oTuSwiUvfGcDmEeoZ9Jb3+fvztG9ofYGsq UAxlC9Ff02l0EfDVaEMMq91hzSnWiRSl8PTwAgzn5StD1egatIJxGD5Mj0ex9m9LidX+ fBHett9ZGt6UtHUeTy4nzZW9r9Km9aQFpr0e12yZGXtyYTE8LNPuevRrDJBupeixOQft sjG21otw/lldKsRfH4Ek+/ZKH+n0gl0qpAtHJf4L4YjtaBPzYpji4IERipln9z1G8yzQ il9Dh46xVgsOeRK9HBh1pwDqjj7KsKsVGMwOQpHk3fCki+XaBRdQ3reKnUzE8prMvZ4I YqQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694796165; x=1695400965; 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=LeRwmoZj3gayyKtebRoC0JW2YuHlKTaNGyIqgqME+tw=; b=Y6jMYPGnlj+6+o8G9CCvO+0ckE8nqrVZIv130nglztMOKhQOWIr/Nj9XMwLhPl6dVb HVbIVQRwXxnJbL0+MgdothUDkFUEEmUnjihT4uuzDANBAumzNe72MXZ3RwhyL76/OlXP EHUgQndeJ6bdcLKas1nSc+DCiHeJl+YdXJmCwmiyA+qo0wtxDLBZoT0h9UQx+mcRPGKL OLZ2qa3l+Si0eJSStAP6j6DqDyHQVjgEVZRIgf6tZhbxdnm2Srt8zAc/8b6WZMiAlleO 5Ln+YWsDUMw74UB2NfWq1S7cEW8eBsMsEWw1fJ7dqb2G6ECwHqOzN00ub6K2nuYD3/sc tfMg== X-Gm-Message-State: AOJu0YxhosdMNcgHQPiEQHtB8/cqutLg1nopQ/FrHhXSsNA5Q6i80VWU jsMEFkhKWzyy6jWHEhZ56NNAxiWFd75JeS9KT3U= X-Received: by 2002:a05:6a20:bb02:b0:157:7568:6796 with SMTP id fc2-20020a056a20bb0200b0015775686796mr1890837pzb.60.1694796164956; Fri, 15 Sep 2023 09:42:44 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id s187-20020a6377c4000000b00577f55e4a4esm3010087pgc.20.2023.09.15.09.42.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 09:42:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 14/19] target/arm: Use clmul_64 Date: Fri, 15 Sep 2023 09:42:26 -0700 Message-Id: <20230915164231.123580-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230915164231.123580-1-richard.henderson@linaro.org> References: <20230915164231.123580-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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, T_SPF_TEMPERROR=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 routine for 64-bit carry-less multiply. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/arm/tcg/vec_helper.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index ffb4b44ce4..1f93510b85 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2003,28 +2003,14 @@ void HELPER(gvec_pmul_b)(void *vd, void *vn, void *vm, uint32_t desc) */ void HELPER(gvec_pmull_q)(void *vd, void *vn, void *vm, uint32_t desc) { - intptr_t i, j, opr_sz = simd_oprsz(desc); + intptr_t i, opr_sz = simd_oprsz(desc); intptr_t hi = simd_data(desc); uint64_t *d = vd, *n = vn, *m = vm; for (i = 0; i < opr_sz / 8; i += 2) { - uint64_t nn = n[i + hi]; - uint64_t mm = m[i + hi]; - uint64_t rhi = 0; - uint64_t rlo = 0; - - /* Bit 0 can only influence the low 64-bit result. */ - if (nn & 1) { - rlo = mm; - } - - for (j = 1; j < 64; ++j) { - uint64_t mask = -((nn >> j) & 1); - rlo ^= (mm << j) & mask; - rhi ^= (mm >> (64 - j)) & mask; - } - d[i] = rlo; - d[i + 1] = rhi; + Int128 r = clmul_64(n[i + hi], m[i + hi]); + d[i] = int128_getlo(r); + d[i + 1] = int128_gethi(r); } clear_tail(d, opr_sz, simd_maxsz(desc)); }