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 1pcTuW-0005Hd-4L for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2023 16:23:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcTuU-0002hv-Br for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Mar 2023 16:23:30 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcTuU-0002gn-0G for pgsql-hackers@lists.postgresql.org; Wed, 15 Mar 2023 16:23:30 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pcTuO-0004Ck-Tw for pgsql-hackers@lists.postgresql.org; Wed, 15 Mar 2023 16:23:29 +0000 Received: by mail-pg1-x530.google.com with SMTP id q23so11133865pgt.7 for ; Wed, 15 Mar 2023 09:23:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678897402; 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=iLz9yd8zX/8ADbw4BzHukHEarr0Wf73PYJraLcHDD3w=; b=mvssHVXB5HZMomILJBUGk1+xQzSZy7a5wfstlSVUSM38TGma/A5tSpk7eFE9LbhI5q exinYpDsFL4SvHslPGhGKejtUuNZg20TLmqcIwVN+ncbUYuI5+Klcow/GJZp9NpSHxkS veSHHB+j266/uUh/zq2KtxXoV0AygffDk2gnxgg5KA4ew22RTtS0p0Z9cPVhclD+f2C+ 4fr8HjADZ0piSu8jBBqTvszDkkBMuL2VywYCF18YOu0fA2TfdEG5C9NR1ADnm/d1J3Mu b2E+rvzkxbbrnv2Ks8Vi/McmFAxI0TiauLy3tT6uDIogxdGmA1ZNa5H4phcFE6lmJDVr 1CAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678897402; 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=iLz9yd8zX/8ADbw4BzHukHEarr0Wf73PYJraLcHDD3w=; b=hgzz68mKyVzAY+Ij+Ni8nxwpsDz8PcPIkNHeORKsHkwdgijEGCkbDiT+pVHs71w945 nE3xUp2Z6Wyb1LzB+zfPBH8C0uHUYDqattEC1gkXrh5d4GFlx7JvkZ7hP9q8BjTmMR+8 Zr+Tu8bwsf09A2t1LOngTopVCCzyCtRgDf/i6QoxZmOw36ecBIP1XKlWXzSzOpPgkwXY llKEul807RKsecI4NymevDObDZcfVZs2XeenqfJ5avc0bLjd9enWsiBdvU46w1JjUCGu N4Y5mgVgMUYiiDGAO6SLAQaQnVxUOhBpPeX/bxLQ+tfxIP2xj4mWGOEZraRoQbzLlDw7 y6ZQ== X-Gm-Message-State: AO0yUKVrEqN4kOuJ7w0Fcufl8SjQhL2crdP2DjK9fbROe0FMHZmvNIqc ewg06mkSUp9siMLDqqiD4Iw= X-Google-Smtp-Source: AK7set8zef6W8VISSpe+sGU4rCiiwcZm65stijNbBJDcWApo7tqom8lHgaoajnVxAhoJSM8TvA8yxg== X-Received: by 2002:a62:cf04:0:b0:5a8:a0df:a624 with SMTP id b4-20020a62cf04000000b005a8a0dfa624mr59942pfg.22.1678897402426; Wed, 15 Mar 2023 09:23:22 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id y16-20020a634950000000b004f2c088328bsm3530809pgk.43.2023.03.15.09.23.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 09:23:21 -0700 (PDT) Date: Wed, 15 Mar 2023 09:23:19 -0700 From: Nathan Bossart To: Ankit Kumar Pandey Cc: pgsql-hackers@lists.postgresql.org Subject: Re: optimize several list functions with SIMD intrinsics Message-ID: <20230315162319.GA609684@nathanxps13> References: <20230308002502.GA3378449@nathanxps13> <20230308185809.GA3552675@nathanxps13> <167852767890.628976.10354523915450248589.pgcf@coridan.postgresql.org> <20230313214027.GB423713@nathanxps13> <7fc23473-7f10-5282-711e-34247d089f75@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7fc23473-7f10-5282-711e-34247d089f75@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Mar 15, 2023 at 07:31:46PM +0530, Ankit Kumar Pandey wrote: >> On 14/03/23 03:10, Nathan Bossart wrote: >> On Sat, Mar 11, 2023 at 09:41:18AM +0000, Ankit Kumar Pandey wrote: >> > 1. In list_member_ptr, will it be okay to bring `const ListCell >> > *cell` from #ifdef USE_NO_SIMD >> > const ListCell *cell; >> > #endif >> > to #else like as mentioned below? This will make visual separation between #if cases more cleaner >> I would expect to see -Wdeclaration-after-statement warnings if we did >> this. > > This worked fine for me, no warnings on gcc 12.2.0. Not a concern though. Did you try building without SIMD support? This is what I see: list.c: In function ‘list_member_ptr’: list.c:697:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] 697 | const ListCell *cell; | ^~~~~ If your build doesn't have USE_NO_SIMD defined, this warning won't appear because the code in question will be compiled out. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com