Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTFvG-001SuL-3F for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 06:42:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rTFvF-00ANnV-6X for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 06:42:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTFvE-00ANij-3q for pgsql-hackers@lists.postgresql.org; Fri, 26 Jan 2024 06:42:40 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTFvB-003QWt-3o for pgsql-hackers@lists.postgresql.org; Fri, 26 Jan 2024 06:42:38 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id CB4FA5C00AB; Fri, 26 Jan 2024 01:42:35 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Fri, 26 Jan 2024 01:42:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1706251355; x= 1706337755; bh=PcjyRQ+8fV6v1UVeWu/JzOTUfyJCV1DEE6VCAkefB9M=; b=R CGoEt/dH5wRwqEF2hNfrRBi1ODlCXLMcRbZcV3AYZAS0sV4TF4uMsqn3YOOlTnY2 k56zfMFvlk/NHfmyLrks0VUeaBAM+tOM8l+NuBHk2gNSKAgGRMEa1qhMgnDN3OsT 0pIIxQBF/r0wslLaEVaAC9xqyWlJ1lWPic9r0WIVd90F6u5G3uFQ4bTmNOvoRQ11 XaIJ8RwvZ6rVa6odmWKP8vAueRLeEAvN+MdbxiPkqaepYH4TYeteFDbf379pfRgR wi6CVY8ZERg2lMkwbjc8Ztuyr0MAGPNn8AJiUZEJTezOt0rAwai6vW2Kvu+Bypmi Q9SXDV5Yl2ljI7nw3VB7w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeliedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepledvkedvueelteefffevjefgfeeuleehjedtieevjeel ffegfeelgedvteekvdetnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh dpphhoshhtghhrrdgvshenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 26 Jan 2024 01:42:35 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1706251353; bh=NCASw5oQj6b1zVf8ej0SCazdzM3X7RC0CcECq8xGCAo=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=oVxRxgIHwLqcyp6khiGG8Xi9km6tLToC4kUNaFAWTMCJY9mlkSbnAnHFl2+3ByscD We4KwsI2RbC8QPhYSU07w3Xi0qD/fzQPyY2JmUfDC87fEayOMrnNCWN8dMghlWwPWw nQ+zUsVzUj63UEB7Jq2iqDcbBKRucONMbu/y/k0ookmW96RLyPMuB9JEfCYxEqf36B vcjMJB3Yqtk3Cgmc3UIXBDbtzUf4mqbxBIkYAXhcYJD9V/mrzeZ02JTWR7tv5YzLuu 1ZBDp/guwgEvhAtU4+3JxXoIvbKtyMKOwJcX1XLZC5wUqlV4wbt/ydJ88V3lTJDaTl 5abho1lcvbAZA== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 6350E9B0; Fri, 26 Jan 2024 07:42:33 +0100 (CET) Date: Fri, 26 Jan 2024 07:42:33 +0100 From: Alvaro Herrera To: "Shankaran, Akash" Cc: Nathan Bossart , Noah Misch , "Amonson, Paul D" , Tom Lane , Matthias van de Meent , "pgsql-hackers@lists.postgresql.org" Subject: Re: Popcount optimization using AVX512 Message-ID: <202401260642.3rxzgb2xrhkl@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202401250949.xrwkd46bgbpl@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Jan-25, Alvaro Herrera wrote: > Finally, the matter of using ifunc as proposed by Noah seems to be still > in the air, with no patches offered for the popcount family. Oh, I just realized that the patch as currently proposed is placing the optimized popcount code in the path that does not require going through a function pointer. So the performance increase is probably coming from both avoiding jumping through the pointer as well as from the improved instruction. This suggests that finding a way to make the ifunc stuff work (with good performance) is critical to this work. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "The ability of users to misuse tools is, of course, legendary" (David Steele) https://postgr.es/m/11b38a96-6ded-4668-b772-40f992132797@pgmasters.net