From patchwork Thu Feb 15 08:14:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 772874 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp713010wre; Thu, 15 Feb 2024 00:15:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUccb5YiF4vlECLc7J9bDbqt3uuH+RBc+CrAnyKK0nHg751ZGxEr+pY6oDBvChGiaWgBKd6kTRIRdHjGTHLt3Da X-Google-Smtp-Source: AGHT+IFs2C0wxAKTEa3KxB4cknXLyvx3Wjks3JIahyOLqt8AY2yd+XXHLIUPCrk8emCMyycpjUf8 X-Received: by 2002:a05:622a:254:b0:42d:a679:45fe with SMTP id c20-20020a05622a025400b0042da67945femr1510600qtx.46.1707984943763; Thu, 15 Feb 2024 00:15:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1707984943; cv=none; d=google.com; s=arc-20160816; b=cCdVNqLknoUxoY1Cg4t2qSu/27wKDsRtnk7SXtECP+2wNOx7mKnP5netiCp/U3nZ0O lPiT1U3ZaUIhUEwNve5i/3nkAc7QeKmK09DJkJkQAEJIeZQwQoz/5GD5YeAEtI5GuKMH iZSDNqzZDmG6N+HYMM8iiNtsH6byceDEKXuQ6gLQQW6RXgyAHqa9wXIY3N1LeFIHQuAv LUyx63lm+Lh6A2gTibeC5YcP46AeKaH/boJBIb1g7LB9TXL7xjFM76Bs8AASjcdLbPAR HEe/gjKHNo1E7M1kxGTS+a94ql8EZqFC1OUCmFLVuBHYnFg4eZB7ZcLLuIzBUzYysYOy dMVQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=51w7WqLtSA4pKO1dAYkg1D5uAKjDUngSsDP3jJjdJ5o=; fh=bXD9UGo7d05OYjVg0qF2wA28p2gxs496M6ftxgeDKVY=; b=tl7oKNe+ocOyoujLB4D8hFwyk/iegnHUvYeDF0xIyEE3UPahRoJWIVJwOr5TwHMxJv 2U4qwT+MbYfnnBmB8OrC90f4/3jNiKCfoiyTDybuzfEs21FCDWrGeL+iNZSiKFTNXdTx U/gni4xVT8ekop9axEsYCQTmPg6Ok83+mdPJeEoUvMot52ZPT1zBjKUXTuyn28Gxk1mK 2JyRI3aoCB1LoO6zqkhgKZkqXaHSu9hehto03gRBLOp4Kf+5cc6HocAqNmfe2Ye8NPoO oETF1jxUzcB5s8qWyitlFGiaf004XSXn6I0zMNJSMdmkire+modGbUBRbuK5XcobWpO3 cxzQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XIbleCR3; 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 fo13-20020ad45f0d000000b0068f1419196esi958855qvb.84.2024.02.15.00.15.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Feb 2024 00:15:43 -0800 (PST) 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=XIbleCR3; 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 1raWu6-0007XZ-TG; Thu, 15 Feb 2024 03:15:34 -0500 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 1raWtT-000713-Ad for qemu-devel@nongnu.org; Thu, 15 Feb 2024 03:14:56 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raWtR-0001Mz-HG for qemu-devel@nongnu.org; Thu, 15 Feb 2024 03:14:55 -0500 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-5dbcfa0eb5dso553440a12.3 for ; Thu, 15 Feb 2024 00:14:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707984892; x=1708589692; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=51w7WqLtSA4pKO1dAYkg1D5uAKjDUngSsDP3jJjdJ5o=; b=XIbleCR3LjMIcntmpa97OekoB/hwiQYBFQRcaC57PrlVxacza0Y0eAAUPLyakZIaO7 QhDGlsr9X608zvzOPzmqhIgileVMhPlMY0Dv2rdVTExpgIRUuaPWWBRCAsy7ec4JAvf4 xM7ET8CIe+Zhq3EbZPtU66KBQkyCMcC92YoxXgP/4fzVoC7TnDcle56JaIjjntJEo+Gd o/S6BZgOcIKnGTG6JlyPWedcfmfvZwlXr7BU7itEzxwNhYywH5ymiUzBCair8LqXdpO4 7W2BbF9Bc1jMqaNx/9PZ4RzCzxKAI/PR/uwAUw8QFJm9wnK57gmRM56x4I2YmUmMocsx nwHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707984892; x=1708589692; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=51w7WqLtSA4pKO1dAYkg1D5uAKjDUngSsDP3jJjdJ5o=; b=IgrIR9UVspI4V/xr5YDS6GL5Or+Z6p+4WhmT3MVW97dIw0HkoJkdPIXK03gIc7f0v/ FMG4GO8AYp7ikUF2RGNxj5tGzpOxVFC640lwuET8sxc4fbdMbKjQRyyaJu3pyWjheVre P5vz8teP2sYzC5Tz38omTixH/W3DqY5zovbBtdkc5dTa+ZItetmon3SsDYCnvhq7hk59 Zn5nyXMP4idPNzB1hwEZzsBfqFpHhOkKrIs419881gblDc+8RCgV3eErRt6syjuUav/f zGdh80sI6nk8Ra9Ao37sE2sla1IfywrUVnQ/t8eaicmt3gLk444loZaJWKxI+SDW7fJp aQPQ== X-Gm-Message-State: AOJu0Yy+3++XkNp98Uf5pWXjIIXMMsfAgZkiUrWkmOi9vgnC6dtbYE1T vHVLbXtfY5I+lTkNuMvMjqE8lLaabAjrfCfXHV9FrFRRN6hOi8lvTgRK/kvGVp2/obJTlijJyDf C X-Received: by 2002:a05:6a21:3a44:b0:19e:3b15:2176 with SMTP id zu4-20020a056a213a4400b0019e3b152176mr1572430pzb.38.1707984891857; Thu, 15 Feb 2024 00:14:51 -0800 (PST) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id qc14-20020a17090b288e00b0029900404e11sm807755pjb.27.2024.02.15.00.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 00:14:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: amonakov@ispras.ru, mmromanov@ispras.ru Subject: [PATCH v4 00/10] Optimize buffer_is_zero Date: Wed, 14 Feb 2024 22:14:39 -1000 Message-Id: <20240215081449.848220-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org v3: https://patchew.org/QEMU/20240206204809.9859-1-amonakov@ispras.ru/ Changes for v4: - Keep separate >= 256 entry point, but only keep constant length check inline. This allows the indirect function call to be hidden and optimized away when the pointer is constant. - Split out a >= 256 integer routine. - Simplify acceleration selection for testing. - Add function pointer typedef. - Implement new aarch64 accelerations. r~ Alexander Monakov (5): util/bufferiszero: Remove SSE4.1 variant util/bufferiszero: Remove AVX512 variant util/bufferiszero: Reorganize for early test for acceleration util/bufferiszero: Remove useless prefetches util/bufferiszero: Optimize SSE2 and AVX2 variants Richard Henderson (5): util/bufferiszero: Improve scalar variant util/bufferiszero: Introduce biz_accel_fn typedef util/bufferiszero: Simplify test_buffer_is_zero_next_accel util/bufferiszero: Add simd acceleration for aarch64 util/bufferiszero: Add sve acceleration for aarch64 host/include/aarch64/host/cpuinfo.h | 1 + include/qemu/cutils.h | 15 +- util/bufferiszero.c | 500 ++++++++++++++++------------ util/cpuinfo-aarch64.c | 1 + meson.build | 13 + 5 files changed, 323 insertions(+), 207 deletions(-)