On Wed, Feb 12, 2025 at 09:02:27PM +0000, Devulapalli, Raghuveer wrote:
> Also, do we really need to have both USE_SSE42_CRC32C and USE_SSE42_CRC32C_WITH_RUNTIME_CHECK
> features support? The former macro is used to enable running the SSE42 version without a runtime check
> when someone builds with -msse4.2. The code looks fine now, but the runtime dispatch rules get complicated
> as we add the PCLMUL and AVX512 dispatch in the future. IMO, this additional complexity is not worth it.
> The cpuid runtime dispatch runs just once when postgres server is first setup and would hardly affect performance.
> Let me know what you think.
I think the idea behind USE_SSE42_CRC32C is to avoid the function pointer
overhead if possible. I looked at switching to always using runtime checks
for this stuff, and we concluded that we'd better not [0].
[0] https://postgr.es/m/flat/20231030161706.GA3011%40nathanxps13
--
nathan