From patchwork Tue Aug 6 16:17:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Monakov X-Patchwork-Id: 1969636 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=ispras.ru header.i=@ispras.ru header.a=rsa-sha256 header.s=default header.b=T/vsvg6T; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wddkq0WF8z1ydt for ; Wed, 7 Aug 2024 02:17:54 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1A3573858424 for ; Tue, 6 Aug 2024 16:17:53 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by sourceware.org (Postfix) with ESMTPS id 2FAC23858C56 for ; Tue, 6 Aug 2024 16:17:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FAC23858C56 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=ispras.ru Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ispras.ru ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2FAC23858C56 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=83.149.199.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722961051; cv=none; b=ZP72Nsj1jPPovrylJBgyhhHiw7t8Z4ykBV+lnXgJ8O9aNpvlHxBEMgEyXYkmHsPw/2YcARI5bRE4KyKIDcTYLKjXkTtRlMW3BnveKD1CGn9JqtdJKhaVGrT13+RuTrV8woIgOQgbJEikj1SE/SWCcM2UwPICQ2E/y2e9LNMVU5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722961051; c=relaxed/simple; bh=QWGLv6v20mXXTIKKLE3t/3ZE3L127gAPpOatQKVbSvk=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=lFsmlarj0XjkIv9DRBUMSAkNK/pTW7gV2svRT1F7vKWf9Feobbo7iaTA15b39QyfT+WMesVANoAOo27LlVpmg6EIe9ehZweXse86eDxjMxdshsopeOhq+cz1w0YFClVPJn++PmxcXPCa3UsysGlg9+W1456rQ70cmeyd+CkX540= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from [10.10.3.121] (unknown [10.10.3.121]) by mail.ispras.ru (Postfix) with ESMTPS id 676B940737C3; Tue, 6 Aug 2024 16:17:28 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 676B940737C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1722961048; bh=UL41V3nl39IXQB6gTRhHVLZi2YHEvkoUea024tGlAR4=; h=Date:From:To:cc:Subject:From; b=T/vsvg6TQpP7Hk+u39Bx3xvuz0nAYroZlU8JNPkBOryLdozOOV4ujbYx11aXRuq53 tDaBN82FGHaTxJd4Jz02TPzT5YSHIy4CnlDLjVH+DK+aE+M7kA0UBpqtLNThU+LNQ+ 6j79yTeagz2HEbaMhuSaqtkBE3i9vdQMs7uUWMNQ= Date: Tue, 6 Aug 2024 19:17:28 +0300 (MSK) From: Alexander Monakov To: gcc-patches@gcc.gnu.org cc: Andi Kleen Subject: [PATCH 0/3] libcpp: improve x86 vectorized helpers Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Hello! As discussed, I'm sending patches that reimplement our SSE4.2 search_line_fast helper with SSSE3, and then add the corresponding AVX2 helper. They are on top of Andi's "Remove MMX code path in lexer" patch, which was approved, but not committed yet (Andi, can you push your own patch?). Apparently the branch where we find a possible EOL and return from the function is poorly predictable, hence a small win from AVX2 use (wider vectors => fewer mispredicts). I'm also attaching here a microbenchmark for testing all variants in isolation. Alexander