acl: add AVX2 classify method
[dpdk.git] / lib / librte_acl / Makefile
index 4fe4593..6b74dc9 100644 (file)
@@ -43,7 +43,28 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += tb_mem.c
 SRCS-$(CONFIG_RTE_LIBRTE_ACL) += rte_acl.c
 SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_bld.c
 SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_gen.c
-SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run.c
+SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_scalar.c
+SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_sse.c
+
+CFLAGS_acl_run_sse.o += -msse4.1
+
+#
+# If the compiler supports AVX2 instructions,
+# then add support for AVX2 classify method.
+#
+
+CC_AVX2_SUPPORT=$(shell $(CC) -march=core-avx2 -dM -E - </dev/null 2>&1 | \
+grep -q AVX2 && echo 1)
+
+ifeq ($(CC_AVX2_SUPPORT), 1)
+       SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_avx2.c
+       CFLAGS_rte_acl.o += -DCC_AVX2_SUPPORT
+       ifeq ($(CC), icc)
+       CFLAGS_acl_run_avx2.o += -march=core-avx2
+       else
+       CFLAGS_acl_run_avx2.o += -mavx2
+       endif
+endif
 
 # install this header file
 SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include := rte_acl_osdep.h