member: use common top-level variable for easier maintenance
PATCH 1/1 member: use common top-level variable for easier maintenance
Updated meson.build to use common variable cc_avx512_flags for msvc and avoiding code duplication for other compilers.
--- lib/member/meson.build | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
lib/member/meson.build +8 -3
@@ -33,6 +33,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok # compiler flags, and then have the .o file from static lib # linked into main lib. + if is_ms_compiler + member_avx512_args = cc_avx512_flags + else + member_avx512_args = ['-mavx512f', '-mavx512dq', '-mavx512ifma'] + endif + # check if all required flags already enabled sketch_avx512_flags = ['__AVX512F__', '__AVX512DQ__', '__AVX512IFMA__']
@@ -46,13 +52,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok if sketch_avx512_on == true cflags += ['-DCC_AVX512_SUPPORT'] sources += files('rte_member_sketch_avx512.c') - elif cc.has_multi_arguments('-mavx512f', '-mavx512dq', '-mavx512ifma') + elif cc.has_multi_arguments(member_avx512_args) sketch_avx512_tmp = static_library('sketch_avx512_tmp', 'rte_member_sketch_avx512.c', include_directories: includes, dependencies: [static_rte_eal, static_rte_hash], - c_args: cflags + - ['-mavx512f', '-mavx512dq', '-mavx512ifma']) + c_args: cflags + member_avx512_args) objs += sketch_avx512_tmp.extract_objects('rte_member_sketch_avx512.c') cflags += ['-DCC_AVX512_SUPPORT'] endif
Signature · 1 line
2.48.1.vfs.0.0
Quoted 13 lines · Andre Muezerie
Updated meson.build to use common variable
cc_avx512_flagsfor msvc and avoiding code duplication for other compilers.Signed-off-by Andre Muezerie <[email protected]>--- lib/member/meson.build | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)lib/member/meson.build +0
-0
lib/member/meson.build if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok · line 41
Quoted 9 lines
lib/member/meson.build +6
-0@@ -33,6 +33,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok # compiler flags, and then have the .o file from static lib # linked into main lib. + if is_ms_compiler + member_avx512_args = cc_avx512_flags + else + member_avx512_args = ['-mavx512f', '-mavx512dq', '-mavx512ifma'] + endif +
Would this be better as:
member_avx512_args = cc_avx512_flags
if not is_ms_compiler
member_avx512_args += '-mavx512ifma'
endif
WDYT?
Quoted 22 lines
lib/member/meson.build +2
-3# check if all required flags already enabled sketch_avx512_flags = ['__AVX512F__', '__AVX512DQ__', '__AVX512IFMA__']@@ -46,13 +52,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok if sketch_avx512_on == true cflags += ['-DCC_AVX512_SUPPORT'] sources += files('rte_member_sketch_avx512.c') - elif cc.has_multi_arguments('-mavx512f', '-mavx512dq', '-mavx512ifma') + elif cc.has_multi_arguments(member_avx512_args) sketch_avx512_tmp = static_library('sketch_avx512_tmp', 'rte_member_sketch_avx512.c', include_directories: includes, dependencies: [static_rte_eal, static_rte_hash], - c_args: cflags + - ['-mavx512f', '-mavx512dq', '-mavx512ifma']) + c_args: cflags + member_avx512_args) objs += sketch_avx512_tmp.extract_objects('rte_member_sketch_avx512.c') cflags += ['-DCC_AVX512_SUPPORT'] endifSignature · 1 line
2.48.1.vfs.0.0
Quoted 26 lines · Bruce Richardson
Quoted 13 lines · Andre Muezerie
Updated meson.build to use common variable
cc_avx512_flagsfor msvc and avoiding code duplication for other compilers.Signed-off-by Andre Muezerie <[email protected]>--- lib/member/meson.build | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)lib/member/meson.build +0
-0lib/member/meson.build if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok · line 41
Quoted 9 lines
lib/member/meson.build +6
-0@@ -33,6 +33,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok # compiler flags, and then have the .o file from static lib # linked into main lib. + if is_ms_compiler + member_avx512_args = cc_avx512_flags + else + member_avx512_args = ['-mavx512f', '-mavx512dq', '-mavx512ifma'] + endif +Would this be better as:
Quoted 6 lines
member_avx512_args=cc_avx512_flags
if notis_ms_compilermember_avx512_args += '-mavx512ifma'endif
WDYT?
That is slightly simpler. I updated the patch accordingly.
Quoted 23 lines
Quoted 23 lines
lib/member/meson.build +2
-3# check if all required flags already enabled sketch_avx512_flags = ['__AVX512F__', '__AVX512DQ__', '__AVX512IFMA__']@@ -46,13 +52,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok if sketch_avx512_on == true cflags += ['-DCC_AVX512_SUPPORT'] sources += files('rte_member_sketch_avx512.c') - elif cc.has_multi_arguments('-mavx512f', '-mavx512dq', '-mavx512ifma') + elif cc.has_multi_arguments(member_avx512_args) sketch_avx512_tmp = static_library('sketch_avx512_tmp', 'rte_member_sketch_avx512.c', include_directories: includes, dependencies: [static_rte_eal, static_rte_hash], - c_args: cflags + - ['-mavx512f', '-mavx512dq', '-mavx512ifma']) + c_args: cflags + member_avx512_args) objs += sketch_avx512_tmp.extract_objects('rte_member_sketch_avx512.c') cflags += ['-DCC_AVX512_SUPPORT'] endifSignature · 1 line
2.48.1.vfs.0.0
PATCH v2 1/1 member: use common top-level variable for easier maintenance
In reply to Andre MuezerieUpdated meson.build to use common variable cc_avx512_flags for msvc and avoiding code duplication for other compilers.
--- lib/member/meson.build | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
lib/member/meson.build +7 -3
@@ -33,6 +33,11 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok # compiler flags, and then have the .o file from static lib # linked into main lib. + member_avx512_args = cc_avx512_flags + if not is_ms_compiler + member_avx512_args += '-mavx512ifma' + endif + # check if all required flags already enabled sketch_avx512_flags = ['__AVX512F__', '__AVX512DQ__', '__AVX512IFMA__']
@@ -46,13 +51,12 @@ if dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok if sketch_avx512_on == true cflags += ['-DCC_AVX512_SUPPORT'] sources += files('rte_member_sketch_avx512.c') - elif cc.has_multi_arguments('-mavx512f', '-mavx512dq', '-mavx512ifma') + elif cc.has_multi_arguments(member_avx512_args) sketch_avx512_tmp = static_library('sketch_avx512_tmp', 'rte_member_sketch_avx512.c', include_directories: includes, dependencies: [static_rte_eal, static_rte_hash], - c_args: cflags + - ['-mavx512f', '-mavx512dq', '-mavx512ifma']) + c_args: cflags + member_avx512_args) objs += sketch_avx512_tmp.extract_objects('rte_member_sketch_avx512.c') cflags += ['-DCC_AVX512_SUPPORT'] endif
Signature · 1 line
2.48.1.vfs.0.0
Quoted 5 lines · Andre Muezerie
Updated meson.build to use common variable
cc_avx512_flagsfor msvc and avoiding code duplication for other compilers.Signed-off-by Andre Muezerie <[email protected]>---
David Marchand
AppliedQuoted 8 lines · Bruce Richardson
Quoted 5 lines · Andre Muezerie
Updated meson.build to use common variable
cc_avx512_flagsfor msvc and avoiding code duplication for other compilers.Signed-off-by Andre Muezerie <[email protected]>---
Acked-by Bruce Richardson <[email protected]>
Applied, thanks.
Signature · 1 line
David Marchand