postgresql/config
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
..
ax_pthread.m4 Update config/ax_pthread.m4 to latest upstream version. 2018-11-19 15:05:33 -05:00
c-compiler.m4 Use __attribute__((target(...))) for AVX-512 support. 2024-11-07 13:58:43 -06:00
c-library.m4 Simplify checking for xlocale.h 2024-10-01 07:23:45 -04:00
check_decls.m4 Fix configure's AC_CHECK_DECLS tests to work correctly with clang. 2018-11-19 12:01:47 -05:00
check_modules.pl Add copyright notices to a few perl scripts that don't have them 2024-01-05 13:15:50 +00:00
config.guess Update config.guess and config.sub 2024-04-09 14:21:57 +02:00
config.sub Update config.guess and config.sub 2024-04-09 14:21:57 +02:00
general.m4 Rename configure.in to configure.ac 2020-07-24 10:42:08 +02:00
install-sh Fix install-strip on Mac OS X 2012-08-21 23:42:43 -04:00
llvm.m4 jit: Require at least LLVM 14, if enabled. 2024-10-01 04:49:11 -04:00
Makefile Install our "missing" script where PGXS builds can find it. 2015-12-11 16:15:05 -05:00
meson.build meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
missing Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
perl.m4 Remove MSVC scripts 2023-12-20 09:44:37 +09:00
pkg.m4 Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
prep_buildtree Fix vpath build 2019-03-27 23:36:00 +01:00
programs.m4 Remove distprep 2023-11-06 15:18:04 +01:00
python.m4 Unify DLSUFFIX on Darwin 2022-07-06 07:41:33 +02:00
tcl.m4 configure: More use of AC_ARG_VAR 2019-01-18 08:38:34 +01:00