1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2017 Intel Corporation
6 reason = 'not supported on Windows'
10 sources = files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c',
11 'rte_acl.c', 'tb_mem.c')
12 headers = files('rte_acl.h', 'rte_acl_osdep.h')
14 if dpdk_conf.has('RTE_ARCH_X86')
15 sources += files('acl_run_sse.c')
17 # compile AVX2 version if either:
18 # a. we have AVX supported in minimum instruction set baseline
19 # b. it's not minimum instruction set, but supported by compiler
21 # in former case, just add avx2 C file to files list
22 # in latter case, compile c file to static lib, using correct compiler
23 # flags, and then have the .o file from static lib linked into main lib.
24 if cc.get_define('__AVX2__', args: machine_args) != ''
25 sources += files('acl_run_avx2.c')
26 cflags += '-DCC_AVX2_SUPPORT'
27 elif cc.has_argument('-mavx2')
28 avx2_tmplib = static_library('avx2_tmp',
30 dependencies: static_rte_eal,
31 c_args: cflags + ['-mavx2'])
32 objs += avx2_tmplib.extract_objects('acl_run_avx2.c')
33 cflags += '-DCC_AVX2_SUPPORT'
36 # compile AVX512 version if:
37 # we are building 64-bit binary AND binutils can generate proper code
39 if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
41 # compile AVX512 version if either:
42 # a. we have AVX512 supported in minimum instruction set
44 # b. it's not minimum instruction set, but supported by
47 # in former case, just add avx512 C file to files list
48 # in latter case, compile c file to static lib, using correct
49 # compiler flags, and then have the .o file from static lib
50 # linked into main lib.
52 # check if all required flags already enabled (variant a).
53 acl_avx512_flags = ['__AVX512F__', '__AVX512VL__',
54 '__AVX512CD__', '__AVX512BW__']
57 foreach f:acl_avx512_flags
59 if cc.get_define(f, args: machine_args) == ''
64 if acl_avx512_on == true
66 sources += files('acl_run_avx512.c')
67 cflags += '-DCC_AVX512_SUPPORT'
69 elif cc.has_multi_arguments('-mavx512f', '-mavx512vl',
70 '-mavx512cd', '-mavx512bw')
72 avx512_tmplib = static_library('avx512_tmp',
74 dependencies: static_rte_eal,
76 ['-mavx512f', '-mavx512vl',
77 '-mavx512cd', '-mavx512bw'])
78 objs += avx512_tmplib.extract_objects(
80 cflags += '-DCC_AVX512_SUPPORT'
84 elif dpdk_conf.has('RTE_ARCH_ARM')
85 cflags += '-flax-vector-conversions'
86 sources += files('acl_run_neon.c')
87 elif dpdk_conf.has('RTE_ARCH_PPC_64')
88 sources += files('acl_run_altivec.c')