1# SPDX-License-Identifier: BSD-3-Clause 2# Copyright(c) 2017 Intel Corporation 3 4if is_windows 5 build = false 6 reason = 'not supported on Windows' 7 subdir_done() 8endif 9 10headers = files('rte_member.h') 11 12sources = files( 13 'rte_member.c', 14 'rte_member_ht.c', 15 'rte_member_sketch.c', 16 'rte_member_vbf.c', 17) 18 19deps += ['hash', 'ring'] 20 21# compile AVX512 version if: 22if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok 23 # compile AVX512 version if either: 24 # a. we have AVX512 supported in minimum instruction set 25 # baseline 26 # b. it's not minimum instruction set, but supported by 27 # compiler 28 # 29 # in former case, just add avx512 C file to files list 30 # in latter case, compile c file to static lib, using correct 31 # compiler flags, and then have the .o file from static lib 32 # linked into main lib. 33 34 # check if all required flags already enabled 35 sketch_avx512_flags = ['__AVX512F__', '__AVX512DQ__', '__AVX512IFMA__'] 36 37 sketch_avx512_on = true 38 foreach f:sketch_avx512_flags 39 if cc.get_define(f, args: machine_args) == '' 40 sketch_avx512_on = false 41 endif 42 endforeach 43 44 if sketch_avx512_on == true 45 cflags += ['-DCC_AVX512_SUPPORT'] 46 sources += files('rte_member_sketch_avx512.c') 47 elif cc.has_multi_arguments('-mavx512f', '-mavx512dq', '-mavx512ifma') 48 sketch_avx512_tmp = static_library('sketch_avx512_tmp', 49 'rte_member_sketch_avx512.c', 50 include_directories: includes, 51 dependencies: [static_rte_eal, static_rte_hash], 52 c_args: cflags + 53 ['-mavx512f', '-mavx512dq', '-mavx512ifma']) 54 objs += sketch_avx512_tmp.extract_objects('rte_member_sketch_avx512.c') 55 cflags += ['-DCC_AVX512_SUPPORT'] 56 endif 57endif 58