]> granicus.if.org Git - zfs/blob - config/toolchain-simd.m4
Add back iostat -y or -w descriptions
[zfs] / config / toolchain-simd.m4
1 dnl #
2 dnl # Checks if host toolchain supports SIMD instructions
3 dnl #
4 AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_TOOLCHAIN_SIMD], [
5         case "$host_cpu" in
6                 x86_64 | x86 | i686)
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                         ;;
25         esac
26 ])
27
28 dnl #
29 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE
30 dnl #
31 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE], [
32         AC_MSG_CHECKING([whether host toolchain supports SSE])
33
34         AC_LINK_IFELSE([AC_LANG_SOURCE([[
35                 void main()
36                 {
37                         __asm__ __volatile__("xorps %xmm0, %xmm1");
38                 }
39         ]])], [
40                 AC_DEFINE([HAVE_SSE], 1, [Define if host toolchain supports SSE])
41                 AC_MSG_RESULT([yes])
42         ], [
43                 AC_MSG_RESULT([no])
44         ])
45 ])
46
47 dnl #
48 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE2
49 dnl #
50 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE2], [
51         AC_MSG_CHECKING([whether host toolchain supports SSE2])
52
53         AC_LINK_IFELSE([AC_LANG_SOURCE([[
54                 void main()
55                 {
56                         __asm__ __volatile__("pxor %xmm0, %xmm1");
57                 }
58         ]])], [
59                 AC_DEFINE([HAVE_SSE2], 1, [Define if host toolchain supports SSE2])
60                 AC_MSG_RESULT([yes])
61         ], [
62                 AC_MSG_RESULT([no])
63         ])
64 ])
65
66 dnl #
67 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE3
68 dnl #
69 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE3], [
70         AC_MSG_CHECKING([whether host toolchain supports SSE3])
71
72         AC_LINK_IFELSE([AC_LANG_SOURCE([[
73                 void main()
74                 {
75                         char v[16];
76                         __asm__ __volatile__("lddqu %0,%%xmm0" :: "m"(v[0]));
77                 }
78         ]])], [
79                 AC_DEFINE([HAVE_SSE3], 1, [Define if host toolchain supports SSE3])
80                 AC_MSG_RESULT([yes])
81         ], [
82                 AC_MSG_RESULT([no])
83         ])
84 ])
85
86 dnl #
87 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSSE3
88 dnl #
89 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSSE3], [
90         AC_MSG_CHECKING([whether host toolchain supports SSSE3])
91
92         AC_LINK_IFELSE([AC_LANG_SOURCE([[
93                 void main()
94                 {
95                         __asm__ __volatile__("pshufb %xmm0,%xmm1");
96                 }
97         ]])], [
98                 AC_DEFINE([HAVE_SSSE3], 1, [Define if host toolchain supports SSSE3])
99                 AC_MSG_RESULT([yes])
100         ], [
101                 AC_MSG_RESULT([no])
102         ])
103 ])
104
105 dnl #
106 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_1
107 dnl #
108 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_1], [
109         AC_MSG_CHECKING([whether host toolchain supports SSE4.1])
110
111         AC_LINK_IFELSE([AC_LANG_SOURCE([[
112                 void main()
113                 {
114                         __asm__ __volatile__("pmaxsb %xmm0,%xmm1");
115                 }
116         ]])], [
117                 AC_DEFINE([HAVE_SSE4_1], 1, [Define if host toolchain supports SSE4.1])
118                 AC_MSG_RESULT([yes])
119         ], [
120                 AC_MSG_RESULT([no])
121         ])
122 ])
123
124 dnl #
125 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_2
126 dnl #
127 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_SSE4_2], [
128         AC_MSG_CHECKING([whether host toolchain supports SSE4.2])
129
130         AC_LINK_IFELSE([AC_LANG_SOURCE([[
131                 void main()
132                 {
133                         __asm__ __volatile__("pcmpgtq %xmm0, %xmm1");
134                 }
135         ]])], [
136                 AC_DEFINE([HAVE_SSE4_2], 1, [Define if host toolchain supports SSE4.2])
137                 AC_MSG_RESULT([yes])
138         ], [
139                 AC_MSG_RESULT([no])
140         ])
141 ])
142
143 dnl #
144 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX
145 dnl #
146 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX], [
147         AC_MSG_CHECKING([whether host toolchain supports AVX])
148
149         AC_LINK_IFELSE([AC_LANG_SOURCE([[
150                 void main()
151                 {
152                         char v[32];
153                         __asm__ __volatile__("vmovdqa %0,%%ymm0" :: "m"(v[0]));
154                 }
155         ]])], [
156                 AC_MSG_RESULT([yes])
157                 AC_DEFINE([HAVE_AVX], 1, [Define if host toolchain supports AVX])
158         ], [
159                 AC_MSG_RESULT([no])
160         ])
161 ])
162
163 dnl #
164 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX2
165 dnl #
166 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX2], [
167         AC_MSG_CHECKING([whether host toolchain supports AVX2])
168
169         AC_LINK_IFELSE([AC_LANG_SOURCE([
170         [
171                 void main()
172                 {
173                         __asm__ __volatile__("vpshufb %ymm0,%ymm1,%ymm2");
174                 }
175         ]])], [
176                 AC_MSG_RESULT([yes])
177                 AC_DEFINE([HAVE_AVX2], 1, [Define if host toolchain supports AVX2])
178         ], [
179                 AC_MSG_RESULT([no])
180         ])
181 ])
182
183 dnl #
184 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512F
185 dnl #
186 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512F], [
187         AC_MSG_CHECKING([whether host toolchain supports AVX512F])
188
189         AC_LINK_IFELSE([AC_LANG_SOURCE([
190         [
191                 void main()
192                 {
193                         __asm__ __volatile__("vpandd %zmm0,%zmm1,%zmm2");
194                 }
195         ]])], [
196                 AC_MSG_RESULT([yes])
197                 AC_DEFINE([HAVE_AVX512F], 1, [Define if host toolchain supports AVX512F])
198         ], [
199                 AC_MSG_RESULT([no])
200         ])
201 ])
202
203 dnl #
204 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512CD
205 dnl #
206 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512CD], [
207         AC_MSG_CHECKING([whether host toolchain supports AVX512CD])
208
209         AC_LINK_IFELSE([AC_LANG_SOURCE([
210         [
211                 void main()
212                 {
213                         __asm__ __volatile__("vplzcntd %zmm0,%zmm1");
214                 }
215         ]])], [
216                 AC_MSG_RESULT([yes])
217                 AC_DEFINE([HAVE_AVX512CD], 1, [Define if host toolchain supports AVX512CD])
218         ], [
219                 AC_MSG_RESULT([no])
220         ])
221 ])
222
223 dnl #
224 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512DQ
225 dnl #
226 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512DQ], [
227         AC_MSG_CHECKING([whether host toolchain supports AVX512DQ])
228
229         AC_LINK_IFELSE([AC_LANG_SOURCE([
230         [
231                 void main()
232                 {
233                         __asm__ __volatile__("vandpd %zmm0,%zmm1,%zmm2");
234                 }
235         ]])], [
236                 AC_MSG_RESULT([yes])
237                 AC_DEFINE([HAVE_AVX512DQ], 1, [Define if host toolchain supports AVX512DQ])
238         ], [
239                 AC_MSG_RESULT([no])
240         ])
241 ])
242
243 dnl #
244 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512BW
245 dnl #
246 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512BW], [
247         AC_MSG_CHECKING([whether host toolchain supports AVX512BW])
248
249         AC_LINK_IFELSE([AC_LANG_SOURCE([
250         [
251                 void main()
252                 {
253                         __asm__ __volatile__("vpshufb %zmm0,%zmm1,%zmm2");
254                 }
255         ]])], [
256                 AC_MSG_RESULT([yes])
257                 AC_DEFINE([HAVE_AVX512BW], 1, [Define if host toolchain supports AVX512BW])
258         ], [
259                 AC_MSG_RESULT([no])
260         ])
261 ])
262
263 dnl #
264 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512IFMA
265 dnl #
266 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512IFMA], [
267         AC_MSG_CHECKING([whether host toolchain supports AVX512IFMA])
268
269         AC_LINK_IFELSE([AC_LANG_SOURCE([
270         [
271                 void main()
272                 {
273                         __asm__ __volatile__("vpmadd52luq %zmm0,%zmm1,%zmm2");
274                 }
275         ]])], [
276                 AC_MSG_RESULT([yes])
277                 AC_DEFINE([HAVE_AVX512IFMA], 1, [Define if host toolchain supports AVX512IFMA])
278         ], [
279                 AC_MSG_RESULT([no])
280         ])
281 ])
282
283 dnl #
284 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VBMI
285 dnl #
286 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VBMI], [
287         AC_MSG_CHECKING([whether host toolchain supports AVX512VBMI])
288
289         AC_LINK_IFELSE([AC_LANG_SOURCE([
290         [
291                 void main()
292                 {
293                         __asm__ __volatile__("vpermb %zmm0,%zmm1,%zmm2");
294                 }
295         ]])], [
296                 AC_MSG_RESULT([yes])
297                 AC_DEFINE([HAVE_AVX512VBMI], 1, [Define if host toolchain supports AVX512VBMI])
298         ], [
299                 AC_MSG_RESULT([no])
300         ])
301 ])
302
303 dnl #
304 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512PF
305 dnl #
306 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512PF], [
307         AC_MSG_CHECKING([whether host toolchain supports AVX512PF])
308
309         AC_LINK_IFELSE([AC_LANG_SOURCE([
310         [
311                 void main()
312                 {
313                         __asm__ __volatile__("vgatherpf0dps (%rsi,%zmm0,4){%k1}");
314                 }
315         ]])], [
316                 AC_MSG_RESULT([yes])
317                 AC_DEFINE([HAVE_AVX512PF], 1, [Define if host toolchain supports AVX512PF])
318         ], [
319                 AC_MSG_RESULT([no])
320         ])
321 ])
322
323 dnl #
324 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512ER
325 dnl #
326 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512ER], [
327         AC_MSG_CHECKING([whether host toolchain supports AVX512ER])
328
329         AC_LINK_IFELSE([AC_LANG_SOURCE([
330         [
331                 void main()
332                 {
333                         __asm__ __volatile__("vexp2pd %zmm0,%zmm1");
334                 }
335         ]])], [
336                 AC_MSG_RESULT([yes])
337                 AC_DEFINE([HAVE_AVX512ER], 1, [Define if host toolchain supports AVX512ER])
338         ], [
339                 AC_MSG_RESULT([no])
340         ])
341 ])
342
343 dnl #
344 dnl # ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VL
345 dnl #
346 AC_DEFUN([ZFS_AC_CONFIG_TOOLCHAIN_CAN_BUILD_AVX512VL], [
347         AC_MSG_CHECKING([whether host toolchain supports AVX512VL])
348
349         AC_LINK_IFELSE([AC_LANG_SOURCE([
350         [
351                 void main()
352                 {
353                         __asm__ __volatile__("vpabsq %zmm0,%zmm1");
354                 }
355         ]])], [
356                 AC_MSG_RESULT([yes])
357                 AC_DEFINE([HAVE_AVX512VL], 1, [Define if host toolchain supports AVX512VL])
358         ], [
359                 AC_MSG_RESULT([no])
360         ])
361 ])