On Mon, Sep 04, 2017 at 03:08:50PM +0100, Van Haaren, Harry wrote: > > From: dev [mailto:dev-boun...@dpdk.org] On Behalf Of Bruce Richardson > > Sent: Friday, September 1, 2017 11:04 AM > > To: dev@dpdk.org > > Cc: Richardson, Bruce <bruce.richard...@intel.com> > > Subject: [dpdk-dev] [PATCH 04/17] build: add DPDK libraries to build > > > > Add non-EAL libraries to DPDK build. The compat lib is a special case, > > along with the previously-added EAL, but all other libs can be build using > > the same set of commands, where the individual meson.build files only need > > to specify their dependencies, source files, header files and ABI versions. > > > > Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> > > <snip> > > In librte_acl/meson.build: > > > +version = 2 > > +sources = files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c', > > + 'rte_acl.c', 'tb_mem.c') > > +headers = files('rte_acl.h', 'rte_acl_osdep.h') > > + > > +if arch_subdir == 'x86' > > + sources += files('acl_run_sse.c') > > + > > + # 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('acl_run_avx2.c') > > + cflags += '-DCC_AVX2_SUPPORT' > > + elif cc.has_argument('-mavx2') > > + avx2_tmplib = static_library('avx2_tmp', > > + 'acl_run_avx2.c', > > + dependencies: rte_eal, > > + c_args: '-mavx2') > > + objs += avx2_tmplib.extract_objects('acl_run_avx2.c') > > + cflags += '-DCC_AVX2_SUPPORT' > > + endif > > + > > +endif > > In future this could be split out to some sort of AVX helper, to avoid it > becoming copy/paste prone to detect AVX features from libraries. > We can indeed look at that in future, using native meson support I hope, from the SIMD module: http://mesonbuild.com/Simd-module.html
Right now, though, I think this is the only place we need this, so it's not an issue. /Bruce