[dpdk-dev] [PATCH v2 16/16] acl: check for SSE 4.1 support

Jan Viktorin viktorin at rehivetech.com
Mon Oct 26 17:37:38 CET 2015


The main goal of this check is to avoid passing the -msse4.1
option to the GCC that does not support it (like arm toolchains).

Anyway, the ACL library does not compile on ARM.

Signed-off-by: Jan Viktorin <viktorin at rehivetech.com>
---
 lib/librte_acl/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile
index 7a1cf8a..401fb8c 100644
--- a/lib/librte_acl/Makefile
+++ b/lib/librte_acl/Makefile
@@ -50,7 +50,11 @@ SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_gen.c
 SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_scalar.c
 SRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_sse.c
 
+CC_SSE4_1_SUPPORT := $(shell $(CC) -msse4.1 -dM -E - < /dev/null >/dev/null 2>&1 && echo 1)
+
+ifeq ($(CC_SSE4_1_SUPPORT),1)
 CFLAGS_acl_run_sse.o += -msse4.1
+endif
 
 #
 # If the compiler supports AVX2 instructions,
-- 
2.6.1



More information about the dev mailing list