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 1rLncb-000Vbk-9c for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jan 2024 17:04:37 +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 1rLncZ-001sDX-Mm for pgsql-hackers@arkaria.postgresql.org; Fri, 05 Jan 2024 17:04:35 +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 1rLncZ-001sDP-B4 for pgsql-hackers@lists.postgresql.org; Fri, 05 Jan 2024 17:04:35 +0000 Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rLncU-0002PC-MV for pgsql-hackers@postgresql.org; Fri, 05 Jan 2024 17:04:34 +0000 Received: by mail-io1-xd2a.google.com with SMTP id ca18e2360f4ac-7ba9f1cfe94so20684739f.1 for ; Fri, 05 Jan 2024 09:04:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704474270; x=1705079070; darn=postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=jVXYjmcQpoxnAai3sOe3BAcHS3y3Z9eiGRWaCk8Xhr4=; b=nCKQ8/J2ASffFzcPmM0PKKCRZneMCYMh1oEaK5pJQxVQ0k/KHdNy1S4+ixT7ADzShn ClFHJz6cjk0SQgp+wsHGZrODTwNxsuKqzfJy5MMbb8fhCdLMd4LbPC2akweY0zsV2xmi wZELYGION7r6ZehEFpb93Bwq9VgNBr/SrqPoLuBJ2qGixRu3XC4DpDE1VobO85/ZCJjy jKsbALts9XPGaKluUV70R5GYGDQxEd3U6Go9qf/Y1nA+Ehcx5LdjIjo2oyoQw/Ja9i5s G4KFbR9jtwZjtPHzmhI0awjQkY47NBslXnplXXtArrzJ0fGtdZhIohdAu/ZKclRoyChn zO0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704474270; x=1705079070; h=in-reply-to:content-transfer-encoding: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=jVXYjmcQpoxnAai3sOe3BAcHS3y3Z9eiGRWaCk8Xhr4=; b=kfE4gmO0ARw8dS1r2wB1in35F0lXmbBNsBQ9xGUYsEnzT1vj9Jlc7oDNsOFYFFAec1 /I1UMyE9zsxxgz+ip62akgMBWaI4Zvfm4FSQwdeuU9U0XODuM5CeMIPoVDAcoqxL25Kk uFEPbH0m4HIu77qNoK8P4YwOw2Ng/meS57nCwmE/mYMbKl1WDncU8gDAEGKE8M+I2HrT Zyiu5OXGTg/WYLAK17cQFsTRMSzevzmmLHb51t7HtApGMVzhhehHDd7z3o7Ix++3BOD7 4D3i/J99R6HOc2NgMXgmVKkB4Qw5y9qhQx7pxe2R+qUMz/9KAi4Kf2P/ZWZ3Oa0b//I+ CzKA== X-Gm-Message-State: AOJu0Yx+YbVagVvUM0p+iJO3eDfZ3zFXbtmCF7RSviKW7RXofkmLHlRC EQ8sWcOYkF17AjrLjntEYVcYamfXC0U= X-Google-Smtp-Source: AGHT+IEULQ4g+Tv2SoGz5oVLtidzhTxBMIB2mMglDf1Q15OdnN6oADSlfRVk76ItV6LISn/0mpUpiQ== X-Received: by 2002:a05:6e02:20eb:b0:360:142:3fec with SMTP id q11-20020a056e0220eb00b0036001423fecmr1661708ilv.6.1704474269797; Fri, 05 Jan 2024 09:04:29 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id dh8-20020a056e021f0800b003606ef496c4sm517640ilb.63.2024.01.05.09.04.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 09:04:29 -0800 (PST) Date: Fri, 5 Jan 2024 11:04:27 -0600 From: Nathan Bossart To: John Naylor Cc: Ants Aasma , pgsql-hackers@postgresql.org Subject: Re: add AVX2 support to simd.h Message-ID: <20240105170427.GD2168314@nathanxps13> References: <20231129171526.GA857928@nathanxps13> <20240102161123.GA955987@nathanxps13> <20240103152954.GA1300001@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 05, 2024 at 09:03:39AM +0700, John Naylor wrote: > On Wed, Jan 3, 2024 at 10:29 PM Nathan Bossart wrote: >> If the requirement is that normal builds use AVX2, then I fear we will be >> waiting a long time. IIUC the current proposals (building multiple >> binaries or adding a configuration option that maps to compiler flags) >> would still be opt-in, > > If and when we get one of those, I would consider that a "normal" > build. Since there are no concrete proposals yet, I'm still waiting > for you to justify imposing an immediate maintenance cost for zero > benefit. I've been thinking about the configuration option approach. ISTM that would be the most feasible strategy, at least for v17. A couple things come to mind: * This option would simply map to existing compiler flags. We already have ways to provide those (-Dc_args in meson, CFLAGS in autoconf). Perhaps we'd want to provide our own shorthand for certain platforms (e.g., ARM), but that will still just be shorthand for compiler flags. * Such an option would itself generate some maintenance cost. That could be worth it because it formalizes the Postgres support for those options, but it's still one more thing to track. Another related option could be to simply document that we have support for some newer instructions that can be enabled by setting the aforementioned compiler flags. That's perhaps a little less user-friendly, but it'd avoid the duplication and possibly reduce the maintenance cost. I also wonder if it'd help prevent confusion when CFLAGS and this extra option conflict. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com