1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
4 sources = files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c',
5 'rte_acl.c', 'tb_mem.c')
6 headers = files('rte_acl.h', 'rte_acl_osdep.h')
8 if dpdk_conf.has('RTE_ARCH_X86')
9 sources += files('acl_run_sse.c')
11 # compile AVX2 version if either:
12 # a. we have AVX supported in minimum instruction set baseline
13 # b. it's not minimum instruction set, but supported by compiler
15 # in former case, just add avx2 C file to files list
16 # in latter case, compile c file to static lib, using correct compiler
17 # flags, and then have the .o file from static lib linked into main lib.
18 if cc.get_define('__AVX2__', args: machine_args) != ''
19 sources += files('acl_run_avx2.c')
20 cflags += '-DCC_AVX2_SUPPORT'
21 elif cc.has_argument('-mavx2')
22 avx2_tmplib = static_library('avx2_tmp',
24 dependencies: static_rte_eal,
25 c_args: cflags + ['-mavx2'])
26 objs += avx2_tmplib.extract_objects('acl_run_avx2.c')
27 cflags += '-DCC_AVX2_SUPPORT'
30 # compile AVX512 version if:
31 # we are building 64-bit binary AND binutils can generate proper code
33 if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok.returncode() == 0
35 # compile AVX512 version if either:
36 # a. we have AVX512 supported in minimum instruction set
38 # b. it's not minimum instruction set, but supported by
41 # in former case, just add avx512 C file to files list
42 # in latter case, compile c file to static lib, using correct
43 # compiler flags, and then have the .o file from static lib
44 # linked into main lib.
46 # check if all required flags already enabled (variant a).
47 acl_avx512_flags = ['__AVX512F__', '__AVX512VL__',
48 '__AVX512CD__', '__AVX512BW__']
51 foreach f:acl_avx512_flags
53 if cc.get_define(f, args: machine_args) == ''
58 if acl_avx512_on == true
60 sources += files('acl_run_avx512.c')
61 cflags += '-DCC_AVX512_SUPPORT'
63 elif cc.has_multi_arguments('-mavx512f', '-mavx512vl',
64 '-mavx512cd', '-mavx512bw')
66 avx512_tmplib = static_library('avx512_tmp',
68 dependencies: static_rte_eal,
70 ['-mavx512f', '-mavx512vl',
71 '-mavx512cd', '-mavx512bw'])
72 objs += avx512_tmplib.extract_objects(
74 cflags += '-DCC_AVX512_SUPPORT'
78 elif dpdk_conf.has('RTE_ARCH_ARM')
79 cflags += '-flax-vector-conversions'
80 sources += files('acl_run_neon.c')
81 elif dpdk_conf.has('RTE_ARCH_PPC_64')
82 sources += files('acl_run_altivec.c')