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 1rqJIR-00BfiJ-9p for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2024 20:57:55 +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 1rqJIP-004Etb-1t for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Mar 2024 20:57:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rqJIO-004EtT-MV for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2024 20:57:52 +0000 Received: from mail-il1-x131.google.com ([2607:f8b0:4864:20::131]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rqJIH-007Lbm-FC for pgsql-hackers@lists.postgresql.org; Fri, 29 Mar 2024 20:57:52 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-36894e0aaabso9160265ab.2 for ; Fri, 29 Mar 2024 13:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711745863; x=1712350663; darn=lists.postgresql.org; h=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=q/VPepiVaHObRmCI9KX1N8SkxtCItqENqCGnKaeiad4=; b=ZEND/IXx6fI5GHYa8rZoyvdStsXcuMdPJYk01RPL/IxEfraU4WY+oPCes/Pw0cTMGy 8A6SUFI8f3tLq1QoACKyRDPmJ29sJP0Lr+ozlg+JjbG4eEq8B/cP/ynArMlnoq/AaMHd QqKrn62WOvzd619VaP6bUJcZIbk1Ni2ndvFJa4lfX6fqECVjC8tziZYoCBEOr/lim13j Lm5zIA4oLbUbshDdT3i6AfUkmoTTyqL3L3UCZmJu6c7Q2IqeVkEVeukst/6te5DAKmxf mH3R8qZUsxaJtGpFF1GiHBi4GZrfPkrjoRFTzIdR+j8RCE5eLbe20LQgv/nPIbLttfut JdGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711745863; x=1712350663; h=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=q/VPepiVaHObRmCI9KX1N8SkxtCItqENqCGnKaeiad4=; b=dD+d3+7btqBYIkXeY8CwiIijVAZebFz9MUEoSxnJJGJW968sR4c0eDcxBp2g+YREBF n9CAYbtiwGUXUGj/xnKYZNuicEqmORXO0BLwYf7aOnYCnCxarSxeA1XFf7PRXr9hCq/9 VBs4xJSR/Spna5pYcH0GUiQJe3EzaKh5u2m7E0Np+N35VPwiXpsWIvEV8v6cMSRRIhWU 36Yv3A1FM3QFAdIzkQA3D57j13YWERLaPq3okwxYgvvkqbHnAZkcYKgDL1I812AKFqpF oSsAPpqL8CYh35tBe8/nzIMrR2u+d+VTn4zGYb/tRp0d8TPevBh8WqFIZdwRdWTmPfYh tQ7g== X-Forwarded-Encrypted: i=1; AJvYcCWBj1Twx0o/lkaT9yhRCN9mGXXcAi0jCAZpcYp1vCQrNthnXb/qRWI14i5WexGBaMIg00iNIHGokW3XSV914IX8EjwGSW8ebe5DX7r/gNiMfRKE X-Gm-Message-State: AOJu0YyCIiTnm+Q5/c/UU1bV4IRPTK48YLkrpScKVCZQvuecrwy49+G3 xvXHdMGRpT798jZeQ+TDQ7MSwjqbHny9dtXWmzXKHqdLWB9A7aoN X-Google-Smtp-Source: AGHT+IEQcdkAEjBWMmdn86KVRP14hxcN0g8leJkcZTO2ObYW6bDUElqk58sqUA66CDWncs8EnyRKQA== X-Received: by 2002:a05:6e02:b49:b0:368:c433:51db with SMTP id f9-20020a056e020b4900b00368c43351dbmr3565827ilu.23.1711745863268; Fri, 29 Mar 2024 13:57:43 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id k4-20020a056e021a8400b003689a9e5017sm1294873ilv.47.2024.03.29.13.57.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 13:57:42 -0700 (PDT) Date: Fri, 29 Mar 2024 15:57:41 -0500 From: Nathan Bossart To: "Amonson, Paul D" Cc: Tom Lane , David Rowley , Andres Freund , Alvaro Herrera , "Shankaran, Akash" , Noah Misch , Matthias van de Meent , "pgsql-hackers@lists.postgresql.org" Subject: Re: Popcount optimization using AVX512 Message-ID: <20240329205741.GA1593561@nathanxps13> References: <20240327220010.GA231058@nathanxps13> <20240328213854.GA916732@nathanxps13> <20240329155940.GC1046039@nathanxps13> <20240329162211.GB1106154@nathanxps13> <20240329191312.GA1411904@nathanxps13> <20240329200828.GB1411904@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240329200828.GB1411904@nathanxps13> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Mar 29, 2024 at 03:08:28PM -0500, Nathan Bossart wrote: >> +#if defined(HAVE__GET_CPUID) >> + __get_cpuid_count(7, 0, &exx[0], &exx[1], &exx[2], &exx[3]); >> +#elif defined(HAVE__CPUID) >> + __cpuidex(exx, 7, 0); > > Is there any reason we can't use __get_cpuid() and __cpuid() here, given > the sub-leaf is 0? The answer to this seems to be "no." After additional research, __get_cpuid_count/__cpuidex seem new enough that we probably want configure checks for them, so I'll add those back in the next version of the patch. Apologies for the stream of consciousness today... -- Nathan Bossart Amazon Web Services: https://aws.amazon.com