2 dnl # Checks if host toolchain supports SIMD instructions
4 AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD], [
7 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE
8 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE2
9 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE3
10 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSSE3
11 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_1
12 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_2
13 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX
14 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX2
15 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512F
16 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512CD
17 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512DQ
18 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512BW
19 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512IFMA
20 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VBMI
21 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512PF
22 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512ER
23 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VL
24 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AES
25 ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_PCLMULQDQ
31 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE
33 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE], [
34 AC_MSG_CHECKING([whether host toolchain supports SSE])
36 AC_LINK_IFELSE([AC_LANG_SOURCE([[
39 __asm__ __volatile__("xorps %xmm0, %xmm1");
42 AC_DEFINE([HAVE_SSE], 1, [Define if host toolchain supports SSE])
50 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE2
52 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE2], [
53 AC_MSG_CHECKING([whether host toolchain supports SSE2])
55 AC_LINK_IFELSE([AC_LANG_SOURCE([[
58 __asm__ __volatile__("pxor %xmm0, %xmm1");
61 AC_DEFINE([HAVE_SSE2], 1, [Define if host toolchain supports SSE2])
69 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE3
71 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE3], [
72 AC_MSG_CHECKING([whether host toolchain supports SSE3])
74 AC_LINK_IFELSE([AC_LANG_SOURCE([[
78 __asm__ __volatile__("lddqu %0,%%xmm0" :: "m"(v[0]));
81 AC_DEFINE([HAVE_SSE3], 1, [Define if host toolchain supports SSE3])
89 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSSE3
91 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSSE3], [
92 AC_MSG_CHECKING([whether host toolchain supports SSSE3])
94 AC_LINK_IFELSE([AC_LANG_SOURCE([[
97 __asm__ __volatile__("pshufb %xmm0,%xmm1");
100 AC_DEFINE([HAVE_SSSE3], 1, [Define if host toolchain supports SSSE3])
108 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_1
110 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_1], [
111 AC_MSG_CHECKING([whether host toolchain supports SSE4.1])
113 AC_LINK_IFELSE([AC_LANG_SOURCE([[
116 __asm__ __volatile__("pmaxsb %xmm0,%xmm1");
119 AC_DEFINE([HAVE_SSE4_1], 1, [Define if host toolchain supports SSE4.1])
127 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_2
129 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_2], [
130 AC_MSG_CHECKING([whether host toolchain supports SSE4.2])
132 AC_LINK_IFELSE([AC_LANG_SOURCE([[
135 __asm__ __volatile__("pcmpgtq %xmm0, %xmm1");
138 AC_DEFINE([HAVE_SSE4_2], 1, [Define if host toolchain supports SSE4.2])
146 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX
148 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX], [
149 AC_MSG_CHECKING([whether host toolchain supports AVX])
151 AC_LINK_IFELSE([AC_LANG_SOURCE([[
155 __asm__ __volatile__("vmovdqa %0,%%ymm0" :: "m"(v[0]));
159 AC_DEFINE([HAVE_AVX], 1, [Define if host toolchain supports AVX])
166 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX2
168 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX2], [
169 AC_MSG_CHECKING([whether host toolchain supports AVX2])
171 AC_LINK_IFELSE([AC_LANG_SOURCE([
175 __asm__ __volatile__("vpshufb %ymm0,%ymm1,%ymm2");
179 AC_DEFINE([HAVE_AVX2], 1, [Define if host toolchain supports AVX2])
186 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512F
188 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512F], [
189 AC_MSG_CHECKING([whether host toolchain supports AVX512F])
191 AC_LINK_IFELSE([AC_LANG_SOURCE([
195 __asm__ __volatile__("vpandd %zmm0,%zmm1,%zmm2");
199 AC_DEFINE([HAVE_AVX512F], 1, [Define if host toolchain supports AVX512F])
206 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512CD
208 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512CD], [
209 AC_MSG_CHECKING([whether host toolchain supports AVX512CD])
211 AC_LINK_IFELSE([AC_LANG_SOURCE([
215 __asm__ __volatile__("vplzcntd %zmm0,%zmm1");
219 AC_DEFINE([HAVE_AVX512CD], 1, [Define if host toolchain supports AVX512CD])
226 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512DQ
228 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512DQ], [
229 AC_MSG_CHECKING([whether host toolchain supports AVX512DQ])
231 AC_LINK_IFELSE([AC_LANG_SOURCE([
235 __asm__ __volatile__("vandpd %zmm0,%zmm1,%zmm2");
239 AC_DEFINE([HAVE_AVX512DQ], 1, [Define if host toolchain supports AVX512DQ])
246 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512BW
248 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512BW], [
249 AC_MSG_CHECKING([whether host toolchain supports AVX512BW])
251 AC_LINK_IFELSE([AC_LANG_SOURCE([
255 __asm__ __volatile__("vpshufb %zmm0,%zmm1,%zmm2");
259 AC_DEFINE([HAVE_AVX512BW], 1, [Define if host toolchain supports AVX512BW])
266 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512IFMA
268 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512IFMA], [
269 AC_MSG_CHECKING([whether host toolchain supports AVX512IFMA])
271 AC_LINK_IFELSE([AC_LANG_SOURCE([
275 __asm__ __volatile__("vpmadd52luq %zmm0,%zmm1,%zmm2");
279 AC_DEFINE([HAVE_AVX512IFMA], 1, [Define if host toolchain supports AVX512IFMA])
286 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VBMI
288 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VBMI], [
289 AC_MSG_CHECKING([whether host toolchain supports AVX512VBMI])
291 AC_LINK_IFELSE([AC_LANG_SOURCE([
295 __asm__ __volatile__("vpermb %zmm0,%zmm1,%zmm2");
299 AC_DEFINE([HAVE_AVX512VBMI], 1, [Define if host toolchain supports AVX512VBMI])
306 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512PF
308 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512PF], [
309 AC_MSG_CHECKING([whether host toolchain supports AVX512PF])
311 AC_LINK_IFELSE([AC_LANG_SOURCE([
315 __asm__ __volatile__("vgatherpf0dps (%rsi,%zmm0,4){%k1}");
319 AC_DEFINE([HAVE_AVX512PF], 1, [Define if host toolchain supports AVX512PF])
326 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512ER
328 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512ER], [
329 AC_MSG_CHECKING([whether host toolchain supports AVX512ER])
331 AC_LINK_IFELSE([AC_LANG_SOURCE([
335 __asm__ __volatile__("vexp2pd %zmm0,%zmm1");
339 AC_DEFINE([HAVE_AVX512ER], 1, [Define if host toolchain supports AVX512ER])
346 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VL
348 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VL], [
349 AC_MSG_CHECKING([whether host toolchain supports AVX512VL])
351 AC_LINK_IFELSE([AC_LANG_SOURCE([
355 __asm__ __volatile__("vpabsq %zmm0,%zmm1");
359 AC_DEFINE([HAVE_AVX512VL], 1, [Define if host toolchain supports AVX512VL])
366 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AES
368 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AES], [
369 AC_MSG_CHECKING([whether host toolchain supports AES])
371 AC_LINK_IFELSE([AC_LANG_SOURCE([
375 __asm__ __volatile__("aesenc %xmm0, %xmm1");
379 AC_DEFINE([HAVE_AES], 1, [Define if host toolchain supports AES])
386 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_PCLMULQDQ
388 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_PCLMULQDQ], [
389 AC_MSG_CHECKING([whether host toolchain supports PCLMULQDQ])
391 AC_LINK_IFELSE([AC_LANG_SOURCE([
395 __asm__ __volatile__("pclmulqdq %0, %%xmm0, %%xmm1" :: "i"(0));
399 AC_DEFINE([HAVE_PCLMULQDQ], 1, [Define if host toolchain supports PCLMULQDQ])