[dpdk-dev,5/7] efd: add new avx2 standalone file to build
Checks
Commit Message
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/librte_efd/meson.build | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
@@ -32,3 +32,22 @@
sources = files('rte_efd.c')
headers = files('rte_efd.h')
deps += ['ring', 'hash']
+
+if arch_subdir == 'x86'
+ # compile AVX2 version if either:
+ # a. we have AVX supported in minimum instruction set baseline
+ # b. it's not minimum instruction set, but supported by compiler
+ #
+ # in former case, just add avx2 C file to files list
+ # in latter case, compile c file to static lib, using correct compiler
+ # flags, and then have the .o file from static lib linked into main lib.
+ if dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX2')
+ sources += files('rte_efd_x86.c')
+ elif cc.has_argument('-mavx2')
+ avx2_tmplib = static_library('avx2_efd_tmp',
+ 'rte_efd_x86.c',
+ dependencies: rte_eal,
+ c_args: '-mavx2')
+ objs += avx2_tmplib.extract_objects('rte_efd_x86.c')
+ endif
+endif