dcd028530cfa90958303766dd14d0c3197e86762
[dpdk.git] / drivers / net / iavf / meson.build
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2018 Luca Boccassi <bluca@debian.org>
3
4 cflags += ['-Wno-strict-aliasing']
5
6 includes += include_directories('../../common/iavf')
7 deps += ['common_iavf']
8
9 sources = files(
10         'iavf_ethdev.c',
11         'iavf_rxtx.c',
12         'iavf_vchnl.c',
13         'iavf_generic_flow.c',
14         'iavf_fdir.c',
15         'iavf_hash.c',
16 )
17
18 if arch_subdir == 'x86'
19         sources += files('iavf_rxtx_vec_sse.c')
20
21         # compile AVX2 version if either:
22         # a. we have AVX supported in minimum instruction set baseline
23         # b. it's not minimum instruction set, but supported by compiler
24         if cc.get_define('__AVX2__', args: machine_args) != ''
25                 cflags += ['-DCC_AVX2_SUPPORT']
26                 sources += files('iavf_rxtx_vec_avx2.c')
27         elif cc.has_argument('-mavx2')
28                 cflags += ['-DCC_AVX2_SUPPORT']
29                 iavf_avx2_lib = static_library('iavf_avx2_lib',
30                                 'iavf_rxtx_vec_avx2.c',
31                                 dependencies: [static_rte_ethdev,
32                                         static_rte_kvargs, static_rte_hash],
33                                 include_directories: includes,
34                                 c_args: [cflags, '-mavx2'])
35                 objs += iavf_avx2_lib.extract_objects('iavf_rxtx_vec_avx2.c')
36         endif
37
38         iavf_avx512_cpu_support = (
39                 cc.get_define('__AVX512F__', args: machine_args) != '' and
40                 cc.get_define('__AVX512BW__', args: machine_args) != '')
41
42         iavf_avx512_cc_support = (
43                 not machine_args.contains('-mno-avx512f') and
44                 cc.has_argument('-mavx512f') and
45                 cc.has_argument('-mavx512bw'))
46
47         if iavf_avx512_cpu_support == true or iavf_avx512_cc_support == true
48                 cflags += ['-DCC_AVX512_SUPPORT']
49                 avx512_args = [cflags, '-mavx512f', '-mavx512bw']
50                 if cc.has_argument('-march=skylake-avx512')
51                         avx512_args += '-march=skylake-avx512'
52                 endif
53                 iavf_avx512_lib = static_library('iavf_avx512_lib',
54                                 'iavf_rxtx_vec_avx512.c',
55                                 dependencies: [static_rte_ethdev,
56                                         static_rte_kvargs, static_rte_hash],
57                                 include_directories: includes,
58                                 c_args: avx512_args)
59                 objs += iavf_avx512_lib.extract_objects('iavf_rxtx_vec_avx512.c')
60         endif
61 endif