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 1rmPxZ-007j7v-V7 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Mar 2024 03:16:18 +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 1rmPxW-008wyG-3H for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Mar 2024 03:16:14 +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 1rmPxV-008wy8-Q8 for pgsql-hackers@lists.postgresql.org; Tue, 19 Mar 2024 03:16:14 +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 1rmPxO-005ID4-Ng for pgsql-hackers@postgresql.org; Tue, 19 Mar 2024 03:16:13 +0000 Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-3669ab1bd67so15358435ab.1 for ; Mon, 18 Mar 2024 20:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710818164; x=1711422964; darn=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=i2N/iOmdr2C0yeuce4KkqSqvUQ2R/hk2Q6NLAt3m+qI=; b=W+CRXWQWe6Gy0TpgZvOHaCGqXRKnXcOCkGBjawI6PSoLdSRyIAmYGkKH5iRdsTLPEN OHMAr7kkdxEyPNDlqXPzv9oJ2ZT1B6t13Cylv0Ufgk+0wq5GdUvmDHqW8h9BOogLNHq+ W6B3yNcNzSdXaFKL6Jm/xBjIN0390cq/XwjvHS0J82craaR6zyFJUaPCZlYPkU0YNc9V fmmgKSNmNbSa2Knt7B2qI2iXG6FT17SKGlrVJ8DYbhQFpZ+u7xkankftZKrnypYlBiIj sIkaU8H8a/hGZtTBQrgLOBCB7n1TkjX8zXi5y5FTI7Zm9GjwABAlKUxpkSNAOtwdo9fD RA6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710818164; x=1711422964; 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=i2N/iOmdr2C0yeuce4KkqSqvUQ2R/hk2Q6NLAt3m+qI=; b=wiMR16ZS6qCiAWZs1PSjlu/K4nTzgcfBg5edJHwihb4jfCaobeBr6VKVBNU3rTHWBt B2rEvUnngihY/sTTqNmK41CO2yHtJ+GeI1qjyjQbW6O8McoRzy2ipndhAwaev+HfO7He 7Jtth96pBj/QWnhj+81VW3+RdRHefTm1zXpZZ5AmfkUgAbIpuIyVW35/H/muaD0smQmr AFakxbipUBFI6OhKwNvX9Yt8+uW6OnFFLVPGIJq0s32GwrLF4Kghmi72sVYbnqAgj0OP 8+TVCw86S6It1BJ2LV4BbE3p+n07CvOhs5XhUnGiEVL3egY7UrOvL+fJdJvb7QPY+m9N 9qMQ== X-Forwarded-Encrypted: i=1; AJvYcCUHR2w0h45U75PMT7z0U7nshnvUgoeLA+A80lyiGHnfLgPlZBSZvr3dH5rjOy9rAt1+kLgVvUjkCOMtgTIzIs/aAGH2b+2ZFgXqBKQ3 X-Gm-Message-State: AOJu0Yy2Ibo0mklOG/DDk4jZad+o5HFIP42D83Ucbz8UFrimqfbPgOfS CUiKh1n1pYadkd5ChWorXP9aEhsYY2J15cqAcGVaQumqXpTsMUO+ X-Google-Smtp-Source: AGHT+IGOg+KMtYvW5yE1O0R1LtLsKEcNlL/7nZKGWAP2nB3b4s95Fr0zRcSz6WFz95e6M5CLxs2/yA== X-Received: by 2002:a92:d251:0:b0:365:2448:5867 with SMTP id v17-20020a92d251000000b0036524485867mr13116137ilg.18.1710818164441; Mon, 18 Mar 2024 20:16:04 -0700 (PDT) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id g9-20020a92dd89000000b003664ef72ac6sm2656135iln.68.2024.03.18.20.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 20:16:04 -0700 (PDT) Date: Mon, 18 Mar 2024 22:16:01 -0500 From: Nathan Bossart To: John Naylor Cc: Ants Aasma , pgsql-hackers@postgresql.org Subject: Re: add AVX2 support to simd.h Message-ID: <20240319031601.GA828141@nathanxps13> References: <20240108173715.GC2611898@nathanxps13> <20240109162009.GA3033933@nathanxps13> <20240315174149.GA3837823@nathanxps13> <20240315194016.GA3896616@nathanxps13> <20240319020341.GA823987@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 Tue, Mar 19, 2024 at 10:03:36AM +0700, John Naylor wrote: > I took a brief look, and 0001 isn't quite what I had in mind. I can't > quite tell what it's doing with the additional branches and "goto > retry", but I meant something pretty simple: Do you mean 0002? 0001 just adds a 2-register loop for remaining elements once we've exhausted what can be processed with the 4-register loop. > - if short, do one element at a time and return 0002 does this. > - if long, do one block unconditionally, then round the start pointer > up so that "end - start" is an exact multiple of blocks, and loop over > them 0002 does the opposite of this. That is, after we've completed as many blocks as possible, we move the iterator variable back to "end - block_size" and do one final iteration to cover all the remaining elements. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com