postgresql/src
Nathan Bossart f78667bd91 Use __attribute__((target(...))) for AVX-512 support.
Presently, we check for compiler support for the required
intrinsics both with and without extra compiler flags (e.g.,
-mxsave), and then depending on the results of those checks, we
pick which files to compile with which flags.  This is tedious and
complicated, and it results in unsustainable coding patterns such
as separate files for each portion of code may need to be built
with different compiler flags.

This commit introduces support for __attribute__((target(...))) and
uses it for the AVX-512 code.  This simplifies both the
configure-time checks and the build scripts, and it allows us to
place the functions that use the intrinsics in files that we
otherwise do not want to build with special CPU instructions.  We
are careful to avoid using __attribute__((target(...))) on
compilers that do not understand it, but we still perform the
configure-time checks in case the compiler allows using the
intrinsics without it (e.g., MSVC).

A similar change could likely be made for some of the CRC-32C code,
but that is left as a future exercise.

Suggested-by: Andres Freund
Reviewed-by: Raghuveer Devulapalli, Andres Freund
Discussion: https://postgr.es/m/20240731205254.vfpap7uxwmebqeaf%40awork3.anarazel.de
2024-11-07 13:58:43 -06:00
..
backend Clarify a foreign key error message 2024-11-07 11:13:06 +01:00
bin Replicate generated columns when 'publish_generated_columns' is set. 2024-11-07 08:58:49 +05:30
common Remove unused #include's from bin .c files 2024-11-06 11:11:52 +01:00
fe_utils Remove unused #include's from bin .c files 2024-11-06 11:11:52 +01:00
include Use __attribute__((target(...))) for AVX-512 support. 2024-11-07 13:58:43 -06:00
interfaces Fix incorrect struct reference in comment 2024-10-23 16:13:28 +02:00
makefiles Use __attribute__((target(...))) for AVX-512 support. 2024-11-07 13:58:43 -06:00
pl Remove unused #include's from contrib, pl, test .c files 2024-10-28 08:02:17 +01:00
port Use __attribute__((target(...))) for AVX-512 support. 2024-11-07 13:58:43 -06:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test Clarify a foreign key error message 2024-11-07 11:13:06 +01:00
timezone Update time zone data files to tzdata release 2024b. 2024-10-29 11:49:38 -04:00
tools Monkey-patch LLVM code to fix ARM relocation bug. 2024-11-06 23:17:18 +13:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Use __attribute__((target(...))) for AVX-512 support. 2024-11-07 13:58:43 -06:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00