Re: centralize CPU feature detection
Zsolt Parragi <zsolt.parragi@percona.com>
From: Zsolt Parragi <zsolt.parragi@percona.com>
To: John Naylor <johncnaylorls@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
root <tenistarkim@gmail.com>, Nathan Bossart <nathandbossart@gmail.com>
Date: 2026-02-18T18:47:45Z
Lists: pgsql-hackers
> Done. I haven't tried Arm support yet, but now I realize the header > should be named generically, so it's now "pg_cpu.h". Then it can be > included everywhere. That makes sense, and simplifies the usage of the header. (However, the include guard still refers to the old name) > I don't know. The instruction family names are conventionally all in > caps, but this is just our signal that we've populated the array. That > said, a less generic name would better for grep-ability. Yes, that could work too. But reserving the lowercase "init" symbol in a very generic header seems like a bad idea (especially for a use case that isn't used globally), even if Postgres itself doesn't use the symbol for anything else. "INIT" at least would be unlikely to conflict with something else.
Commits
-
Remove extraneous PGDLLIMPORT
- ec5981c3816e 19 (unreleased) landed
-
Refactor detection of x86 ZMM registers
- 51bb4a58ed23 19 (unreleased) landed
-
Centralize detection of x86 CPU features
- 16743db061e4 19 (unreleased) landed
-
Fix USE_SLICING_BY_8_CRC32C builds on x86
- 3322f01a11b7 19 (unreleased) landed
-
Rename pg_crc32c_sse42_choose.c for general purpose
- b9278871f991 19 (unreleased) landed