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 1rYaHz-00GeDn-4h for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Feb 2024 23:28:11 +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 1rYaHx-00CzuM-6C for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Feb 2024 23:28:09 +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 1rYaHw-00CzuD-T1 for pgsql-hackers@lists.postgresql.org; Fri, 09 Feb 2024 23:28:08 +0000 Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rYaHq-005xi7-2O for pgsql-hackers@lists.postgresql.org; Fri, 09 Feb 2024 23:28:07 +0000 Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-5edfcba97e3so16549807b3.2 for ; Fri, 09 Feb 2024 15:28:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1707521281; x=1708126081; darn=lists.postgresql.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=duimf1bF8yBLdw29EiNka+hQwlcp9ofaCvHN/8Xs5NY=; b=br7rr27vxu+lR87Ann2OvwZGdT0UnyRH88wSaDhV+D4bhcwGCbDb6ZK9W/V9KIdLbP kaXpnQMSG7RUpwPaDCtTNyU21q2Rz76JKmue1njiTVhCArnXVomqpom50XwWfgaDYuGV +WuH+D0bulT/OJE5p9NUrhYflnMzFUDzleCO8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707521281; x=1708126081; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=duimf1bF8yBLdw29EiNka+hQwlcp9ofaCvHN/8Xs5NY=; b=YmyE31q0oW0Uf1fEOw1i7yFWlUV9fXQK/5hQKoOzziWUgvJX5IVisKmIP968SKlYSh zSW78k2rfXFWTpWLEXeYLVmavD6pZuWJw6SeEoZfQcDuDvKXFRuXtI2kW0GZrMZy1Rjl y3QH1tV5Abf5bgYmMBeHTakx7WXNGYxNBQVV96r2vTgvSP2mxTl/5zc268Hp3H1B5eqD wLU71Y+QqffOV0D0IzwDBMEeLdPMEltedtBT4oLaa0gd1naTdE5sAtRlyBht600nl7n8 VeD6M1s92/HGDJGkgbPGdAhn/+qBU1fXaYe9wkFHZW32E6DbJOzQUqYTWtIpz1VCJ4XN +gug== X-Gm-Message-State: AOJu0YzAZ9yFM9d9qF8xwQ1p5hAP2Y64aLQFCcOBz/qUCdmprika7ZqI BtnBHiVVcCHHrMyN9KmEl4TgOzqptxGExBDc354qooAwvwKQTExQtbd1WSKx5Q== X-Google-Smtp-Source: AGHT+IFL4/58k+39+eGuGpabfHJEbnUY4ol+xSe9NyeUsCGVmZix86U8JMpzm+6hPL9oTpEh8UM/Sw== X-Received: by 2002:a81:84c1:0:b0:604:b8b1:7880 with SMTP id u184-20020a8184c1000000b00604b8b17880mr779762ywf.3.1707521281035; Fri, 09 Feb 2024 15:28:01 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXVP6NfphWKlZpmOZEUxFP0MOdH5Xq1hoVSYf1cvTDB1oIY37gvx1wm+by5RCNxkychpg9fnyFamsg1tTjerQ54FE3lPOqK5AYNMDSO1MCMkNp2GwuBLOznXbjAFeu/hUu8P0aMWfjaUdrLLOdBACOjBcs3jbuZWJ7uXDv+oZd6P+A+3Eugib1k50Kf5HTHF6qkpKuxjFZlBNnGsuqdGcESSoxaaOZpnoRYHJPyDZl3qzWbT8gvuJhX+7C6T2KSkU0v/h86dH/dK/cflhmqLojsWh8= Received: from rfd.leadboat.com ([2600:1702:a20:5750::48]) by smtp.gmail.com with ESMTPSA id u189-20020a8184c6000000b006048400c8e6sm100319ywf.78.2024.02.09.15.27.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Feb 2024 15:28:00 -0800 (PST) Date: Fri, 9 Feb 2024 15:27:57 -0800 From: Noah Misch To: Andres Freund Cc: Alvaro Herrera , "Shankaran, Akash" , Nathan Bossart , "Amonson, Paul D" , Tom Lane , Matthias van de Meent , "pgsql-hackers@lists.postgresql.org" Subject: Re: Popcount optimization using AVX512 Message-ID: <20240209232757.5d@rfd.leadboat.com> References: <202401250949.xrwkd46bgbpl@alvherre.pgsql> <202401260642.3rxzgb2xrhkl@alvherre.pgsql> <20240209182432.7c2peq5cgbdl43um@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240209182432.7c2peq5cgbdl43um@awork3.anarazel.de> User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Feb 09, 2024 at 10:24:32AM -0800, Andres Freund wrote: > On 2024-01-26 07:42:33 +0100, Alvaro Herrera wrote: > > This suggests that finding a way to make the ifunc stuff work (with good > > performance) is critical to this work. > > Ifuncs are effectively implemented as a function call via a pointer, they're > not magic, unfortunately. The sole trick they provide is that you don't > manually have to use the function pointer. The IFUNC creators introduced it so glibc could use arch-specific memcpy with the instruction sequence of a non-pointer, extern function call, not the instruction sequence of a function pointer call. I don't know why the upthread ifunc_test.patch benchmark found ifunc performing worse than function pointers. However, it would be odd if toolchains have replaced the original IFUNC with something equivalent to or slower than function pointers.