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 1rmKUh-007Gm1-9Q for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Mar 2024 21:26:07 +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 1rmKUf-006Dzv-NK for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Mar 2024 21:26:06 +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 1rmKUf-006Dzm-Df for pgsql-hackers@lists.postgresql.org; Mon, 18 Mar 2024 21:26:05 +0000 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rmKUc-005CzZ-8h for pgsql-hackers@lists.postgresql.org; Mon, 18 Mar 2024 21:26:04 +0000 Received: by mail-io1-xd32.google.com with SMTP id ca18e2360f4ac-7beda6a274bso148205039f.2 for ; Mon, 18 Mar 2024 14:26:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710797163; x=1711401963; 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=4b/BRHybU0ryuFpuokXtaddKF8dnCy1SbMsmF9YDtdU=; b=fnWcsDVBJGgVJb+LDK6nnhFdQTb1I2QBuC+4Zdiyr2XjG4TPcoebrd1P1xeMX+jYqs Eeql0tkclDhM/mLCYG2ZhElDncUy8oU8qQulp8Deo7T8Skhyu3mopfb0gF/RLHEGkWjc iOdcBw1EfMIUFx4vHjPOHcQzLNl7pzpE0L8oJ1L3mb2pA7bejFfiTiE3tXRCWr9pS2UW h0eD0nQ91k+uS4OH3BCa/PgTmbE896ywT8DpvmmT1/t4vIdr7+rt+Jv/E2G8bajqhMZ1 HE7jlsQwIm5NU069VdijHuum5dewWHHOXG0U0vDxDThsbWAtU+Lh82sMghFLu8KpaVqn apvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710797163; x=1711401963; 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=4b/BRHybU0ryuFpuokXtaddKF8dnCy1SbMsmF9YDtdU=; b=MXIZG5rjkypU1rYWqQhL7wO5XctjkYwuzqH503EWG+nlYc3Engkddj5gemkKZTEfkc kpupjSBl8SerdrxYoieqdX79ZaeobJ0wDgZW+53sgfAZTZIAtsMH7NlGkcedmyHqh8wr ATo5BzXybEg/YtMrZCEOuFtnIy57YcQUR7sBkiMxXTWzsrPJsotPj65WLyVJkrRLOZ58 kR/6qEnJItJqQA4us8oc0ReytraujLwqr3RiXHRSCDmTO21y+PURl0Vp0CA/JZuz44Dj CAU0ruOniYN9VdTfKIGe2zoxHCCRLPsB3nd+6TjsQ2n1PPGcR6CqVJY6eV2UJ/gLxouK tRPQ== X-Forwarded-Encrypted: i=1; AJvYcCXg4O+6xOx2cPJHUpVcw3KAz182hw27sxAE8Oap1w1cmt5qDCFAeQ4UT3UoprVyPg7jfuZrzZYz/J6sf/NYvCc374IfSk9DB/Zj/C4GzobpizTp X-Gm-Message-State: AOJu0YwL741bt1tXsDcOXnjsxQ6amSqYqwL4UpwCKdPq1Rc5lwvioNSe 5Y1gJGAedArPWdxa2i8VipxWFW+CHTegzOCot1Q+p5DN0IGP9qjr X-Google-Smtp-Source: AGHT+IFju1ZuXxcD5BWEKlWHAkSM2vM1I7LGHoyhgDKHo5iHPCUODCcC3FniMGZLuH4WvBLF5Uydrg== X-Received: by 2002:a5e:8919:0:b0:7cc:1e9:5539 with SMTP id k25-20020a5e8919000000b007cc01e95539mr10592663ioj.13.1710797162209; Mon, 18 Mar 2024 14:26:02 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id el10-20020a0566384d8a00b004778e715be3sm1901181jab.35.2024.03.18.14.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 14:26:01 -0700 (PDT) Date: Mon, 18 Mar 2024 16:26:00 -0500 From: Nathan Bossart To: "Amonson, Paul D" Cc: David Rowley , Andres Freund , Alvaro Herrera , "Shankaran, Akash" , Noah Misch , Tom Lane , Matthias van de Meent , "pgsql-hackers@lists.postgresql.org" Subject: Re: Popcount optimization using AVX512 Message-ID: <20240318212600.GA655785@nathanxps13> References: <20240315150611.GA3495582@nathanxps13> <20240318152902.GA2850@nathanxps13> <20240318162018.GA204772@nathanxps13> <20240318173004.GA361138@nathanxps13> <20240318210810.GA582529@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 18, 2024 at 09:22:43PM +0000, Amonson, Paul D wrote: >> The only reason I left it out was because I couldn't convince myself that it >> wasn't dead code, given we assume that popcntq is available in >> pg_popcount64_fast() today. But I don't see any harm in adding that just in >> case. > > I am not sure how to read this. Does this mean that for popcount32_fast > and popcount64_fast I can assume that the x86(_64) instructions exists > and stop doing the runtime checks for instruction availability? I think my question boils down to "if pg_popcount_available() returns true, can I safely assume I'm on a 64-bit machine?" -- Nathan Bossart Amazon Web Services: https://aws.amazon.com