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 1tiL58-00Eifd-Bd for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Feb 2025 22:19:46 +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 1tiL56-00FfSL-0t for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Feb 2025 22:19:44 +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 1tiL55-00FfRq-N9 for pgsql-hackers@lists.postgresql.org; Wed, 12 Feb 2025 22:19:44 +0000 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tiL54-000VNl-0o for pgsql-hackers@lists.postgresql.org; Wed, 12 Feb 2025 22:19:44 +0000 Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-3d14dec3236so554505ab.0 for ; Wed, 12 Feb 2025 14:19:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739398780; x=1740003580; 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=2nVzoWG9BTnanFLNFxJxzh35LGvgYX0XLOb2kICERuA=; b=nWQCgOiCXO5HskzC2wg6aXtZJi2zsGGCXdQqHxQGTN+uFUTb4/9avWpGiOwlYoRukw /+bLztcgQQLcTAIQBRsmmChngroeAK0EMZqvQppJoB4vEDvWWCzi0uWnMVy1rVBC0OYT J2WZcmMdfKb9Vfafo1XoDY1KL2MohjDPJnXGy6n+QFSg/t8SxP1gCDSPmZRH6rRJC0Yz SCZXk00lfOJMn+YiJ2GhvdTha3j5CVIcaZ7kKQ1B98QfP7FwU71BggUuVJLJ/eqQgJis 4+p6Jq4yTbldD80vWgfiFq9SAuZ6i+cl/l194U29R00ta6Epcfx6e8TDWZpX3tz8rmuv 7CLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739398780; x=1740003580; 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=2nVzoWG9BTnanFLNFxJxzh35LGvgYX0XLOb2kICERuA=; b=T6ueaNsFXZr4Skt5rgnPipmWi1TxR5osutMJiVaJJuz8JS3lqHcRwAvUtz88hYBsKH /6+kFylOgJyz3Y8VYKadoebusrktSAV+7813QyMlevy4h0RTXGlXfTLe6M9Vw1yXZDKM eZFTO+iBjvxX/tDDcVxd8SXDr7ZxCOv7cCp8SYR6vDLH+D0E5XuA0txojtPk2ouc2H2P 2K9jr3A5EZDdLh2W4yaP5aH2Zu+mkdF/0uoZylVKYOjEQ/U2FCZkqc0Y0Z2DUmPRxNRY W7Vt3PKmyTBuPrkVMWBEg0YzbmzoQCOWhxf+VCK/l/5B4AMT6lPB1ueoUshSnCkiYvvw 23Ag== X-Forwarded-Encrypted: i=1; AJvYcCXtXEuhs2fK8xCFl1fwbtqysKRtbFXp2LfPMRPfbI2kU9HX7bKA6mmMYJX28Xwy1jl4xmsJBXA238n6gUw0@lists.postgresql.org X-Gm-Message-State: AOJu0YyRTUdLc0kPE7gC4nb7uCcJA1Y5QjOinrxzT0tuALF/W4C4xyaT eFOnjaBcKk+kcZlKeI9qHYM24rAX0pW8Zj9U72t4LdWCG/8HriKr X-Gm-Gg: ASbGncsqCYSdf/f2KmP44pbEbd56iW8XUpOfS8S6wc/rODw92RbfmuJ1WyJ+yZ13i1y 2BZbcyoZXTPtCCtjjBWd0NA8V+tpXNG8pg4clF029TGIv31j76P+pyuE3yXeTuiOGOmBsv5rdtb 5Vbo1QmYpypqOXTsvXypmr/HGPhdA6Z2+BX4NpbaoSgQ56GbnSB0IHKpIwZj8WcJHt4jbSg8U6D hzyH8K+lUl28gEsBEUDlwgH/XZmTh0PpenqH7VUnqGD4WgOHzT5nqPfE3PFz31yNQeU/bs8c3re AerDajqfagbmON4RCceStIiXCIOgoyAbdUJqEuLLCqs+rC2s++4VL+3gx/OUtI+Q9Adfh8DQbZk kxhFRzw== X-Google-Smtp-Source: AGHT+IEWvPD9e89umHZMMM3sQJ4AxrDlRCHNxsyOz6J+8kvE4uNKCKr/ta1hg+4T0Tr4/7X4KPFR2w== X-Received: by 2002:a05:6e02:2148:b0:3d0:4700:db0b with SMTP id e9e14a558f8ab-3d17bdfe309mr47341435ab.2.1739398780301; Wed, 12 Feb 2025 14:19:40 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-4ed28314c3fsm9141173.139.2025.02.12.14.19.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 14:19:39 -0800 (PST) Date: Wed, 12 Feb 2025 16:19:37 -0600 From: Nathan Bossart To: "Devulapalli, Raghuveer" Cc: John Naylor , "pgsql-hackers@lists.postgresql.org" , "Shankaran, Akash" Subject: Re: Improve CRC32C performance on SSE4.2 Message-ID: References: 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 Wed, Feb 12, 2025 at 10:12:20PM +0000, Devulapalli, Raghuveer wrote: >> Well, I suspect the AVX-512 version will pretty much always need the runtime >> check given that its not available on a lot of newer hardware and requires a >> bunch of extra runtime checks (see pg_popcount_avx512.c). But it might be >> worth doing for PCLMUL. Otherwise, I think we'd have to leave out the PCLMUL >> optimizations if built with -msse4.2 -mpclmul because we don't want to regress >> existing -msse4.2 users with a runtime check. > > Sounds good to me. Although, users building with just -msse4.2 will now encounter an > an additional pclmul runtime check. That would be a regression unless they update to > building with both -msse4.2 and -mpclmul. My thinking was that building with just -msse4.2 would cause the existing SSE 4.2 implementation to be used (without the function pointer). That's admittedly a bit goofy because they'd miss out on the PCLMUL optimization, but things at least don't get any worse for them. -- nathan