Skip to content

Commit defa5d5

Browse files
bruce-richardsondavid-marchand
authored andcommitted
acl: use common AVX build handling
Remove custom logic for building AVX2 and AVX-512 files. Signed-off-by: Bruce Richardson <[email protected]> Acked-by: Konstantin Ananyev <[email protected]>
1 parent ad20bed commit defa5d5

File tree

1 file changed

+4
-50
lines changed

1 file changed

+4
-50
lines changed

lib/acl/meson.build

Lines changed: 4 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,57 +15,11 @@ headers = files('rte_acl.h', 'rte_acl_osdep.h')
1515

1616
if dpdk_conf.has('RTE_ARCH_X86')
1717
sources += files('acl_run_sse.c')
18-
19-
avx2_tmplib = static_library('avx2_tmp',
20-
'acl_run_avx2.c',
21-
dependencies: static_rte_eal,
22-
c_args: [cflags, cc_avx2_flags])
23-
objs += avx2_tmplib.extract_objects('acl_run_avx2.c')
24-
25-
# compile AVX512 version if:
26-
# we are building 64-bit binary AND binutils can generate proper code
27-
28-
if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok
29-
30-
# compile AVX512 version if either:
31-
# a. we have AVX512 supported in minimum instruction set
32-
# baseline
33-
# b. it's not minimum instruction set, but supported by
34-
# compiler
35-
#
36-
# in former case, just add avx512 C file to files list
37-
# in latter case, compile c file to static lib, using correct
38-
# compiler flags, and then have the .o file from static lib
39-
# linked into main lib.
40-
41-
# check if all required flags already enabled (variant a).
42-
acl_avx512_flags = ['__AVX512F__', '__AVX512VL__',
43-
'__AVX512CD__', '__AVX512BW__']
44-
45-
acl_avx512_on = true
46-
foreach f:acl_avx512_flags
47-
48-
if cc.get_define(f, args: machine_args) == ''
49-
acl_avx512_on = false
50-
endif
51-
endforeach
52-
53-
if acl_avx512_on == true
54-
55-
sources += files('acl_run_avx512.c')
56-
cflags += '-DCC_AVX512_SUPPORT'
57-
58-
elif cc_has_avx512
59-
avx512_tmplib = static_library('avx512_tmp',
60-
'acl_run_avx512.c',
61-
dependencies: static_rte_eal,
62-
c_args: cflags + cc_avx512_flags)
63-
objs += avx512_tmplib.extract_objects(
64-
'acl_run_avx512.c')
65-
cflags += '-DCC_AVX512_SUPPORT'
66-
endif
18+
sources_avx2 += files('acl_run_avx2.c')
19+
# AVX512 is only supported on 64-bit builds
20+
if dpdk_conf.has('RTE_ARCH_X86_64')
21+
sources_avx512 += files('acl_run_avx512.c')
6722
endif
68-
6923
elif dpdk_conf.has('RTE_ARCH_ARM')
7024
cflags += '-flax-vector-conversions'
7125
sources += files('acl_run_neon.c')

0 commit comments

Comments
 (0)