Add simd_config.h and HAVE_SIMD() selector

We need to select which SIMD variable to check based on the compilation
target: HAVE_KERNEL_xxx for the Linux kernel, HAVE_TOOLCHAIN_xxx for
other platforms.

This adds a HAVE_SIMD() macro returns the right result depending on the
definedness or value of the variable for this target.

The macro is in simd_config.h, which is forcibly included in every
compiler call (like zfs_config.h), to ensure that it can be used
directly without further includes.

Sponsored-by: TrueNAS
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@truenas.com>
Closes #18285
This commit is contained in:
Rob Norris
2026-03-05 10:23:30 +11:00
committed by Brian Behlendorf
parent 35f74f84e6
commit c329530e6b
5 changed files with 111 additions and 2 deletions
+1
View File
@@ -7,6 +7,7 @@
PHONY =
AM_CPPFLAGS = \
-include $(top_builddir)/zfs_config.h \
-include $(top_srcdir)/include/sys/simd_config.h \
-I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libspl/include \