[v4,08/11] fib: use common AVX build handling
Checks
Commit Message
Remove custom logic for building AVX2 and AVX-512 files. Within the C
code this requires some renaming of build macros to use the standard
defines.
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
lib/fib/dir24_8.c | 6 +++---
lib/fib/meson.build | 18 +-----------------
lib/fib/trie.c | 6 +++---
3 files changed, 7 insertions(+), 23 deletions(-)
@@ -16,11 +16,11 @@
#include "dir24_8.h"
#include "fib_log.h"
-#ifdef CC_DIR24_8_AVX512_SUPPORT
+#ifdef CC_AVX512_SUPPORT
#include "dir24_8_avx512.h"
-#endif /* CC_DIR24_8_AVX512_SUPPORT */
+#endif /* CC_AVX512_SUPPORT */
#define DIR24_8_NAMESIZE 64
@@ -63,7 +63,7 @@ get_scalar_fn_inlined(enum rte_fib_dir24_8_nh_sz nh_sz, bool be_addr)
static inline rte_fib_lookup_fn_t
get_vector_fn(enum rte_fib_dir24_8_nh_sz nh_sz, bool be_addr)
{
-#ifdef CC_DIR24_8_AVX512_SUPPORT
+#ifdef CC_AVX512_SUPPORT
if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) <= 0 ||
rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ) <= 0 ||
rte_vect_get_max_simd_bitwidth() < RTE_VECT_SIMD_512)
@@ -15,21 +15,5 @@ deps += ['rcu']
deps += ['net']
if dpdk_conf.has('RTE_ARCH_X86_64')
- if target_has_avx512
- cflags += ['-DCC_DIR24_8_AVX512_SUPPORT', '-DCC_TRIE_AVX512_SUPPORT']
- sources += files('dir24_8_avx512.c', 'trie_avx512.c')
-
- elif cc_has_avx512
- cflags += ['-DCC_DIR24_8_AVX512_SUPPORT', '-DCC_TRIE_AVX512_SUPPORT']
- dir24_8_avx512_tmp = static_library('dir24_8_avx512_tmp',
- 'dir24_8_avx512.c',
- dependencies: [static_rte_eal, static_rte_rcu],
- c_args: cflags + cc_avx512_flags)
- objs += dir24_8_avx512_tmp.extract_objects('dir24_8_avx512.c')
- trie_avx512_tmp = static_library('trie_avx512_tmp',
- 'trie_avx512.c',
- dependencies: [static_rte_eal, static_rte_rcu, static_rte_net],
- c_args: cflags + cc_avx512_flags)
- objs += trie_avx512_tmp.extract_objects('trie_avx512.c')
- endif
+ sources_avx512 = files('dir24_8_avx512.c', 'trie_avx512.c')
endif
@@ -14,11 +14,11 @@
#include <rte_fib6.h>
#include "trie.h"
-#ifdef CC_TRIE_AVX512_SUPPORT
+#ifdef CC_AVX512_SUPPORT
#include "trie_avx512.h"
-#endif /* CC_TRIE_AVX512_SUPPORT */
+#endif /* CC_AVX512_SUPPORT */
#define TRIE_NAMESIZE 64
@@ -45,7 +45,7 @@ get_scalar_fn(enum rte_fib_trie_nh_sz nh_sz)
static inline rte_fib6_lookup_fn_t
get_vector_fn(enum rte_fib_trie_nh_sz nh_sz)
{
-#ifdef CC_TRIE_AVX512_SUPPORT
+#ifdef CC_AVX512_SUPPORT
if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) <= 0 ||
rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ) <= 0 ||
rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) <= 0 ||