Skip to contentSkip to conversation

mk: Detect AVX2 capability based on the target CPU architecture

PATCH Ananyev, Konstantin 1 participant 1 message Jul 22, 2018 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 9 lines

-----Original Message-----
From: Chaeyong Chong [mailto:[email protected]]
Sent: Saturday, July 21, 2018 3:54 PM
To: Ananyev, Konstantin <[email protected]>
Cc: [email protected]; Chaeyong Chong <[email protected]>; [email protected]
Subject: [PATCH] mk: Detect AVX2 capability based on the target CPU architecture

Quoted 4 lines

From: Chaeyong Chong <[email protected]>

AVX2 support check should be based on the target CPU architecure. For this, -march option should be $(RTE_MACHINE) instead of core-avx2.

I don't really think it should.
The purpose is to build an AVX2 function even for 'default' target. Then at runtime proper version of the code (SSE/AVX2/etc) could be selected. So NACK.
Konstantin

Quoted 23 lines
---
 lib/librte_acl/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_acl/Makefile +1 -2
index ea5edf00a..c756eaeb2 100644
@@ -44,7 +44,7 @@ ifeq ($(findstring RTE_MACHINE_CPUFLAG_AVX2,$(CFLAGS)),RTE_MACHINE_CPUFLAG_AVX2)
 	CC_AVX2_SUPPORT=1
 else
 	CC_AVX2_SUPPORT=\
-	$(shell $(CC) -march=core-avx2 -dM -E - </dev/null 2>&1 | \
+	$(shell $(CC) -march=$(RTE_MACHINE) -dM -E - </dev/null 2>&1 | \
 	grep -q AVX2 && echo 1)
 	ifeq ($(CC_AVX2_SUPPORT), 1)
 		ifeq ($(CONFIG_RTE_TOOLCHAIN_ICC),y)
--

2.18.0