Skip to content

Commit 82621e2

Browse files
bruce-richardsondavid-marchand
authored andcommitted
net: use common AVX512 build checks
Replace some library-specific checks for AVX-512 with the standard variables from config/x86. Signed-off-by: Bruce Richardson <[email protected]> Acked-by: David Marchand <[email protected]>
1 parent ef7a402 commit 82621e2

File tree

1 file changed

+4
-34
lines changed

1 file changed

+4
-34
lines changed

lib/net/meson.build

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,12 @@ deps += ['mbuf']
3939
if dpdk_conf.has('RTE_ARCH_X86_64')
4040
net_crc_sse42_cpu_support = (cc.get_define('__PCLMUL__', args: machine_args) != '')
4141
net_crc_avx512_cpu_support = (
42-
cc.get_define('__AVX512F__', args: machine_args) != '' and
43-
cc.get_define('__AVX512BW__', args: machine_args) != '' and
44-
cc.get_define('__AVX512DQ__', args: machine_args) != '' and
45-
cc.get_define('__AVX512VL__', args: machine_args) != '' and
42+
target_has_avx512 and
4643
cc.get_define('__VPCLMULQDQ__', args: machine_args) != ''
4744
)
4845

4946
net_crc_sse42_cc_support = (cc.has_argument('-mpclmul') and cc.has_argument('-maes'))
50-
net_crc_avx512_cc_support = (
51-
not machine_args.contains('-mno-avx512f') and
52-
cc.has_argument('-mavx512f') and
53-
cc.has_argument('-mavx512bw') and
54-
cc.has_argument('-mavx512dq') and
55-
cc.has_argument('-mavx512vl') and
56-
cc.has_argument('-mvpclmulqdq') and
57-
cc.has_argument('-mavx2') and
58-
cc.has_argument('-mavx')
59-
)
47+
net_crc_avx512_cc_support = (cc.has_argument('-mvpclmulqdq') and cc_has_avx512)
6048

6149
build_static_net_crc_sse42_lib = 0
6250
build_static_net_crc_avx512_lib = 0
@@ -69,15 +57,7 @@ if dpdk_conf.has('RTE_ARCH_X86_64')
6957
cflags += ['-DCC_X86_64_AVX512_VPCLMULQDQ_SUPPORT']
7058
elif net_crc_avx512_cc_support == true
7159
build_static_net_crc_avx512_lib = 1
72-
net_crc_avx512_lib_cflags = [
73-
'-mavx512f',
74-
'-mavx512bw',
75-
'-mavx512dq',
76-
'-mavx512vl',
77-
'-mvpclmulqdq',
78-
'-mavx2',
79-
'-mavx',
80-
]
60+
net_crc_avx512_lib_cflags = cc_avx512_flags + ['-mvpclmulqdq']
8161
cflags += ['-DCC_X86_64_AVX512_VPCLMULQDQ_SUPPORT']
8262
endif
8363
elif net_crc_sse42_cc_support == true
@@ -86,17 +66,7 @@ if dpdk_conf.has('RTE_ARCH_X86_64')
8666
cflags += ['-DCC_X86_64_SSE42_PCLMULQDQ_SUPPORT']
8767
if net_crc_avx512_cc_support == true
8868
build_static_net_crc_avx512_lib = 1
89-
net_crc_avx512_lib_cflags = [
90-
'-mpclmul',
91-
'-maes',
92-
'-mavx512f',
93-
'-mavx512bw',
94-
'-mavx512dq',
95-
'-mavx512vl',
96-
'-mvpclmulqdq',
97-
'-mavx2',
98-
'-mavx',
99-
]
69+
net_crc_avx512_lib_cflags = cc_avx512_flags + ['-mvpclmulqdq', '-mpclmul']
10070
cflags += ['-DCC_X86_64_AVX512_VPCLMULQDQ_SUPPORT']
10171
endif
10272
endif

0 commit comments

Comments
 (0)