Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oS458-0007HD-QP for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Aug 2022 22:15:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oS457-0004Xo-MG for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Aug 2022 22:15:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oS457-0004Xf-C5 for pgsql-hackers@lists.postgresql.org; Sat, 27 Aug 2022 22:15:09 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oS454-00069m-0n for pgsql-hackers@postgresql.org; Sat, 27 Aug 2022 22:15:08 +0000 Received: by mail-pf1-x431.google.com with SMTP id y127so4851865pfy.5 for ; Sat, 27 Aug 2022 15:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=xro9jJ6w/Q9PPLe4feF6deG07zgrARgrLcoNN8i4zgw=; b=qASiSQ/qwd07vBIWP7K2BclbGGp2Du56u2NR5lYwVEDeSry2LVz/HsAaDWkZzbmWWk 3usaAqzopbwzBY4Yi/i1mr/wY0Ts0zXsraCDhZ3hospwcl+cwWAmn8H7rbNEB/xvnHyl u8A+55Pxy0wvmtb90PX36e0KEdVC22KWiQMMcyK08aJkPRUQbUmSof0iLcz8ATFPxyDT MuhaYbYJuPr1JE8hyD5ZC9ZbJJGbwLjgJ0dkDCEy5o/DGsi/5CJ7XQ+0I5HgRPhCD6BV RErNd85WcTGryBoUrc+zuY20j0KwZS4q4fg6G89Q23hQbqNshTS0BFHYSZSBR1kZNyGJ UJbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=xro9jJ6w/Q9PPLe4feF6deG07zgrARgrLcoNN8i4zgw=; b=djuxeYZtG3FetqcgP6vs7PDyzNhig41jdqnz2x7MG5sbPnMMv4WgCJAQvQFhJo2z77 59YUq3w9iDLUdbUZmGQ71DkKYnb+4SSGic2MEVnTbljmWaWm2rlj5AM84iZi7iN5YjhR A0JM3/YE0ZVzXxmk8khj4Yh980flZYi6Zspou9tkUbL91jEP117iqAtl9leJQUo2ymzv +OYyarq03sXtY8bDsVql7PbshlyaOxkA3LRs4MQC/yH8O6+pEngx85AhHjhF1SoBWZuD ZEKKe8aLV/JDOMxBbzSdRpdosGHn0BQy2NTTIy964cR1U1SqOCCt3+skoC1RXHY4v7Bg RQPA== X-Gm-Message-State: ACgBeo2g6WOW8lRoZ4JwSwucRhdMj9/1U6xCIsy8b6InnYYyvIZPb0zR dyXzwf7RLKZpy2+kZYj6uaFPEyd00w0= X-Google-Smtp-Source: AA6agR4vt64A7NvNEo55gYQpltkphO/TTt0EJJ3mlEvj9DmsmglHb4UXvJ73JZvmBGCivFrQSRpoTA== X-Received: by 2002:a05:6a00:e1b:b0:537:7c74:c405 with SMTP id bq27-20020a056a000e1b00b005377c74c405mr9970275pfb.43.1661638505035; Sat, 27 Aug 2022 15:15:05 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id l17-20020a170903121100b00172b5adb78asm4199748plh.147.2022.08.27.15.15.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Aug 2022 15:15:04 -0700 (PDT) Date: Sat, 27 Aug 2022 15:15:02 -0700 From: Nathan Bossart To: Tom Lane Cc: John Naylor , Andres Freund , pgsql-hackers Subject: Re: use ARM intrinsics in pg_lfind32() where available Message-ID: <20220827221502.GB15951@nathanxps13> References: <20220824180111.GB1302810@nathanxps13> <20220825045729.GA1458024@nathanxps13> <20220826045115.GA1638993@nathanxps13> <20220826061347.GA1777731@nathanxps13> <20220826182403.GA1917683@nathanxps13> <2494641.1661635114@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2494641.1661635114@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, Aug 27, 2022 at 05:18:34PM -0400, Tom Lane wrote: > In short, I think the critical part of 0002 needs to look more like > this: > > +#elif defined(__aarch64__) && defined(__ARM_NEON) > +/* > + * We use the Neon instructions if the compiler provides access to them > + * (as indicated by __ARM_NEON) and we are on aarch64. While Neon support is > + * technically optional for aarch64, it appears that all available 64-bit > + * hardware does have it. Neon exists in some 32-bit hardware too, but > + * we could not realistically use it there without a run-time check, > + * which seems not worth the trouble for now. > + */ > +#include > +#define USE_NEON > ... Thank you for the analysis! I'll do it this way in the next patch set. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com