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 1qxZBe-001od5-58 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Oct 2023 20:48:38 +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 1qxZBa-00GYf1-Uc for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Oct 2023 20:48:34 +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 1qxZBa-00GYem-Kn for pgsql-hackers@lists.postgresql.org; Mon, 30 Oct 2023 20:48:34 +0000 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qxZBY-0036U6-9t for pgsql-hackers@postgresql.org; Mon, 30 Oct 2023 20:48:33 +0000 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-28039ee1587so1279745a91.2 for ; Mon, 30 Oct 2023 13:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1698698911; x=1699303711; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=DayTYb8EuvMMZwy/Yoe65oJkSvbykmnmiLnWqch6/ns=; b=sExVrfgdLHqxqQ0Q8tnJpWf1l1D/71jqVqfTS4iPRHiZv/FDB0ps4qWXiORqx+fmJ3 BTiESJVdFRIZfvCTg7p2z+/iS3RfvIXX3EXzVHtoYmmLmNCzT9nt7usQxEn/Ax/RIdv4 ciB6QOPXFnkY19NM9PKODkVJmUog0JphPfjxb9nnJn4Fu17+fMq2n1FJ0RbuQkvaF7+r ASubIURkP9kHlsHWxjngD3UwZ3SmF/pEshikfeQiao9jGmAR6h36DA53EkRKrvW5EHoK nWzUg/pwi9UWXsGuiY9SeCam+2y7Mr95C3f0WdIAKW+ymC9pCYLpy++kiCdEGvH5MUA6 ossg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698698911; x=1699303711; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=DayTYb8EuvMMZwy/Yoe65oJkSvbykmnmiLnWqch6/ns=; b=w1I7BXbDPcZR/ScI/NNS9QHhrd68i6jXq5DVesY3z13uo0THIPC5U2wvvlqvCm7MlI QKWcPYZbo1I8VnrACzYW29O41/o/Yiz3C8TRfwwQdnlyKhd567v3oNAAFxRcx7Ca+G7o cvcOBwvD9Yj19Bs023IIHScEtPGKI/s3pq2wKja7r5LQozcj1UewfJS/4VXS1n3RXYJb FFqAgIvGCTypZ8M3Y3sqUNuQGwLcwA6MQ2lodOhe6rWq0BDMwoXEwpC7n9gw16V/RTMv 9YaeK0p6I6PDIKoy//eIxWZnVOlJFtbx5G04k3on51x+MblkbfLA0+yNUMcvNfGTH9Be 3OfQ== X-Gm-Message-State: AOJu0Ywz6TJUxL2YZOvXmySzGQl/CXACTy7UMwqokPJ+nOkFe7eMSxjy hnI8mAs+aJwKX078EJteGAyQuA== X-Google-Smtp-Source: AGHT+IHlGI3SscJYILGk6lrdP+L5MjPCzK8tT0QpABS5UyUi5Aqm2Yqe+eTxnYi+lR4EZ36CSFVuiw== X-Received: by 2002:a17:90a:1a44:b0:280:24a:9141 with SMTP id 4-20020a17090a1a4400b00280024a9141mr8381152pjl.28.1698698911328; Mon, 30 Oct 2023 13:48:31 -0700 (PDT) Received: from [172.24.1.133] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id 15-20020a17090a1a0f00b00280976d4ce3sm60513pjk.37.2023.10.30.13.48.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 13:48:30 -0700 (PDT) Message-ID: Subject: Re: always use runtime checks for CRC-32C instructions From: Jeff Davis To: Tom Lane , Nathan Bossart Cc: pgsql-hackers@postgresql.org, Xiang.Gao@arm.com Date: Mon, 30 Oct 2023 13:48:29 -0700 In-Reply-To: <2427946.1698683963@sss.pgh.pa.us> References: <20231030161706.GA3011@nathanxps13> <2427946.1698683963@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-10-30 at 12:39 -0400, Tom Lane wrote: > It seems like a shame > to be burdening these instructions with a subroutine call for the > benefit of long-obsolete hardware versions. It's already doing a call to pg_comp_crc32c_sse42() regardless, right? I assume you are concerned about the call going through a function pointer? If so, is it possible that setting a flag and then branching would be better? Also, if it's a concern, should we also consider making an inlineable version of pg_comp_crc32c_sse42()? Regards, Jeff Davis